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

Remove json gem #1011

Merged
merged 1 commit into from Jun 30, 2016
Merged

Remove json gem #1011

merged 1 commit into from Jun 30, 2016

Conversation

mperham
Copy link
Contributor

@mperham mperham commented Feb 3, 2016

The json gem has been included in Ruby stdlib since 1.9. The gem itself causes difficulties building on Windows so depending on the gem is actually a net negative these days.

The json gem has been included in Ruby stdlib since 1.9.  The gem itself causes difficulties building on Windows so depending on the gem is actually a net negative these days.
deepj added a commit to deepj/autoprefixer-rails that referenced this pull request Feb 21, 2016
JSON support is in Ruby since 1.9 so there is no need to have json gem
as a dependency.

Inspired by this Rack’s PR rack/rack#1011
deepj added a commit to deepj/httparty that referenced this pull request Feb 21, 2016
JSON support is in Ruby since 1.9 so there is no need to have json gem
as a dependency.

Inspired by this Rack’s PR rack/rack#1011
deepj added a commit to deepj/carrierwave that referenced this pull request Feb 21, 2016
JSON support is in Ruby since 1.9 so there is no need to have json gem
as a dependency.

Inspired by this Rack’s PR rack/rack#1011
@tenderlove
Copy link
Member

But Rack actually depends on json. It doesn't seem good to remove a dependency that is actually a dependency. What, specifically, do we gain by removing it?

@mperham
Copy link
Contributor Author

mperham commented Mar 3, 2016

@tenderlove Sure, and that's why you have to require it. But it's not a gem dependency. JSON has been in the stdlib for years and does not need to be declared in gemspec.

As for positives, it means you don't need a compiler and have one less native gem. I've heard rumors of build difficulties with the gem on Windows that were unnecessary when ruby is distributed pre-built.

@tenderlove
Copy link
Member

It's a gem, and we depend on it. I'm really confused.

@matthewd
Copy link
Contributor

matthewd commented Mar 3, 2016

If it's in stdlib as a gem, rubygems/bundler should be happy to use the existing one without installing a new one, even with the dependency declared... shouldn't it?

@tenderlove
Copy link
Member

If you just declare the gem as a dependency with no version requirement, then the one that ships with Ruby should be Good Enough™. I don't see why "difficulties building on Windows" would come in to play when the JSON gem provided with the distribution fulfills an open-ended dependency.

@matthewd
Copy link
Contributor

matthewd commented Mar 3, 2016

Ah, right... bundler will seek out the latest version available, so as long as that's newer than the pre-installed one, you'll do a build.

@tenderlove
Copy link
Member

Just because gems are shipped with Ruby doesn't mean that we shouldn't declare them as dependencies. They are gems, and they are dependencies, so they are gem dependencies, so I do want to declare them.

OTOH, I didn't expect Bundler to install the latest one even though the one on the system would work just fine. Given that fact, I'm happy to drop the dep. Is this something we should bother team Bundler with?

@raggi
Copy link
Member

raggi commented Jun 5, 2016

You know, that kloc we had before was faster and less problematic :(

@tenderlove tenderlove merged commit 1a40868 into rack:master Jun 30, 2016
mynock pushed a commit to mynock/carrierwave that referenced this pull request Aug 9, 2016
JSON support is in Ruby since 1.9 so there is no need to have json gem
as a dependency.

Inspired by this Rack’s PR rack/rack#1011
@mperham mperham deleted the patch-1 branch March 22, 2018 18:23
dmytro-dobriev pushed a commit to dmytro-dobriev/autoprefixer-rails that referenced this pull request Oct 15, 2021
JSON support is in Ruby since 1.9 so there is no need to have json gem
as a dependency.

Inspired by this Rack’s PR rack/rack#1011
jeremycraney added a commit to jeremycraney/httparty that referenced this pull request Dec 28, 2021
JSON support is in Ruby since 1.9 so there is no need to have json gem
as a dependency.

Inspired by this Rack’s PR rack/rack#1011
koziiroman pushed a commit to koziiroman/Autoprefixer-RubyOnRails that referenced this pull request Apr 4, 2022
JSON support is in Ruby since 1.9 so there is no need to have json gem
as a dependency.

Inspired by this Rack’s PR rack/rack#1011
BlackSpider8391 added a commit to BlackSpider8391/autoprefixer-rails that referenced this pull request Feb 21, 2023
JSON support is in Ruby since 1.9 so there is no need to have json gem
as a dependency.

Inspired by this Rack’s PR rack/rack#1011
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.

None yet

4 participants