-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Clarification regarding Rack::Request#[]
#1277
Comments
It was moved into helpers about 2 years ago and looks to me like it's not so much that it will go away any time soon just that it's discouraged in lieu of |
I think Aaron and I were pairing on something but I don't remember specifically why. Either way, you should use |
It's basically just an alias for Lines 426 to 444 in e2793b2
I really like it as it makes code short and concise. |
@ioquatix if the issue is that you want to be able to convert to future versions without changing this everywhere, while I think you should just make the necessary changes now or at upgrade, nothing stops you from aliasing this yourself from your own app. |
To me, it's confusingly ambiguous because there's more than one thing it could reasonably be indexing: most notably, the That's why I'd be inclined to remove it, at least. |
I don't personally find it confusing or ambiguous, since it's well documented, especially since headers and env have entirely different keys. I can certainly understand how it's superfluous to existing functionality, and converting the key to a string is also an additional overhead, so on that basis I can understand it's removal. That being said, I find it a convenient shortcut which leads to terser code. |
For existing use cases, I'm not sure what we gain by removing this API. That was really my original question. Basically, once this API is removed, I need to make a lot of changes (I'm sure I'm not the only one), but I'm not sure to what end anyone benefits from this removal. |
Sorry to overload you with pings @tenderlove but I was wondering if you had thoughts on this, particularly as far as when one might expect this behavior to retired. |
Removing an API would need to be a major version bump, so maybe Rack 3.0? |
Ya, I don't expect we'd remove this until 3.0. My personal expectation is that |
I think if we are planning on deprecating this in Rack 3, the warning should be emitted even in non-verbose mode at some point before Rack 3. I'm not sure if that point is now, but the sooner the better in my opinion. Since 2.1 has already been released, I think 2.2 (master) would be a good time to do that. |
Additionally, use the :uplevel keyword to warn, so it includes the caller information in the warning output (similar to rb_warn). This only works on Ruby 2.5+, so output will look a little odd on Ruby 2.3/2.4, but I don't think it warrants separate handling in older versions. Fixes rack#1277
Additionally, use the :uplevel keyword to warn, so it includes the caller information in the warning output (similar to rb_warn). This only works on Ruby 2.5+, so output will look a little odd on Ruby 2.3/2.4, but I don't think it warrants separate handling in older versions. Fixes rack#1277
Additionally, use the :uplevel keyword to warn, so it includes the caller information in the warning output (similar to rb_warn). This only works on Ruby 2.5+, so output will look a little odd on Ruby 2.3/2.4, but I don't think it warrants separate handling in older versions. Fixes #1277
Great. The only thing we haven't done is:
|
This method issues a warning that it will be deprecated.
But it's used in a lot of code.
What is the reason for it's deprecation and what is the timeline for removal?
I couldn't find any documentation regarding this.
It's a convenient shortcut.
The text was updated successfully, but these errors were encountered: