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

feat(gatsby): SSR pages during development #27432

Merged
merged 149 commits into from Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
7a127f7
Prototype SSR wip
sidharthachatterjee Sep 2, 2020
3f920e3
Make it work
sidharthachatterjee Sep 3, 2020
0d614dd
Fix issue with running two instances of webpack
sidharthachatterjee Sep 3, 2020
4d073f5
Add a test suite for SSR
sidharthachatterjee Sep 8, 2020
88dc39e
Merge branch 'master' into feat/develop-ssr
sidharthachatterjee Sep 9, 2020
57a95ed
Linting
sidharthachatterjee Sep 9, 2020
19cf373
Run tests in CI
sidharthachatterjee Sep 9, 2020
655b685
Lint
sidharthachatterjee Sep 9, 2020
696487f
Merge branch 'master' into feat/develop-ssr
sidharthachatterjee Sep 9, 2020
da624c5
Merge remote-tracking branch 'origin/master' into k-develop-ssr
KyleAMathews Oct 12, 2020
89b671c
Show activity for HTML rendering + renable socket.io so server doesn'…
KyleAMathews Oct 13, 2020
a90ea0c
Add error page when templates don't render correctly
KyleAMathews Oct 13, 2020
d93d36d
Rebuild dev ssr bundle when source files change
KyleAMathews Oct 14, 2020
cfb1a3b
Fix some lint errors
KyleAMathews Oct 14, 2020
e4ab9c0
Fix building html
KyleAMathews Oct 14, 2020
ce714f3
use gatsby colors for syntax highlighting
KyleAMathews Oct 14, 2020
be7b2ae
Add test script to compare dev & prod output
KyleAMathews Oct 14, 2020
96c0f33
Add return types
KyleAMathews Oct 14, 2020
9d8bde2
Don't respond to dev server page loads until any sourcing/transformin…
KyleAMathews Oct 14, 2020
ac9642e
typings
KyleAMathews Oct 14, 2020
f8f00a3
fix types... maybe
KyleAMathews Oct 15, 2020
cbf16e0
maybe typescript happy
KyleAMathews Oct 15, 2020
1311c34
Add missing globals to tests & update snapshots
KyleAMathews Oct 15, 2020
4c86edb
moer merry type work
KyleAMathews Oct 15, 2020
f32c682
Remove outdated typography.js test
KyleAMathews Oct 15, 2020
0e0cefd
Start migrating route handler to spawned service
KyleAMathews Oct 15, 2020
494415f
back out moving dev html route into state machine
KyleAMathews Oct 16, 2020
ff59c2d
cleanups
KyleAMathews Oct 16, 2020
93e8fa1
more cleanups
KyleAMathews Oct 16, 2020
29a291e
yet moer cleanups
KyleAMathews Oct 16, 2020
8ab60c9
Add test for error parsing & codeframe creation
KyleAMathews Oct 16, 2020
68d2710
add return type
KyleAMathews Oct 16, 2020
2e05cb5
Feature flag functionality behind env variable
KyleAMathews Oct 16, 2020
616d856
Lighten how much the dev ssr html webpack instance is watching
KyleAMathews Oct 16, 2020
3442a00
cleanup
KyleAMathews Oct 16, 2020
424baaa
track usage while we're in experimental stage
KyleAMathews Oct 16, 2020
d4e4b2e
update snapshots
KyleAMathews Oct 16, 2020
cdea9a0
cleanup
KyleAMathews Oct 16, 2020
a10f070
Restore support for dev 404 page
KyleAMathews Oct 16, 2020
21cab9d
fix test
KyleAMathews Oct 16, 2020
c50327f
Catch reading errors
KyleAMathews Oct 19, 2020
6be8fe6
Make static queries work in dev-ssr
KyleAMathews Oct 19, 2020
f156049
Keep the renderer around
KyleAMathews Oct 19, 2020
b1eaa4a
Send 'loading' page if webpack is busy
KyleAMathews Oct 19, 2020
e11cc0a
Show more error so can debug CI
KyleAMathews Oct 19, 2020
00037e1
lazily build dev 404 page so it happens after webpack/queries are run
KyleAMathews Oct 19, 2020
5b8089a
just use /
KyleAMathews Oct 19, 2020
1cd80bf
Merge remote-tracking branch 'upstream/master' into k-develop-ssr
Oct 19, 2020
8031720
Add ansi-html as depdnency
KyleAMathews Oct 19, 2020
f44f285
Run test w/ experimental flag
KyleAMathews Oct 19, 2020
cabc58a
meaningless change to run tests again
KyleAMathews Oct 19, 2020
37bdaa0
use older version compatable with CI
KyleAMathews Oct 20, 2020
feab2f9
Update packages/gatsby/cache-dir/develop-static-entry.js
KyleAMathews Oct 20, 2020
8608b38
remove unnecessary changes
KyleAMathews Oct 20, 2020
9f16346
Consistently use imports
KyleAMathews Oct 20, 2020
2b3452b
fix
KyleAMathews Oct 20, 2020
e8da16c
Conditionally generate body str
KyleAMathews Oct 20, 2020
cc25d74
remove unneeded change
KyleAMathews Oct 20, 2020
27c18dd
Add find-page-by-path util from @pieh
pieh Oct 20, 2020
3059e56
make typescript happy
KyleAMathews Oct 20, 2020
78be606
Switch to use @pieh's page finder util
KyleAMathews Oct 20, 2020
d37c1c4
fix find-page-by-path tests
KyleAMathews Oct 21, 2020
a5b9b45
Enable dev ssr for tests
KyleAMathews Oct 21, 2020
9e23466
Add build:types again
sidharthachatterjee Oct 21, 2020
8a4f585
Do not await a flush
sidharthachatterjee Oct 21, 2020
05deee4
Merge remote-tracking branch 'upstream/master' into k-develop-ssr
Oct 21, 2020
bfccb50
Only delete the render-page.js module cache when it changes
KyleAMathews Oct 21, 2020
93d4a64
Try to reduce memory retention
KyleAMathews Oct 22, 2020
f1532e3
Fix recreating dev 404 page on every request + cache requires
KyleAMathews Oct 22, 2020
734f5b7
Add return
KyleAMathews Oct 22, 2020
36c33d7
this wasn't necessary
KyleAMathews Oct 22, 2020
b57cf79
Remove unused var
KyleAMathews Oct 22, 2020
bad3cda
fix return type
KyleAMathews Oct 22, 2020
257ec86
Share cache across develop/develop-html instances of webpack
KyleAMathews Oct 23, 2020
e33e843
This caused a lot of runtime tests to fail
KyleAMathews Oct 24, 2020
6482f03
Use the webpack hash
KyleAMathews Oct 24, 2020
26916f0
This didn't work
KyleAMathews Oct 24, 2020
b7fcd00
fix lint error
KyleAMathews Oct 24, 2020
37cf64c
Meaningless change to try tests again
KyleAMathews Oct 26, 2020
850231e
SSR pages in jest-worker so memory doesn't accumulate in main process
KyleAMathews Oct 26, 2020
2581da4
fix lint
KyleAMathews Oct 26, 2020
a4ffe3f
make typescript happy too
KyleAMathews Oct 26, 2020
98fbde1
fix test import
KyleAMathews Oct 26, 2020
07796c6
Merge remote-tracking branch 'upstream/master' into k-develop-ssr
Oct 27, 2020
a252870
Automatically fork the dev ssr renderer so it's ready to go when the …
KyleAMathews Oct 27, 2020
63765ed
Add structured logging on dev ssr failure
KyleAMathews Oct 27, 2020
3e9a3aa
Need require.resolve I think
KyleAMathews Oct 27, 2020
b284388
Add filepath + line/column to terminal error
KyleAMathews Oct 27, 2020
ebfa18d
try try again
KyleAMathews Oct 27, 2020
0df8483
Fixes hopefully
KyleAMathews Oct 27, 2020
1231fde
typescript 😱
KyleAMathews Oct 27, 2020
4994599
lint
KyleAMathews Oct 27, 2020
a0cb22c
Try tweaking jest settings
KyleAMathews Oct 27, 2020
822c482
Debuggin
KyleAMathews Oct 27, 2020
325cd4a
use default reporter
KyleAMathews Oct 27, 2020
421e993
explicitly init dev html worker pool so it doesn't start during tests
KyleAMathews Oct 27, 2020
85db9ec
restore original ci settings
KyleAMathews Oct 27, 2020
95a85b9
sup
KyleAMathews Oct 27, 2020
4c2b170
Update packages/gatsby-cli/src/structured-errors/error-map.ts
sidharthachatterjee Oct 27, 2020
45568e4
console.logs seem to break jest-worker on CI
KyleAMathews Oct 27, 2020
f2a862c
Increase pageLoadTimeout
KyleAMathews Oct 27, 2020
89da3ac
try taskTimeout
KyleAMathews Oct 27, 2020
e780c5d
This might be confusing cypress
KyleAMathews Oct 27, 2020
c7918b8
Don't re-spawn the worker process on every change as that's very expe…
KyleAMathews Oct 27, 2020
fd51701
cleanups
KyleAMathews Oct 27, 2020
2693163
Update packages/gatsby/cache-dir/develop-static-entry.js
KyleAMathews Oct 29, 2020
89b51b8
Cleanups suggested by @wardpeet
KyleAMathews Oct 29, 2020
55e44dc
fix lint
KyleAMathews Oct 29, 2020
850fe07
Lazily compile page components
KyleAMathews Oct 29, 2020
c5e740d
fix typescript
KyleAMathews Oct 29, 2020
c2a7191
mock /lazy-sync-requires
KyleAMathews Oct 29, 2020
dfeabe6
The lazy bundling created a race condition where two pages could be s…
KyleAMathews Oct 29, 2020
9d9af27
Add more pages to make sure we're going to hit the race condition
KyleAMathews Oct 29, 2020
e55886b
Check file directly that the page component has been added
KyleAMathews Oct 29, 2020
e63dd38
for some reason this lets log warnings from React not break jest-worker
KyleAMathews Oct 30, 2020
b13521f
fix test & comment
KyleAMathews Oct 30, 2020
d10ec64
We can't use the gatsby reporter inside a child as it uses process.se…
KyleAMathews Oct 30, 2020
4f159a8
Move writing lazyComponents to requires-writer & still use old develo…
KyleAMathews Oct 31, 2020
2ffb15d
update tests
KyleAMathews Oct 31, 2020
d58b886
Don't render body of pages w/ matchPath
KyleAMathews Oct 31, 2020
414430b
use core util joinPath so works on windows
KyleAMathews Oct 31, 2020
67c79b6
try again
KyleAMathews Oct 31, 2020
f70c177
try try again
KyleAMathews Oct 31, 2020
867bc42
remove mistakenly added file
KyleAMathews Oct 31, 2020
0462eb8
fix pnp test
KyleAMathews Oct 31, 2020
1d3604b
Merge branch 'master' into k-develop-ssr
KyleAMathews Nov 6, 2020
cb4c6f9
Move lazy bundling changes to https://github.com/gatsbyjs/gatsby/pull…
KyleAMathews Nov 9, 2020
acad5a8
Merge remote-tracking branch 'origin/master' into k-develop-ssr
KyleAMathews Nov 9, 2020
d0800ea
More cleanup
KyleAMathews Nov 9, 2020
305ae22
more cleanups
KyleAMathews Nov 9, 2020
681baa0
Test both old & new develop-static-entry
KyleAMathews Nov 9, 2020
1b9921e
fix lint
KyleAMathews Nov 9, 2020
80578d1
more lint fixes
KyleAMathews Nov 9, 2020
cab5b08
Use execa
KyleAMathews Nov 9, 2020
7ce4a3e
fix tests
KyleAMathews Nov 9, 2020
2740c42
Update names
KyleAMathews Nov 10, 2020
2c00092
Fail more gracefully when we source-maps don't work
KyleAMathews Nov 12, 2020
ce5f4ec
fix test & remove testing code
KyleAMathews Nov 12, 2020
a968156
Update snapshot
KyleAMathews Nov 12, 2020
33429f6
Merge branch 'master' into k-develop-ssr
KyleAMathews Nov 12, 2020
9cefce7
fix dependency check
KyleAMathews Nov 12, 2020
668cbba
remove unused import
KyleAMathews Nov 12, 2020
f26ae68
Update packages/gatsby/src/utils/dev-ssr/develop-html-route.ts
KyleAMathews Nov 16, 2020
cecc69a
revert unnecessary change
KyleAMathews Nov 16, 2020
671d73c
Merge branch 'master' into k-develop-ssr
KyleAMathews Nov 16, 2020
e557fca
restore more old behavior + move all new requires behind the flag
KyleAMathews Nov 16, 2020
67e0d0c
fix
KyleAMathews Nov 16, 2020
02dceb9
Merge branch 'master' into k-develop-ssr
KyleAMathews Nov 17, 2020
f91a18d
fix problem w/ merge w/ master
KyleAMathews Nov 17, 2020
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
8 changes: 8 additions & 0 deletions .circleci/config.yml
Expand Up @@ -271,6 +271,12 @@ jobs:
- e2e-test:
test_path: integration-tests/artifacts

