From a2f4b93b71e7eee65be52347eba526bf3c1a5778 Mon Sep 17 00:00:00 2001 From: Jude Gao Date: Mon, 25 Nov 2024 19:54:38 -0500 Subject: [PATCH] Do not inline CSS in RSC payload for dynamic client nav (#73182) --- .../server/app-render/render-css-resource.tsx | 2 +- .../e2e/app-dir/app-inline-css/app/a/page.tsx | 11 ++++++ .../app-dir/app-inline-css/app/a/styles.css | 3 ++ .../e2e/app-dir/app-inline-css/app/b/page.tsx | 11 ++++++ .../e2e/app-dir/app-inline-css/app/layout.tsx | 18 ++++++++- test/e2e/app-dir/app-inline-css/index.test.ts | 38 ++++++++++++++++++- 6 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 test/e2e/app-dir/app-inline-css/app/a/page.tsx create mode 100644 test/e2e/app-dir/app-inline-css/app/a/styles.css create mode 100644 test/e2e/app-dir/app-inline-css/app/b/page.tsx diff --git a/packages/next/src/server/app-render/render-css-resource.tsx b/packages/next/src/server/app-render/render-css-resource.tsx index 9ed009fa6c991..54cbf14ea9887 100644 --- a/packages/next/src/server/app-render/render-css-resource.tsx +++ b/packages/next/src/server/app-render/render-css-resource.tsx @@ -36,7 +36,7 @@ export function renderCssResource( entryCssFile.path )}${getAssetQueryString(ctx, true)}` - if (entryCssFile.inlined) { + if (entryCssFile.inlined && !ctx.parsedRequestHeaders.isRSCRequest) { return (