jquery-tmpl-rails icon indicating copy to clipboard operation
jquery-tmpl-rails copied to clipboard

fix sprockets configuration

Open masarakki opened this issue 9 years ago • 7 comments

masarakki avatar Jan 20 '16 06:01 masarakki

Thanks @masarakki - this PR fixes the problem with Sprockets for me.

:+1: for getting the PR merged into the gem

billhorsman avatar Feb 05 '16 13:02 billhorsman

Could someone provide an explanation of the issue and how this fixes it? I haven't use jQuery templates in forever, and I'm pretty rusty on Rails these days, for that matter.

jimmycuadra avatar Feb 05 '16 18:02 jimmycuadra

@jimmycuadra I'm not the author, but I ran into this today while upgrading a legacy Rails app. Sprockets has made significant changes to how registration of new mime type handlers are registered.

This is the best example I found today: https://github.com/yasaichi/grease

This PR looks like it should work, but it doesn't for me. I tried some tweaking, using the Sprockets 4 syntax. But no luck, quite possibly because the templates I'm working with were written in haml

cdale77 avatar Nov 24 '16 00:11 cdale77

A further note -- the preferred way to set this up is no longer using an initializer, but putting something in config/application.rb. I think that's what this PR is attempting to fix.

cdale77 avatar Nov 24 '16 00:11 cdale77

@jimmycuadra I came here trying to upgrade my gems to handle sprockets deprecations such as this:

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 <class:Railtie> at /path/to/vendor/bundle/ruby/2.4.0/gems/jquery-tmpl-rails-1.1.0/lib/jquery-tmpl-rails/engine.rb:10)

Schwad avatar Apr 23 '18 14:04 Schwad

That all being said, it looks like these changes now are calling for more than the current PR.

Schwad avatar Apr 23 '18 14:04 Schwad

Am having a crack at committing the deprecated changes, if they pass our tests I'll file a PR :)

Schwad avatar Apr 23 '18 14:04 Schwad