-
Notifications
You must be signed in to change notification settings - Fork 1
[DRAFT] Various improvements to the MFE build process #184
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
Comments
Can you expand on this? I believe I've gotten it to work for local build purposes at least by linking it in with Local module configuration for Webpack, though this approach doesn't support other tooling like TypeScript checks. |
So my goal was to test the changes of devDependencies in frontend-build. But whenever I installed my local version of frontend-build, I could not run In the end I think I managed to get it wot work with lots of AFAIU local module configuration works for runtime loading, but not for installation of 3rd-party dependencies. |
@regisb If you see that, a workaround is to edit the |
I have a PR here: openedx/frontend-app-learning#1621 |
On the topic of webpack vs rsbuild, I suggest we continue the conversation here @brian-smith-tcril @bradenmacdonald: overhangio/tutor-mfe#252 (spoiler: results are awesome) |
Based on the changes in that PR my best guess is someone accidentally ran
and ended up with |
Uh oh!
There was an error while loading. Please reload this page.
I'm listing here several changes I've experimented to improve the build process of MFEs. This is work-in-progress as I'm trying out different things. But the PRs listed below should be good for a review.
node_modules/
from babel-loader: feat: faster babel-loader by excluding node_module frontend-build#644Notes
Semantic releases
It was decided in Paragon to use semantic releases: openedx/paragon#72
As a consequence, working on local versions of frontend-build, frontend-platform, etc. is extremely difficult. I was unable to test changes to devDependencies with
npm link
or evenyalc
.Why did renovate[bot] stop upgrading fortawesome dependencies in frontend-component-header?
frontend-component-header depends on versions of @FortAwesome packages that are different from other MFEs. As a consequence, header has its own set of packages in node_modules/@openedx/frontend-component-header/node_modules/@FortAwesome. This adds extra data on disk, and probably in the compressed build as well.
Outdated 'file-loader'
frontend-build makes extensive use of file-loader, which was since replaced by assets-modules:
https://github.com/openedx/frontend-build/blob/master/config/webpack.prod.config.js
https://v4.webpack.js.org/loaders/file-loader/
https://webpack.js.org/guides/asset-modules/
Funky import resolution
Each and every frontend app is adding its own custom module resolution rules...
frontend-app-learning:
@src
importsfrontend-app-learning's webpack.prod.config.js has this weird section:
This change was introduced here: openedx/frontend-app-learning#1330
EDIT: Actually, I think this is the cleanest way to proceed, and we should implement the same resolve rule in all MFEs. Curious to learn what others think.
authoring:
CourseAuthoring/*
importsThis change was introduced here: https://github.com/openedx/frontend-app-authoring/pull/638/files#diff-a60dea17f5d642506d3c4eb9e4f3d0890f7b1601be813adf18583a248f4ce78a
ora-grading, learner-dashboard: import straight from the src directory
https://github.com/openedx/frontend-app-ora-grading/blob/master/webpack.prod.config.js
https://github.com/openedx/frontend-app-learner-dashboard/blob/master/webpack.prod.config.js
Changes were made in the first commit:
openedx/frontend-app-ora-grading#2
openedx/frontend-app-learner-dashboard@787e780
MFE re-installing npm???
"npm" is part of the authoring dependencies: https://github.com/openedx/frontend-app-authoring/blob/d1a6af51a4945360ce0cf3f7a5720f9f61ebef25/package.json#L81
openedx/frontend-app-authoring#1133
Outdated frontend-build patches
We should really really revert this PR: openedx/frontend-app-learning#1350
EDIT: Braden already noticed this before me and proposed a fix: openedx/frontend-app-learning#1621 🥇
Replacing webpack by rsbuild
I've managed to produce an rsbuild-based configuration file that works across all MFEs, with only minor changes to MFE apps. Details are here: overhangio/tutor-mfe#252
(tl;dr: results are very promising)
The text was updated successfully, but these errors were encountered: