Closed brendon closed 7 years ago
@simi, finally the test suite seems to be in order! Let me know if you need any more information about this. I think there's a large group of people hanging out for this fix :D
this works for us (thank you, @brendon!) -- almost -- on Rails 5.0 because it eliminates Sprockets.register_engine '.less', LessTemplate
in railties in this commit: https://github.com/brendon/less-rails/commit/f573927f2de15b611f797fb650cb95856ec71d95#diff-998c29126ad83cee99c229f1d43307b5L16
the one additional issue that we hit is the line above:
Sprockets::Engines #force autoloading
errs with
block in <class:Railtie>': uninitialized constant Sprockets::Engines (NameError)
Thanks for the feedback @tdonia :) I've pushed a change that should hopefully fix that. Let me know how it works on your end. I'll see how travis likes it also.
Any update on this? Thank you.
Hi @simi, I've updated the test matrix and all the tests pass. I'm only testing for the latest version of jruby. Is that ok?
I've commented out the warnings line. It's handy to have there locally to uncomment because of the excessive therubyracer
warnings. We should migrate away from that perhaps in another PR since I think the Rails team did the same.
I'll wait to hear from you on the bundle
vs bundle install
thing.
Hi @simi, any more comments before we finalise this? :)
@simi Can we get this merged in? We just upgraded sprockets / rails and are running into these warnings. Happy to help make any changes, but it looks like the changes have been made and we're just waiting on a merge + release.
I've used the workaround:
gem 'less-rails', github: 'brendon/less-rails', branch: 'fix-sprockets-loading'
On rails 5. But less files are no longer compiled (I get a 'not found' myscript.less.css)
The same configuration works with the default gem.
Any idea on how to fix the problem?
Hi @ubugnu, thanks for reporting the error. If .less.css
is a usual extension then the problem is that it wasn't added as a valid extension for Sprockets 3 that requires all extensions to be explicitly defined.
I've added the .less.css
extension in there for now. Give it a try. Can others chime in on whether .less.css
is a usual extension for less files in Rails?
100,000 🎉 :D
Can you ping when the gem is released? :)
First of all I'm really sorry for being the break at this deprecation removal problem.
I would like to thanks all involved in this, mainly @brendon for crafting this PR and @drn for friendly email ping.
This is included in fresh 3.0 release.
I’m using Grease https://github.com/yasaichi/grease as a wrapper around
LessTemplate
andImportProcessor
and have also rejigged the loading process to make things compatible with Sprockets 2, 3 and 4.Extra changes:
README
with regards to getting the test suite runningcapture
inrun_generator
. There is no recommended replacement.Closes: #122 Finally! :)
Thanks to https://github.com/metaskills/less-rails/pull/128 for inspiration @MustafaZain.