integration_tests_ssr:
executor: node
steps:
- e2e-test:
test_path: integration-tests/ssr

e2e_tests_path-prefix:
<<: *e2e-executor
environment:
Expand Down Expand Up @@ -564,6 +570,8 @@ workflows:
<<: *e2e-test-workflow
- integration_tests_artifacts:
<<: *e2e-test-workflow
- integration_tests_ssr:
<<: *e2e-test-workflow
- integration_tests_gatsby_cli:
requires:
- bootstrap
Expand Down
21 changes: 21 additions & 0 deletions integration-tests/ssr/LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 gatsbyjs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions integration-tests/ssr/README.md
@@ -0,0 +1 @@
## SSR test suite
3 changes: 3 additions & 0 deletions integration-tests/ssr/__tests__/__snapshots__/ssr.js.snap
@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SSR is run for a page when it is requested 1`] = `"<!DOCTYPE html><html><head><meta charSet=\\"utf-8\\"/><meta http-equiv=\\"x-ua-compatible\\" content=\\"ie=edge\\"/><meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1, shrink-to-fit=no\\"/><meta name=\\"note\\" content=\\"environment=development\\"/><script src=\\"/socket.io/socket.io.js\\"></script></head><body><div id=\\"___gatsby\\"><div style=\\"outline:none\\" tabindex=\\"-1\\" id=\\"gatsby-focus-wrapper\\"><div>Hello world</div></div><div id=\\"gatsby-announcer\\" style=\\"position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0\\" aria-live=\\"assertive\\" aria-atomic=\\"true\\"></div></div><script src=\\"/polyfill.js\\" nomodule=\\"\\"></script><script src=\\"/commons.js\\"></script></body></html>"`;
22 changes: 22 additions & 0 deletions integration-tests/ssr/__tests__/ssr.js
@@ -0,0 +1,22 @@
const fetch = require(`node-fetch`)
const { execFile } = require("child_process")
KyleAMathews marked this conversation as resolved.
Show resolved Hide resolved

describe(`SSR`, () => {
test(`is run for a page when it is requested`, async () => {
const html = await fetch(`http://localhost:8000/`).then(res => res.text())

expect(html).toMatchSnapshot()
})
test(`dev & build outputs match`, async () => {
const childProcess = execFile(`yarn`, [`test-output`])
let exitCode
await new Promise(resolve => {
childProcess.on(`exit`, code => {
exitCode = { exitCode: code }
resolve()
})
})

expect(exitCode).toEqual({ exitCode: 0 })
})
})
10 changes: 10 additions & 0 deletions integration-tests/ssr/gatsby-config.js
@@ -0,0 +1,10 @@
module.exports = {
siteMetadata: {
title: `Hello world`,
author: `Sid Chatterjee`,
twitter: `chatsidhartha`,
github: `sidharthachatterjee`,
moreInfo: `Sid is amazing`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems about right ;-)

},
plugins: [],
}
3 changes: 3 additions & 0 deletions integration-tests/ssr/jest.config.js
@@ -0,0 +1,3 @@
module.exports = {
testPathIgnorePatterns: [`/node_modules/`, `__tests__/fixtures`, `.cache`],
}
38 changes: 38 additions & 0 deletions integration-tests/ssr/package.json
@@ -0,0 +1,38 @@
{
"name": "ssr",
"private": true,
"author": "Sid Chatterjee",
"description": "A simplified bare-bones starter for Gatsby",
"version": "0.1.0",
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"serve": "gatsby serve",
"clean": "gatsby clean",
"test-output": "node test-output.js",
"test:jest": "jest --config=jest.config.js --runInBand",
"start-dev-server": "start-server-and-test develop http://localhost:8000 test:jest",
"test": "npm-run-all -s build start-dev-server"
},
"dependencies": {
"gatsby": "^2.24.49",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
"devDependencies": {
"fs-extra": "^9.0.0",
"jest": "^24.0.0",
"jest-diff": "^24.0.0",
"jest-cli": "^24.0.0",
"npm-run-all": "4.1.5",
"start-server-and-test": "^1.11.3"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby-starter-hello-world"
},
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
}
}
15 changes: 15 additions & 0 deletions integration-tests/ssr/src/pages/index.js
@@ -0,0 +1,15 @@
import React from "react"
import { useStaticQuery, graphql } from "gatsby"

export default function Inline() {
const { site } = useStaticQuery(graphql`
{
site {
siteMetadata {
title
}
}
}
`)
return <div>{site.siteMetadata.title}</div>
}
96 changes: 96 additions & 0 deletions integration-tests/ssr/test-output.js
@@ -0,0 +1,96 @@
// To run the test script manually on a site (e.g. to test a plugin):
// - build the site first
// - start the develop server
// - run this script
;(async function () {
const { getPageHtmlFilePath } = require(`gatsby/dist/utils/page-html`)
const { join } = require(`path`)
const fs = require(`fs-extra`)
const fetch = require(`node-fetch`)
const diff = require(`jest-diff`)
const prettier = require(`prettier`)
const cheerio = require(`cheerio`)
const stripAnsi = require(`strip-ansi`)

const devSiteBasePath = `http://localhost:8000`

const comparePath = async path => {
const format = htmlStr => prettier.format(htmlStr, { parser: `html` })

const filterHtml = htmlStr => {
const $ = cheerio.load(htmlStr)
// There are many script tag differences
$(`script`).remove()
// Only added in production. Dev uses css-loader
$(`#gatsby-global-css`).remove()
// Only in prod
$(`link[rel="preload"]`).remove()
// Only in prod
$(`meta[name="generator"]`).remove()
// Only in dev
$(`meta[name="note"]`).remove()

return $.html()
}

const builtHtml = format(
filterHtml(
fs.readFileSync(
getPageHtmlFilePath(join(process.cwd(), `public`), path),
`utf-8`
)
)
)

const rawDevHtml = await fetch(`${devSiteBasePath}/${path}`).then(res =>
res.text()
)

const devHtml = format(filterHtml(rawDevHtml))
const diffResult = diff(devHtml, builtHtml, {
contextLines: 3,
expand: false,
})
if (
stripAnsi(diffResult) === `Compared values have no visual difference.`
) {
return true
} else {
console.log(`path "${path}" has differences between dev & prod`)
console.log(diffResult)
return false
}
}

const response = await fetch(`${devSiteBasePath}/__graphql`, {
method: `POST`,
headers: { "Content-Type": `application/json` },
body: JSON.stringify({
query: `query MyQuery {
allSitePage {
nodes {
path
}
}
}
`,
}),
}).then(res => res.json()) // expecting a json response

const paths = response.data.allSitePage.nodes
.map(n => n.path)
.filter(p => p !== `/dev-404-page/`)

console.log(
`testing these paths for differences between dev & prod outputs`,
paths
)

const results = await Promise.all(paths.map(p => comparePath(p)))
// Test all true
if (results.every(r => r)) {
process.exit(0)
} else {
process.exit(1)
}
})()
4 changes: 4 additions & 0 deletions packages/babel-plugin-remove-graphql-queries/src/index.ts
Expand Up @@ -269,6 +269,8 @@ export default function ({ types: t }): PluginObj {
JSXIdentifier(path2: NodePath<JSXIdentifier>): void {
if (
(process.env.NODE_ENV === `test` ||
state.opts.stage === `develop` ||
state.opts.stage === `develop-html` ||
wardpeet marked this conversation as resolved.
Show resolved Hide resolved
state.opts.stage === `build-html`) &&
path2.isJSXIdentifier({ name: `StaticQuery` }) &&
path2.referencesImport(`gatsby`, ``) &&
Expand Down Expand Up @@ -311,6 +313,8 @@ export default function ({ types: t }): PluginObj {
CallExpression(path2: NodePath<CallExpression>): void {
if (
(process.env.NODE_ENV === `test` ||
state.opts.stage === `develop` ||
state.opts.stage === `develop-html` ||
state.opts.stage === `build-html`) &&
isUseStaticQuery(path2)
) {
Expand Down
22 changes: 10 additions & 12 deletions packages/gatsby-plugin-typography/src/gatsby-ssr.js
Expand Up @@ -3,19 +3,17 @@ import { TypographyStyle, GoogleFont } from "react-typography"
import typography from "typography-plugin-cache-endpoint"

exports.onRenderBody = ({ setHeadComponents }, pluginOptions) => {
if (process.env.BUILD_STAGE === `build-html`) {
sidharthachatterjee marked this conversation as resolved.
Show resolved Hide resolved
const googleFont = [].concat(
pluginOptions.omitGoogleFont ? (
[]
) : (
<GoogleFont key={`GoogleFont`} typography={typography} />
)
const googleFont = [].concat(
pluginOptions.omitGoogleFont ? (
[]
) : (
<GoogleFont key={`GoogleFont`} typography={typography} />
)
setHeadComponents([
<TypographyStyle key={`TypographyStyle`} typography={typography} />,
...googleFont,
])
}
)
setHeadComponents([
<TypographyStyle key={`TypographyStyle`} typography={typography} />,
...googleFont,
])
}

// Move Typography.js styles to the top of the head section so they're loaded first
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/cache-dir/app.js
Expand Up @@ -101,7 +101,7 @@ apiRunnerAsync(`onClientEntry`).then(() => {
const renderer = apiRunner(
`replaceHydrateFunction`,
undefined,
ReactDOM.render
ReactDOM.hydrate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great because it improves warnings significantly. Just to confirm, min supported version of ReactDOM for hydrate is v16 so we're good.

)[0]

Promise.all([
Expand Down