elm_sprockets
elm_sprockets copied to clipboard
Add support for Rails 5.0
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
@JEG2 can you handle this PR?
Yes. I'm out of town, but will look at this Monday.
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.
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
Ok, this new plugin sounds cool! i will try it during the weekend :)
Awesome. Please report back on how it goes for you.
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?
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.
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