Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: support async server reference
Browse files Browse the repository at this point in the history
hi-ogawa committed Sep 22, 2024
1 parent d052639 commit 33c4c2d
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ export function createActionBundlerConfig(): BundlerConfig {
id,
name,
chunks: [],
async: true,
} satisfies ImportManifestEntry;
},
},
4 changes: 2 additions & 2 deletions packages/react-server/src/plugin/index.ts
Original file line number Diff line number Diff line change
@@ -248,8 +248,8 @@ export function vitePluginReactServer(

// 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");
// code = code.replaceAll("if (isAsyncImport(metadata))", "if (true)");
// code = code.replaceAll("4 === metadata.length", "true");

return code;
}
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 33c4c2d

Please sign in to comment.