elm_sprockets icon indicating copy to clipboard operation
elm_sprockets copied to clipboard

Add support for Rails 5.0

Open Masa331 opened this issue 8 years ago • 8 comments

Hi there,

this PR adds support for Rails 5.0. Please let me know what you think.

For dependencies checking i used standard Sprockets directives so we don't need to parse .elm files manually.

Have a nice day, Masa331

Masa331 avatar Aug 27 '16 17:08 Masa331

@JEG2 can you handle this PR?

eeue56 avatar Aug 31 '16 22:08 eeue56

Yes. I'm out of town, but will look at this Monday.

JEG2 avatar Sep 02 '16 19:09 JEG2

So my main thought with this as that it forces us to double manage dependency lists (the import statements and the depend_on directives). I worry those listings would eventually drift apart and cause subtle bugs.

We're working on replacing this plugin to support later versions of Rails. That effort is a new plugin. We hope to finish this up, switch our application to use it, and release it in the near future. Any chance you could try this new code and tell us if it meets your needs?

As for dependency tracking, the Elm compiler now supports that directly. I plan to shift the new code to lean on that.

JEG2 avatar Sep 05 '16 23:09 JEG2

Ok, this new plugin sounds cool! i will try it during the weekend :)

And for the dependencies - you are right it might be problematic on biggr projects but i thought it would be enough for the start. And i wanted to avoid parsing the elm code in order to find deps

Masa331 avatar Sep 06 '16 06:09 Masa331

Ok, this new plugin sounds cool! i will try it during the weekend :)

Awesome. Please report back on how it goes for you.

JEG2 avatar Sep 06 '16 12:09 JEG2

Hi, sorry for late reply. I'v looked inside the new plugin and it didn't work for me on fresh Rails 5 install. I didn't have the time for deeper investigation however i also found that you use Tilt there which is deprecated in Sprockets 3.

I would like to help but lacking the time and not knowing your future intentions i'v given up and created this litte gem which works for me now.

Also you were right that stating dependencies twice is not really a way(tried already) but i think it's bearable for small projects or prototypes which is all i want for now.

So i guess we can close this PR now?

Masa331 avatar Jan 10 '17 20:01 Masa331

Gotcha. Yeah, it looks like more work is needed here. I just haven't got to it yet, unfortunately.

Your PR may be a viable option though.

JEG2 avatar Jan 11 '17 02:01 JEG2

Well, i guess it's up to you :)

I also modified my gem where it's not longer needed to use Sprockets directives for stating dependencies. It now simply watches changes in all Elm files in assets. https://github.com/Masa331/elm_in_rails/blob/master/lib/elm_in_rails/transformer.rb

The solution wouldn't fit big projects i guess but smaller ones should be ok with it i hope

Masa331 avatar Jan 21 '17 17:01 Masa331