Closed tjgrathwell closed 8 years ago
@tjgrathwell see any reason not to go ahead and merge this ? How much manual testing have you done ?
I've tested it on https://github.com/railsbridge/bridge_troll in both the existing Rails 4.2 / Sprockets 3 master branch and this Rails Edge / Sprockets 4 branch. Seems to work?
This should work for Sprockets 3 as well, see for reference some prior art at https://github.com/reactjs/react-rails/commit/c8ecba2fd799b72ad77dd926bb814eff498b9431 for react-rails. Let me know if you want me to change the PR from Gem::Version.new(Sprockets::VERSION) < Gem::Version.new('4')
to Gem::Version.new(Sprockets::VERSION) < Gem::Version.new('3')
@tjgrathwell merging this, then going to do some testing ; potentially refactor some small stuff before releasing
I was trying to update an app to test out the latest Rails master, and found this gem was incompatible because it doesn't support Sprockets 4.
Apparently, the plugin architecture has changed such that Sprockets now requires you to install extensions like this:
Instead of the old way,
Additionally, the thing that gets registered now responds only to
call
, instead of using the Tilt interface. (See https://github.com/rails/sprockets/blob/da25579535aabf6935facd8c626f6588a90ad9f8/README.md#processor-interface in the Sprockets readme for a little more detail)This commit attempts to use the new syntax on Sprockets 4 and up, while preserving the old syntax if the gem is used on a Sprockets 3 project.