Webpack is slow and nobody likes it. It gives us a lot of flexibility, though (for example in comparison to rollup, which is pretty great). Let's replace it with what's just reached v1 and is advertised as more or less a drop-in-replacement. Full Disclosure: rspack is a ByteDance project (MIT licensed, though).
Created attachment 170992 [details] [review] Bug 37824: Replace webpack with rspack for fun and profit I left the webpack.config.js as well as the devDependencies in place for now. We can remove them in a follow-up patch on this bug after testing it out. To test: 1) Run js:build and js:build:prod 2) Note the build time 3) Apply patch 4) Run yarn install 5) Run js:build and js:build:prod again 6) Note the much faster build time 7) Extra credit: take a look at the ERM or preservations module and make sure everything works as expected. 8) Extra credit: run the cypress tests. 9) Sign off or give your opinion
Created attachment 171126 [details] [review] Bug 37824: Replace webpack with rspack for fun and profit I left the webpack.config.js as well as the devDependencies in place for now. We can remove them in a follow-up patch on this bug after testing it out. To test: 1) Run js:build and js:build:prod 2) Note the build time 3) Apply patch 4) Run yarn install 5) Run js:build and js:build:prod again 6) Note the much faster build time 7) Extra credit: take a look at the ERM or preservations module and make sure everything works as expected. 8) Extra credit: run the cypress tests. 9) Sign off or give your opinion Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Looks faster to me. Where webpack failed for me (Killed, error 137), this passed.
Concerning the production readiness of rspack, I'd just like to say that ByteDance themselves already use it in production. And I guess what works for a billion $ company should be stable enough for us?
I don't have the time to test it right now but if it's faster and considered stable we should switch!
There's a solid argument joubu made against mine: ByteDance as well as the big testemonials: - Microsoft - Amazon - Intuit - Discord have time and resources to adapt their codebases to changes in the build tool and we don't. However: they aim to reach as close to 100% compatibility as possible with webpack, which to me means that: - they can't do crazy stuff - we can always fallback onto webpack, it's not going anywhere. Therefore I think we can be a bit bleeding edge here ;)
I'll be taking this for a spin today. Now that I've researched the current state of these sorts of tools I'm happy for us to take the leap too. There's a clear back step should we need to take it, but the project itself does feel well regarded and supported so I don't predict we'll need to take such measures. Assuming I get the same results as prior testers, and I can't see why I wouldn't, 8 think this is well worthwhile and likely to pass today.
Thanks for testing this Martin :)
Created attachment 171438 [details] [review] Bug 37824: Replace webpack with rspack for fun and profit I left the webpack.config.js as well as the devDependencies in place for now. We can remove them in a follow-up patch on this bug after testing it out. To test: 1) Run js:build and js:build:prod 2) Note the build time 3) Apply patch 4) Run yarn install 5) Run js:build and js:build:prod again 6) Note the much faster build time 7) Extra credit: take a look at the ERM or preservations module and make sure everything works as expected. 8) Extra credit: run the cypress tests. 9) Sign off or give your opinion Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Looks faster to me. Where webpack failed for me (Killed, error 137), this passed. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
I'm happy this is a solid improvement and worthwhile. All worked in testing very seamlessly. Passing QA Nice work Paul