Skip to content

Commit

Permalink
refactor: support async server reference
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Sep 22, 2024
1 parent 9475424 commit 9231dfd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function createActionBundlerConfig(): BundlerConfig {
id,
name,
chunks: [],
async: true,
} satisfies ImportManifestEntry;
},
},
Expand Down
4 changes: 2 additions & 2 deletions packages/react-server/src/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9231dfd

Please sign in to comment.