-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Add example for async-node target #575
Conversation
As I can see with |
@7rulnik known issue
You can use it 😄 |
Look like async node will not be able to work for now. As long as we need everything to be resolved before render, and solution before was bound to the ability to resolve all we need during the render - that's not gonna work anymore. That has two problems:
So, question - what is the reason to use |
Not sure, but maybe module federations is the reason for it? As for now, we have the issue module-federation/module-federation-examples#48 so we need restart server to fetch new modules. Not sure that |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Not stale |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I am adding webpack5 related examples and gonna build a few integation tests on top of them. |
Omg yay! |
Once you have this running again. I'll extend the MF api so we can pass chunks along with the remote for cross container lookups. We would need to be able to merge additional context into your chunk extractor, from the remotes build stats. Then I'll have the container expose get, init, and chunkMap. |
Summary
Webpack 5 introduces new target
async-node
. It uses fs and vm to load chunks asynchronously.More details you can find in webpack sources. Take a look on
NodeTemplatePlugin
andStartupChunkDependenciesPlugin
.Seems that we should wait promise from
ctor.requireAsync
, but for now we can't do it because it's inside of constructor. And even more: is it possible at all to wait for it without suspense on server? If it's so we just can go throughnamedChunkGroups
from stats and call__webpack_require__.f.readFileVm
or__webpack_require__.e
, but not sure that it will helpNote that this branch already contains fix from #568
Test plan
cd examples/server-side-rendering-async-node
yarn
yarn build
yarn start
TypeError: e[t] is not a function
in console