handlebars_assets icon indicating copy to clipboard operation
handlebars_assets copied to clipboard

Fix sprockets version check

Open Borzik opened this issue 8 years ago • 2 comments

Based on this, we want HandlebarsTemplate to be used for rendering if Sprockets version is 3 or lower.

But in this file, we check if Sprockets version is less than 3, so all Sprockets versions higher than 3.0 will be affected, which causes a bug when asset helpers are not available.

Reduced test case is updated, you can test it now if you want (check Gemfile for versions).

Borzik avatar May 05 '16 21:05 Borzik

Ran into this issue as well, and this solution worked for me. Would love to see this merged.

timherby avatar Aug 25 '16 07:08 timherby

Unfortunately, after making that change, I'm seeing this deprecation warning:

DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
 (called from block in register_extensions at /Users/tim/.rvm/gems/ruby-2.1.2/bundler/gems/handlebars_assets-4e653d0bde94/lib/handlebars_assets.rb:22)

So it looks like it might not be that easy. We may need to do the original fix? https://github.com/leshill/handlebars_assets/pull/152

timherby avatar Aug 25 '16 07:08 timherby