Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep fouc tags for streaming #35417

Merged
merged 2 commits into from Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/next/pages/_document.tsx
Expand Up @@ -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
Expand Down Expand Up @@ -702,7 +699,7 @@ export class Head extends Component<

return (
<head {...this.props}>
{!hasConcurrentFeatures && this.context.isDevelopment && (
{this.context.isDevelopment && (
<>
<style
data-next-hide-fouc
Expand Down
Expand Up @@ -16,8 +16,8 @@ export default function (context) {
)
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 currentColor = await browser.eval(
`window.getComputedStyle(document.querySelector('h1')).color`
Expand Down