Closed hmdne closed 3 years ago
Regarding the break:
opal-sprockets was resolved to 0.5.0.1.0.4.0, which depends on
sprockets (~> 4.0) was resolved to 4.0.2, which depends on
ruby (>= 2.5.0)
I think this patch is partially compatible with sprockets 3.7 if that's desired.
This is amazing! I'll review it as soon as I can 💪 ✨ 🎉
Regarding opal-rails, Rails changed their Sprockets handling method if Sprockets 4.0 is loaded, it now needs a file app/assets/config/manifest.js. I will try to migrate it, but I have very little experience with Rails. Do note, that nothing changes for other deployments, only Rails is affected.
I found a problem that dependencies may not work the way they should. While updating my code, the asset (which is now just one asset, it doesn't expand anymore) compiles only the main file without its dependencies and a server restart is required. I will create a test for that instance and try to debug it more.
Testing this on my application. It works flawlessly if opal-parser isn't included. And without collapsing everything loads very fast - it only recompiles single files from the source code. But if opal-parser is included it breaks and it breaks quite hard - sometimes it even embeds source maps as if they were JS files. Maybe I will try later with increasing the Sprockets cache to more than 1k keys and hopefully this would help.
That's great! I need to try it out as well, feel free to update the travis config to avoid unsupported rubies like 2.3 and 2.4 so that the PR becomes green
the caching support is exciting! any update when this will get in?
@tobymao I will finalize the patch in a few days. In the meantime you can do
gem 'opal-sprockets', github: 'hmdne/opal-sprockets'
etc. for opal-rails, opal-haml.
I merged this with a few adjustments in #23, thanks for the great work!
Noting things of importance:
Things that will need upgrade once this is deployed (or before - backward compatibility is assured): opal-haml, opal-erubi (I already have those and I will reference this PR).
Things that will NOT need upgrade: opal-rspec, opal
Things I'm not sure about, but will probably need some minor work: opal-rails