Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle deprecation of Rack::File in Rack 3.1 #773

Merged
merged 2 commits into from Nov 17, 2023

Conversation

czj
Copy link
Contributor

@czj czj commented Nov 13, 2023

When using Rack >= 3.0.0 you get this error message on boot an app with Flipper UI :

warning: Rack::File is deprecated and will be removed in Rack 3.1

This PR detects if Rack::Files is available and tries to use it instead.

Closes #769

Rack deprecation source

When using Rack >= 3.0.0 you get this error message on boot an app with Flipper UI :

```
warning: Rack::File is deprecated and will be removed in Rack 3.1
```

This PR detects if `Rack::Files` is defined and tries to use it instead.

Source : rack/rack#1720
@skellock
Copy link

A fellow warning removal enthusiast! Greetings!

Should we do the Rack.release dance around the require too?

if Rack.release >= "2.1"
  require 'rack/files'
else
  require 'rack/file'
end

That warning fires when we require 'rack/file' but not if require 'rack/files'.

Thanks! Hope you're having a great day.

@czj
Copy link
Contributor Author

czj commented Nov 16, 2023

Removing warnings makes me happy, indeed!

Here's the updated code with your fine suggestion included.

Thank you! :)

Copy link

@skellock skellock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this fixes the warning on a Rails 7.1.x project.

I like when rabbit hole adventures end like this.

@jnunemaker jnunemaker merged commit f9ecf17 into flippercloud:main Nov 17, 2023
32 checks passed
@jnunemaker
Copy link
Collaborator

@skellock @czj I've been giving www.flippercloud.io credits to people who contribute, so if you want to check it out beyond the free tier or trial, let me know and I'll spot you several months or more.

Lastly, if you don't mind, I would love to know what you are using flipper for as well and how it is working out for you (what went well, what was hard other than what you mentioned here).

If you aren't comfortable leaving that information here in a public comment, feel free to email me directly john@fewerandfaster.com. I'm just always curious. :)

Thanks again!

@czj czj deleted the patch-1 branch November 17, 2023 16:04
@czj
Copy link
Contributor Author

czj commented Nov 20, 2023

Thank you for the offer, @jnunemaker! If we feel the need to go beyond the Flipper UI, we'll reach out to you.

We are an e-commerce company in France, specializing in high-fidelity and home theater electronics, gradually expanding to Europe. We have a small DevOps team of 2 people, in a company of 22 people. We run almost everything on a 17-year-old Rails monolith shiny as new !

We switched to Flipper instead of our in-house super-basic feature flag tooling and have been enjoying every aspect of it, including the nice and fast UI, easy definition of actors.

Like many others, we use feature flags for rolling out new features, conducting experiments, avoiding long-lasting feature branches, and activating infrequent features (such as for Black Friday or when a service we use experiences an outage).

@jnunemaker
Copy link
Collaborator

@czj that is awesome! Thanks for taking the time. I love hearing the stories of how flipper has helped people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

warning: Rack::File is deprecated and will be removed in Rack 3.1
3 participants