-
Notifications
You must be signed in to change notification settings - Fork 1k
[labs/ssr] fix ModuleLoader failing with multiple concurrent entrypoints #4314
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
Conversation
🦋 Changeset detectedLatest commit: 8b14849 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Tachometer Benchmark ResultsSummarynop-update
render
update
update-reflect
Resultsthis-change
render
update
update-reflect
this-change, tip-of-tree, previous-release
render
update
nop-update
this-change, tip-of-tree, previous-release
render
update
this-change, tip-of-tree, previous-release
render
update
update-reflect
|
|
The size of lit-html.js and lit-core.min.js are as expected. |
justinfagnani
left a comment
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.
Awesome work!
augustjk
left a comment
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.
Nice!
Fixes: #2549
Context
When the eleventy ssr plugin loads modules concurrently, it would previously fail with an error. Something like:
Investigating this issue I found:
Solution is to closer match the spec.
LoadRequestedModulesshould prepare module for linking by loading all dependencies.Then when
Linkis called,LoadRequestedModulesmust have completed.Theory
Before linking our code does:
However previously our
_loadModulemethod did not load all dependencies, relying onmodule.linkto load the dependencies. This seems to work when not loading multiple modules concurrently.But, to allow multiple modules to load concurrently I've added some additional module loading logic to
_loadModuleso dependencies get loaded.The result is that by the time
module.linkis reached, all modules should have been loaded.Test plan
I added a unit test which throws
Error: request for 'XXXX' is not yet fulfilledwithout the fix.Risk
There is a risk that this adds a regression to the eleventy SSR plugin if something isn't quite right.