Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Replace sprockets/browserify with Webpack #2617
What this toolchain upgrade provides:
Untested potential benefits:
@ykzts Unfortunately, jQuery is still a dependency because of jquery-ujs which makes some non-GET links work. There is rails-ujs which is jQuery-free but it didn't work with webpack. jQuery is also used in public.js. On the upside, webpack splits the code into vendor.js and application.js/public.js bundles, so dependencies are not loaded twice.
I'm not sure if you are happy for people to provide feedback here.
This branch is live on glitch.social (thanks Bea).
referenced this pull request
Apr 30, 2017
May 3, 2017
On second analysis, it looks like this didn't shrink the bundle size much.
Mostly I don't see any easy wins here; just need to assiduously go through dependencies and try to remove what's not needed, replace where possible, etc. Code-splitting would also be good. Keep in mind that Sean Larkin from the Webpack team recommends <300KB (without gzip) for each chunk, whereas Addy Osmani on the Chrome team recommends <100KB to hit <3 seconds on 3G.