-
Notifications
You must be signed in to change notification settings - Fork 208
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
(feat) Load scripts for non-visible modules asynchronously after starting application #710
Conversation
const module = factory(); | ||
|
||
if (!(typeof module === "object") || module === null) { | ||
const error = `Container for ${jsPackage} did not return an ESM module as expected`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const error = `Container for ${jsPackage} did not return an ESM module as expected`; | |
const error = `Container for ${jsPackage} did not return an ES module as expected`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ES = "ECMAScript" (the semi-official name of Javascript)
ESM = "ECMAScript Module"
Hence
"ES module" == "ESM"
Size Change: +1.74 kB (0%) Total Size: 2.26 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ibacher.
Co-authored-by: Dennis Kigen <kigen.work@gmail.com>
Requirements
For changes to apps
If applicable
Summary
This is something I was deferring to "phase 2" because it was a little hard to test without the full routes setup. The idea here is that we pre-load the script (and the initial chunk containing the contents of
index.ts
), but not call any code at this point.Hopefully, this should make things feel more responsive.
NB It is quite trivial for this design to be less than optimal; however, further optimising this likely involves prioritising the preloading (i.e., ensure that scripts are preloaded in the order they are likely needed, but that requires some way of declaring that prioritisation).
Screenshots
Related Issue
Other