Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Workflow status is failure ❌ |
|
Workflow status is failure ❌ |
| @@ -1 +1,12 @@ | |||
| import('./bootstrap.js'); | |||
| const promises = [] | |||
| __webpack_require__.f.remotes('main',promises); | |||
There was a problem hiding this comment.
hardcoded to main as proof of concept, in reality this would be part of codegen, injected into all entrypoint modules, each passing their own chunkID to the handlers.
effectively making startup asynchronous.
You can also export require(bootstrap) back out, however - the entrypoint will always export a promise. If webpack is handling this entrpoint loading, then async modules will resolve their inner promises. If not, your entrypoint will always export Promise.resolve(module.exports).
In most cases this should not be a problem, as the act of loading an entrypoint is async in ietslf so much should not experience an issue.
The other option involves replacing entrypoint startup code with a promise based export
There was a problem hiding this comment.
not required if we use the AsyncBoundaryPlugin from modernjs example
|
Workflow status is cancelled ❗ |
…sync-boundary # Conflicts: # basic-host-remote/app1/modern.config.js # basic-host-remote/app2/modern.config.js
|
Workflow status is failure ❌ |
|
Workflow status is failure ❌ |
|
Workflow status is failure ❌ |
| )}, promiseTrack);`, | ||
| `var __webpack_exports__ = Promise.all(promiseTrack).then(function() {`, | ||
| source.source(), | ||
| 'return __webpack_exports__;', |
There was a problem hiding this comment.
entrypoints will always return a promise to webpack, if entrypoint is externally required (like commonjs)
then it will module.exports = new Promise(moduleExports)
No description provided.