-
Notifications
You must be signed in to change notification settings - Fork 1
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
Discovery: Faster build tool #126
Comments
Already found another contender currently being rewritten in Rust, doesn't seem as widely used as the others but may also be worth a look: https://rome.tools/ . What caught my attention is that it might serve as a faster replacement for eslint. |
We recently merged overhangio/tutor-mfe#58, which significantly speeds up the dev MFE build (should be a matter of seconds now, no matter how many MFEs are installed). I am also working on https://github.com/overhangio/2u-tutor-adoption/issues/87, which should provide a generic production-ready base MFE image and thus reduce the need to build for production users. All that being said, I think a faster build tool is still warranted! |
It's outdated by this point, but I have an old asset compilation audit doc from late 2017 that goes over some of the bottlenecks in edx-platform static asset processing. We've fixed a number of items on that list, but I suspect that at least some of these are still issues. |
^ Nice. Tutor works around many of those with a custom re-implemtation of |
There are a lot to unpack here, I have some comments and inquries as well. My background on this
Inquirues:
Webpack Alternative:
Footnotes:Footnotes
|
I have done some testing by replacing Frontend App AccountSWC Loader
Babel Loader
Frontend-app-learningSWC Loader
Babel Loader
frontend-app-enterprise-public-catalogSWC Loader
Babel Loader
frontend-app-learner-portal-enterpriseSWC Loader
Babel Loader
P.S: All of these are tested on MacBook Pro 2018, 2.8 GHz Quad-Core Intel Core i7 with 16 GB 2133 MHz Memory |
Hmm, that branch looks like it's just replacing Babel with SWC for transpiling. I suspect it's still using terser for minification, and that a good chunk of the time is being spent on that. And it's still using webpack for the overall orchestration. The experiments I'm most curious about are:
|
Like I discovered and mentioned in our meeting just now, it looks like SWC is currently working on its own bundler to replace webpack: https://swc.rs/docs/usage/bundling . If the gains from switching over MFEs are relatively modest, maybe we should wait until that's production ready to consider any move away from webpack? In that case, we may just want to focus for now on trying to swap out uglify-js in edx-platform for a faster minifier. |
Also, there are even more candidates to consider now, one of which plans to allow for incremental upgrades from Webpack and is being worked on by the original Webpack author:
How about we create a new issue to use a faster minifier in edx-platform, close this discovery issue, and revisit the topic later in the year to see if there's a smoother migration path and/or a more obvious choice to move forward with? |
I'd be onboard with that, @jmbowman. |
You might have heard about it already, but there's rspack - Webpack-compliant bundler, fast, but still a bit of an early stage (they claim to use it in Bytedance in production) Benchmark is interesting, because using |
@sairion, I hadn't heard of rspack. As a potential drop-in replacement, it looks very interesting. I just wish the project itself wasn't so new. I think we're going to have to wait a bit before we can consider it seriously. |
@abdullahwaheed Could you please follow up on the recommendation above to create a new edx-platform minifier issue and close this one? |
Hey, I have done some research on rspack, following are the insights from R&D.
Conclusion:Migrating from Webpack to Rspack raises concerns due to Rspack's relative newness and lack of maturity. While Rspack promises improved performance and flexibility, However, we cannot continue relying on Rspack fully, at least until sometime in the future. Suggestion:we can implement it in parallel with Webpack and see how it goes. |
Reiterating my comments from January 20th and April 14th - I think we should completely shelve this discovery work for a few months until the alternatives mature a bit further. I'm going to go ahead and close this issue now. I still think it could be useful just to replace uglify-js in edx-platform with a faster minifier, but I'm going to skip creating that issue because I'm worried it'll just be another distraction from making real progress on ripping out the rest of the legacy UI code from edx-platform (so there would no longer be a need to minify anything). |
The duration of front end asset bundling and minification has been flagged several times as a source of friction in development and deployment:
We currently use webpack for bundling and uglify-js for minification, but there are now much faster alternatives to both tools:
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:
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.
The text was updated successfully, but these errors were encountered: