-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Drop activesupport dependency from sinatra-contrib #1448
Conversation
ActiveSupport was being loaded to provide Object#try. It's a very large dependency that can monkey patch many core classes, and although the require in sinatra-contrib is targeted and doesn't load all of ActiveSupport, once the gem is on the load path some other libraries will opportunistically load more of it. Object#try is only used twice, maybe it's ok to live with a manual check for nil for now? sinatra-contrib currently requires ruby 2.2 or better - once the minimum is lifted to 2.3, Object#try will be provided by ruby core.
Oh, thanks for the pointer to #1208 - I hadn't noticed that someone else had tried almost the same changes as me ( My reading of the earlier PR is that the discussion about breaking backwards compatibility is centered around changing the method signature of This PR is more targeted in scope than #1208 and doesn't attempt to remove backports (although I'm also broadly supportive of that in the long term), and I don't think there are any backwards compatibility issues with the subset of changes proposed here. It's possible I'm wrong though, it happens occasionally. |
okay, I'm going to revisit this patch next week. |
I don't have a strong feeling either way - I'd be happy to change to the |
Can we also just use the safe navigation operator? ActiveSupport seems really big to pull in here just for |
OK, guys, what's the status of this? Can we finally get rid off of the |
Is there movement here? I'd like to pull out active support from my project.. |
Hmm, 2.0.4 is out and this has not been included? That's sad. For our team, sinatra is on hold until the |
What are the outstanding concerns? If there are none, let's get this merged. |
I withdraw my earlier suggestion re backward compatibility, as @yob's version is more consistent with the ActiveSupport implementation of It would be really nice to see this merged and released. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Sorry for the delay, but thanks for your contribution!
Thank you!! 👍👍👍 |
If the support for active_support has been removed here. Why is there still a lock for active_support 5.1.6 in Sinatra's Gemfile? Line 37 in 68908ff
|
### sinatra-contrib * Add `flush` option to `content_for` [#1225](sinatra/sinatra#1225) by Shota Iguchi * Drop activesupport dependency from sinatra-contrib [#1448](sinatra/sinatra#1448) * Update `yield_content` to append default to ERB template buffer [#1500](sinatra/sinatra#1500) by Jordan Owens
ActiveSupport was being loaded to provide
Object#try
. It's a very large dependency that can monkey patch many core classes, and although the require insinatra-contrib
is targeted and doesn't load all of ActiveSupport, once the gem is on the load path some other libraries will opportunistically load more of it.Object#try
is only used twice, maybe it's ok to live with a manual check for nil for now?sinatra-contrib
currently requires ruby 2.2 or better - once the minimum is lifted to 2.3, Object#try will be provided by ruby core.