From 279f47b9caf32422f2a7239c905987774e30c11c Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Fri, 18 Mar 2022 01:19:03 +0100 Subject: [PATCH] Keep fouc tags for streaming (#35417) Basically the revert change of #31187 The fouc tag are rendered in first place, and the removing fouc tags script is executed before hydration which is early enough. This will unblock the dev mode of global CSS development ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x] Errors have helpful link attached, see `contributing.md` --- packages/next/pages/_document.tsx | 5 +---- .../react-streaming-and-server-components/test/css.js | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/next/pages/_document.tsx b/packages/next/pages/_document.tsx index 8ac37914b002..adc58bf357df 100644 --- a/packages/next/pages/_document.tsx +++ b/packages/next/pages/_document.tsx @@ -585,11 +585,8 @@ export class Head extends Component< disableOptimizedLoading, optimizeCss, optimizeFonts, - runtime, } = this.context - const hasConcurrentFeatures = !!runtime - const disableRuntimeJS = unstable_runtimeJS === false const disableJsPreload = unstable_JsPreload === false || !disableOptimizedLoading @@ -702,7 +699,7 @@ export class Head extends Component< return ( - {!hasConcurrentFeatures && this.context.isDevelopment && ( + {this.context.isDevelopment && ( <>