gjtorikian / html-pipeline

HTML processing filters and utilities
MIT License
2.27k stars 382 forks source link

Bump Active Support dependency to version >= 2 #257

Closed JuanitoFatas closed 8 years ago

JuanitoFatas commented 8 years ago

Closes #252

This Pull Request unlocks Active Support dependency to >= 2, so that App used HTML::Pipeline can upgrade to Rails 5.

Changes

screenshot 2016-07-03 16 25 17

ruby-head is nice to pass, but failed is fine.

Test with Rails 5 apps

HTML::Pipeline works great with these Rails 5.0.0 apps:

JuanitoFatas commented 8 years ago

@jch @simeonwillbanks 👍 ?

jch commented 8 years ago

Sorry, I haven't had a chance to test this on Rails 5 yet. In addition to the tests, has this been used in a production app yet? We're still using a patched version of Rails 3 and moving towards 4.

JuanitoFatas commented 8 years ago

has this been used in a production app yet?

Yes, the RedDotRubyConf webiste uses HTML::Pipeline. And I created a Rails 5 app with some specs.

For tests: I can setup a test suite with https://github.com/thoughtbot/appraisal. But I am also thinking create some real apps and put them under github.com/html-pipeline organization, what do you think?

JuanitoFatas commented 8 years ago

@jch Please review and 🚢:shipit::heart:

bdewater commented 8 years ago

Instead of allow_failures for Rails 5 and Ruby versions < 2.2.2, use exclude to save CPU time on Travis.

JuanitoFatas commented 8 years ago

Instead of allow_failures for Rails 5 and Ruby versions < 2.2.2, use exclude to save CPU time on Travis.

Thanks Bart! ❤️ Updated .travis.yml in a31fa29.

glebm commented 8 years ago

has this been used in a production app yet?

Also now running on https://thredded.org/ with Rails 5.0.0 and this PR as of this comment.

n-rodriguez commented 8 years ago

hi there! any news?

parkr commented 8 years ago

@jch Just so you know, this has caused muchas problemas for systems using Ruby < 2.2.2, which isn't smart enough to install activesupport v4.x:

jch commented 8 years ago

@parkr good catch. This has been a frustration each time html-pipeline upgrades it's dependencies be because of it's loose constraints on versions. I proposed splitting up the gem into smaller gems to narrow down these problems in https://github.com/jch/html-pipeline/issues/182, but did not make any changes at the time.

Could you talk more about why this is breaking for specific versions of Ruby? What workaround have you taken for it?

parkr commented 8 years ago

Could you talk more about why this is breaking for specific versions of Ruby?

Absolutely. The issue affects anyone installing jemoji or jekyll-mentions, two gems which rely on this gem (bindings for the emoji filter and mentions filter, respectively). When one specifies gem "jekyll-mentions" in one's Gemfile and executes bundle install, they see the error saying that activesupport 5.0.0 requires Ruby 2.2.2 or higher to install. Instead of gracefully downgrading to activesupport 4.2.7, it simply fails. The two plugins I mentioned above simply specify their dependency on html-pipeline. Neither bundler nor RubyGems for Ruby 2.1 appear to be able to gracefully downgrade a dependency until they all resolve to installable versions.

What workaround have you taken for it?

The workaround we went for is to lock down activesupport to ~> 4.0 (e.g. jekyll/jemoji#47) as it is compatible with all Ruby versions we test with (2.0, 2.1, 2.2, 2.3). I looked at the emoji filter and all activesupport is used for is HashWithIndifferentAccess. :frowning: Perhaps we could remove that dependency on the emoji filter?

JuanitoFatas commented 8 years ago

The workaround we went for is to lock down activesupport to ~> 4.0 (e.g. jekyll/jemoji#47) as it is compatible with all Ruby versions we test with (2.0, 2.1, 2.2, 2.3).

How about release a patch version of Jemoji that stays with Active Support 4.x and a new major version that supports Active Support 5+? 😅

I looked at the emoji filter and all activesupport is used for is HashWithIndifferentAccess. 😦 Perhaps we could remove that dependency on the emoji filter?

If we want to remove Active Support, we need to remove all usage of Active Support across the html-pipeline gem. Otherwise html-pipeline still depend on Active Support. The barrier is the use of coverting document to hash. 😓

parkr commented 8 years ago

How about release a patch version of Jemoji that stays with Active Support 4.x

We did this, actually. GitHub Pages uses Ruby 2.1.7 in production so we locked the downgrade and all was well.

It's not the end of the world, but there were a couple days where anyone using Ruby < 2.2.2 couldn't install this gem in our projects.

Taher-Ghaleb commented 3 years ago

Hello,

Sorry, I know it's been a long time ago, but I am curious why caching hasn't been enabled before this (i.e., since December 17, 2014, when it became available to open source projects).

Thank you.