Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from Webpacker #3185

Closed
benjaminfaure opened this issue Jun 9, 2022 · 1 comment
Closed

Migrate from Webpacker #3185

benjaminfaure opened this issue Jun 9, 2022 · 1 comment
Labels
effort-large 1-3 days of dev time rails6

Comments

@benjaminfaure
Copy link
Contributor

Hello everyone,

With the release of Rails 7, the webpacker gem has been abandonned and is no longer maintained by the developpers.
There's three solutions and all of them are compatible with Rails 6.1 so it could be setted up before migrating to Rails 7, thus the migration would be "less" painful.

For existing applications, Rails recommend the use of jsbundling-rails. There's a nice switching guide for users who wants to migrate from webpacker.
With JSBuilding we could use other bundlers such as esbuild that are a lot faster than webpack (see demo here), but it would require additional work.
Webpacker had a lot of builders bundled so the package.json file would grow a lot as it would need to include each required library used by webpacker.

Rails 7 uses importmap by default, but it's a big change as it no longer uses the whole Node/NPM ecosystem. It seems like a lot of work and Rails recommend it for new applications.

The last solution is to use the shakapacker gem which is a fork of the webpacker. The work would be "minimal" as it's basicaly webpacker, but it's not official so you never know for how long it would be maintained.

@benjaminfaure benjaminfaure added the effort-large 1-3 days of dev time label Jun 9, 2022
@briri briri added the rails6 label Jun 9, 2022
@benjaminfaure
Copy link
Contributor Author

With this migration will most likely come an upgrade of Sass, meaning that @import in sass files no longer works.
A review of all the CSS might be needed as sass variables are prefixed with a namespace.

More info here : https://www.youtube.com/watch?v=CR-a8upNjJ0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort-large 1-3 days of dev time rails6
Projects
None yet
Development

No branches or pull requests

2 participants