Skip to content

Commit

Permalink
fix: add deferedDataScripts only streaming ssr (#6022)
Browse files Browse the repository at this point in the history
  • Loading branch information
GiveMe-A-Name authored Jul 31, 2024
1 parent 203c9eb commit 223d63b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/hot-squids-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/runtime': patch
---

fix: add deferedDataScripts only streaming ssr
fix: 只有在 streaming ssr 时才添加 deferedDataScripts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,15 @@ export const routerPlugin = ({
context={routerContext!}
hydrate={false}
/>
<DeferredDataScripts nonce={nonce} context={routerContext!} />

{mode === 'stream' && (
// ROUTER_DATA will inject in `packages/runtime/plugin-runtime/src/core/server/string/ssrData.ts` in string ssr
// So we can inject it only when streaming ssr
<DeferredDataScripts
nonce={nonce}
context={routerContext!}
/>
)}
{mode === 'stream' && JSX_SHELL_STREAM_END_MARK}
</>
);
Expand Down

0 comments on commit 223d63b

Please sign in to comment.