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

Webpacker has been retired #83

Closed
joeroe opened this issue Mar 14, 2022 · 6 comments
Closed

Webpacker has been retired #83

joeroe opened this issue Mar 14, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@joeroe
Copy link
Contributor

joeroe commented Mar 14, 2022

See https://github.com/rails/webpacker

@joeroe
Copy link
Contributor Author

joeroe commented Apr 12, 2022

So I spent today trying out the new importmap system (https://github.com/rails/importmap-rails/). It is very nice and I think could greatly simplify our JS pipeline. It also goes hand-in-hand with Turbo (https://turbo.hotwired.dev/) and Stimulus (https://stimulus.hotwired.dev/), which if we adopted would allow us to drop some old/heavy dependencies (e.g. jquery!) and tidy up our Javascript modules significantly.

That said, in the end I gave up trying to get all three to work with Rails 6. I don't really know what the problem is but suspect it's something to do with having importmaps running alongside webpacker at the same time. Long story short: I would suggest upgrading to Rails 7 first, then switching webpacker -> importmap, jquery -> stimulus, our JS modules -> stimulus controllers, and CSS dependencies -> (gems? cssbundling?) all at once.

@MartinHinz
Copy link
Collaborator

That makes perfect sense to me. I had also experimented a bit, and from experience I can only confirm the assessment. Which of us should take responsibility for this? Have you immersed yourself in it to the extent that it can be done quickly for you, or can I take on this task (but not until the end of next week at the earliest)?

@joeroe
Copy link
Contributor Author

joeroe commented Apr 19, 2022

Not quickly... but it would be nice to do it in my data entry branch, since I'm writing a fair bit of JS and it would help to have it cleanly organised as Stimulus controllers. But the main thing I'm not confident about is the upgrade to Rails 7: maybe you could do that, then I'll merge it into my branch and do the migration to importmaps etc.?

joeroe added a commit that referenced this issue Apr 20, 2022
@joeroe joeroe added the enhancement New feature or request label May 25, 2022
@joeroe
Copy link
Contributor Author

joeroe commented Sep 7, 2023

A new alternative is shakapacker (which wraps newer versions of webpack for rails): https://github.com/shakacode/shakapacker

The migration process looks... unpleasant.

@joeroe
Copy link
Contributor Author

joeroe commented Sep 7, 2023

Useful discussion of webpacker alternatives: decidim/decidim#8783

@joeroe joeroe added this to the Migrate to Rails 7 milestone Sep 11, 2023
@joeroe
Copy link
Contributor Author

joeroe commented Sep 18, 2023

#305 replaced webpacker (and sprockets) with propshaft + jsbundling + esbuild + cssbundling.

@joeroe joeroe closed this as completed Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants