Skip to content
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

perf: preload MFE Config API response in index.html #632

Closed

Conversation

kdmccormick
Copy link
Member

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:

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
@codecov
Copy link

codecov bot commented Aug 23, 2022

Codecov Report

Merging #632 (3c9d341) into master (ab215cd) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #632   +/-   ##
=======================================
  Coverage   39.24%   39.24%           
=======================================
  Files         109      109           
  Lines        2227     2227           
  Branches      597      597           
=======================================
  Hits          874      874           
  Misses       1268     1268           
  Partials       85       85           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@kdmccormick
Copy link
Member Author

Closing because it's not clear that this optimization is necessary. See openedx/frontend-platform#360

@kdmccormick kdmccormick deleted the kdmccormick/preload-config branch August 30, 2022 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant