Description
The duration of front end asset bundling and minification has been flagged several times as a source of friction in development and deployment:
- Tutor rebuilds all MFEs relatively often, and this duration is increasing as the number of MFEs grows
- JS minification is a fairly high percentage of setup and deployment time for edx-platform
- MFEs often do less aggressive minification in CI than used in production to keep the test duration short, which means we're testing slightly different code than deployed to production.
- The webpack bundler ecosystem requires a lot of plugins and dependencies, some of which have been abandoned and/or had long-lasting security vulnerabilities.
We currently use webpack for bundling and uglify-js for minification, but there are now much faster alternatives to both tools:
- SWC is a very fast JavaScript/TypeScript compiler/bundler/minifier implemented in Rust which many other tools in the front end ecosystem are starting to utilize.
- Parcel is a fast bundler which adopted SWC and claims to require much less configuration than webpack for most common use cases.
- Next.js is a pretty comprehensive toolkit for using and deploying React which also recently adopted SWC.
- esbuild Is a very fast Go-based bundler & minifier
- I haven't yet found good benchmarks on the recent versions of each of these bundlers, but I did find some good benchmarks of the underlying minifiers.
There have been initial conversations around utilizing SWC in webpack also, but there doesn't seem to be much actual code to that end yet: webpack/webpack#13425 .
As a first step towards optimizing our development feedback loops and deployment time, please do some discovery on which if any of these alternatives could satisfactorily meet our needs and allow us to completely remove our dependency on webpack and/or uglify-js in most MFEs (and ideally edx-platform as well). In particular, we want to know:
- Does the replacement lack any important features our current webpack/uglify-js ecosystem provides?
- Does the replacement gain us any useful features our current ecosystem lacks?
- How much faster is the replacement?
- How much configuration does the replacement need?
- How many dependencies does the replacement have relative to our current stack, and how actively maintained are they?
- How much work is it to replace what we currently use?
We don't need extremely accurate and detailed answers to these questions, but we need enough of an idea to make a call on whether or not to go ahead with a pilot implementation, and if so which tool(s) to use.
Metadata
Metadata
Assignees
Type
Projects
Status