| Rails 6 by default includes webpack to bundle assets for production. Aside from webpack, several of the top 10 on your list are libraries that ensure a great user & developer experience across browsers: - babel transpiles ES6/7+ JavaScript syntax to the least-common-denominator of the browsers you designate as supported by your application - core-js provides implementations of features that are not supported in older browsers -- things like array methods that cannot simply be transpiled - caniuse-lite is a database of supported browser features to determine what needs to be transpiled and when This toolchain allows developers to write code with the latest language features (which usually results in simpler, more elegant code) while seamlessly supporting legacy browsers as needed. If you decide to drop support for an older browser, you can simply remove it from your browserslist instead of going through all your code to figure out which hacks you put in just for that browser. It takes a ton of cycles out of development googling "can I use feature X in browser Y". Prior to Rails 6, asset precompilation was powered by Sprockets by default. Sprockets still bundled many analogous libraries, just hidden in ruby gems instead of node_modules. For example, if you want to use SASS then you need a library that compiles SASS to CSS -- whether it's node-sass on your list or the sassc gem. As noted in other comments, very little of this code is actually loaded in the frontend by end users. |
Thus, 100MB of JS is astoundingly huge. It's roughly the same size as all the binaries in a full install of Windows 95, with all its features and drivers.
In the spirit of https://prog21.dadgum.com/116.html perhaps we need a list of "Things an empty Rails app is smaller than".
It takes a ton of cycles out of development googling "can I use feature X in browser Y".
...or you could just avoid the trendchasing and use a minimal subset that you are sure will work everywhere, but that's a different discussion.