-
Notifications
You must be signed in to change notification settings - Fork 10
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 / Upgrade frontend bundling #454
Comments
We should consider #421 alongside this. |
Also consider the role of the |
We should also consider the bug #468. Maybe, we can manage |
Let me just say in defense of the global bundling by sprockets that we use a lot of nested partials (I would guess that a "nesting level" of 5 or 6 is not uncommon), and a lot of partials are used in different contexts. I would imagine that with local styling, it could be quite challenging to keep track of what the css rules are in a given view. |
@fosterfarrell9 Ok true, that might really be challenging, especially for all the already existing files. So, it'd be probably easier to continue using explicit CSS, e.g. |
|
Getting rid of For some alternative bundling tools, see for example this article. While I haven't used it yet, I've heard about Vite many times on the Internet. And with almost 68K GitHub stars, it's not unknown ;) It even has its own Vite Ruby off-spring, see also the Introduction and the available Rails Integration. It might be worth to check out. We just have to see if our custom webpack config can be ported to it. Also I'm not too sure how it handles the server-side rendering of the JS files with the erb syntax... In the end, it's still Rails itself that renders it, right? So it just bundles our static assets? This is to investigate... |
In the new setup, we could also use minification and obfuscation to greatly shrink the frontend bundle sizes. Additionally, we could get rid of properties like |
With Rails 8.0 (see #710), we could think about Propshaft + Vite together. See also the Sprockets -> Propshaft update guide. |
From the Webpacker Readme:
So, while we can except some more security updates in the short term, we should definitely adopt one of Rails 7 "new answers to JavaScript" in the long run, to still get security updates (in the distant future) and also new JS features.
A quote on the old Asset Pipeline (Sprockets) vs. new approaches
Further resources
The text was updated successfully, but these errors were encountered: