Unverified Commit 279f47b9 authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

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`
parent 757a0c70
...@@ -585,11 +585,8 @@ export class Head extends Component< ...@@ -585,11 +585,8 @@ export class Head extends Component<
disableOptimizedLoading, disableOptimizedLoading,
optimizeCss, optimizeCss,
optimizeFonts, optimizeFonts,
runtime,
} = this.context } = this.context
const hasConcurrentFeatures = !!runtime
const disableRuntimeJS = unstable_runtimeJS === false const disableRuntimeJS = unstable_runtimeJS === false
const disableJsPreload = const disableJsPreload =
unstable_JsPreload === false || !disableOptimizedLoading unstable_JsPreload === false || !disableOptimizedLoading
...@@ -702,7 +699,7 @@ export class Head extends Component< ...@@ -702,7 +699,7 @@ export class Head extends Component<
return ( return (
<head {...this.props}> <head {...this.props}>
{!hasConcurrentFeatures && this.context.isDevelopment && ( {this.context.isDevelopment && (
<> <>
<style <style
data-next-hide-fouc data-next-hide-fouc
......
...@@ -16,8 +16,8 @@ export default function (context) { ...@@ -16,8 +16,8 @@ export default function (context) {
) )
expect(currentColor).toMatchInlineSnapshot(`"rgb(255, 0, 0)"`) expect(currentColor).toMatchInlineSnapshot(`"rgb(255, 0, 0)"`)
}) })
// TODO: fix this test
it.skip('should include css modules with `serverComponents: true`', async () => { it('should include css modules with `serverComponents: true`', async () => {
const browser = await webdriver(context.appPort, '/css-modules') const browser = await webdriver(context.appPort, '/css-modules')
const currentColor = await browser.eval( const currentColor = await browser.eval(
`window.getComputedStyle(document.querySelector('h1')).color` `window.getComputedStyle(document.querySelector('h1')).color`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment