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

refactor!: use ImportManifestEntry.async for async client reference module #643

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hi-ogawa
Copy link
Owner

@hi-ogawa hi-ogawa commented Sep 16, 2024

It looks like this is now possible thanks to this PR:

We need to wait for next nightly release.


Actually I'd like the same thing for server reference and I would imagine Next.js also needs it to handle top-level-await similarly for server reference? That would help removing my yet another hack here:

// make server reference async for simplicity (stale chunkCache, etc...)
// see TODO in https://github.com/facebook/react/blob/33a32441e991e126e5e874f831bd3afc237a3ecf/packages/react-server-dom-webpack/src/ReactFlightClientConfigBundlerWebpack.js#L131-L132
code = code.replaceAll("if (isAsyncImport(metadata))", "if (true)");
code = code.replaceAll("4 === metadata.length", "true");

Copy link
Owner Author

hi-ogawa commented Sep 16, 2024

@hi-ogawa hi-ogawa marked this pull request as ready for review September 17, 2024 00:44
@hi-ogawa hi-ogawa force-pushed the refactor-async-client-reference-entry branch from 91e8e74 to d052639 Compare September 22, 2024 09:54
@hi-ogawa hi-ogawa changed the title refactor: use ImportManifestEntry.async refactor: use ImportManifestEntry.async for async client reference module Sep 22, 2024
@hi-ogawa hi-ogawa changed the title refactor: use ImportManifestEntry.async for async client reference module refactor!: use ImportManifestEntry.async for async client reference module Sep 23, 2024
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