-
Notifications
You must be signed in to change notification settings - Fork 15
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
Create small MFE base image using runtime MFE config system #235
Comments
@ghassanmas , @arbrandes and I recently talked about this. We needed to figure out a way to allow the MFEs to communicate with the dynamic configuration API without hard-coding the
|
This is blocked by completion of: openedx/wg-frontend#103 regardless, I'm starting work on a prototype over here: kdmccormick/tutor-mfe#1 |
@kdmccormick thats great to hear, let me know if I can help with anything. I was doing some discovery lately regarding module federation which would be also added on top of this. Simply put the vision is just as we have config variables for settings, we can have config variables of location of bundle. e.g. if I don't want to use the default (footer, header, paragon). I could add a config to overide it. That config is a url which points to a sepearte bundle of a which can be hosted on mfe-host or any CDNs... I don't know the possbilty of this yet just though its a path worth discovering. |
@ghassanmas Interesting, would that be an alternative to the current system for overriding components, where you must npm-install a package (like https://github.com/edx/frontend-component-footer-edx) so that it replaces the exports of an existing package (like https://github.com/openedx/frontend-component-footer)? Let me know when you have a prototype, I am interested to see. |
Something I noticed while working on this: The Dockerfile uses staged builds to progressively build a base image and and intermediate prod image for every single installed MFE. I think the intention is that rebuilding, say, |
I created overhangio/tutor-mfe#58 to address ^ |
Yes your are exactly right. I haven't created a prototype that exactly uses those pacakges per say, but I tried to do a POOF of concpent with basic webpack/react and it worked, what I did exactly is that the app at runtime was able to require a module (a module can be a library, compnenet, pacakge...etc) from a somewhere else. What I used is WebpackModuleFederatoinPlugin, where I had to configure both the module (that was imported at run time) and the app that used it. |
I haven't used tutor-mfe in development mode, or I didn't rely on it. I think there is area of improvment in the Dockerfile, Now I am not sure about what exactly you did, I know docker stage build is meant to optimize the cahching or buildtime...etc for example I always enable docker buildkit so that those stages would built in parrales (but it's gonna consume network/RAM at a high scale) On the other hand there is somehting that can enhance buildtime (consecutive built) which I though about before I will link what I mean in the PR you opend. |
Recently, a capability was added to this MFE that allows it to load configuration from an the LMS's MFE Config API instead of requiring it to be baked-in to the webpack build. When enabled, though, this capability blocks any render of the MFE until the Config API responds. So, in order to minimize the amount of time that the MFE is waiting on the Config API response, we preload the API response via a in the section of index.html, which recommends to the browser to immediately begin loading the MFE Config API response as soon as index.html is loaded. Otherwise, the Config API wouldn't be called until React and frontend-platform are loaded. Recently, a capability was added to MFE that allows it to load configuration from an LMS API (the "MFE Config API") instead of requiring it to be baked-in to the webpack build. Related to: * https://github.com/overhangio/2u-tutor-adoption/issues/87 * openedx/wg-frontend#103
Update: This is in review on overhangio/tutor-mfe#69 |
Moving this to the build-test-release-wg repo, since this is a big concern for the Olive release. |
[Update]: From my end one of the current blocker is this openedx/frontend-app-gradebook/pull/290 |
Gradebook is no longer a blocker, and it looks like images are going to start being built by CI! I think we can close this. |
Context
The MFE runtime config API has been added to frontend-platform and edx-platform! Issue: openedx/wg-frontend#103
We would like to make use of that API in the tutor-mfe plugin so that we can statically build a minimal tutor-mfe image, which can be used by anyone along with runtime configuration.
Acceptance
APP_ID
mfe
image.--build
flag fromtutor dev start
, as it's no longer needed.The text was updated successfully, but these errors were encountered: