Support new hydrate API in latest react 18 alpha release#26664
Merged
Conversation
huozhi
requested review from
divmain,
ijjk,
lfades,
shuding and
timneutkens
as code owners
June 28, 2021 08:09
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
timneutkens
reviewed
Jun 28, 2021
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
timneutkens
reviewed
Jun 30, 2021
timneutkens
reviewed
Jun 30, 2021
timneutkens
previously approved these changes
Jun 30, 2021
timneutkens
left a comment
Contributor
There was a problem hiding this comment.
Should be good to land now 👍
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
timneutkens
previously approved these changes
Jun 30, 2021
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Member
Failing test suitesCommit: 50bfd5c9d0bc322a685f1afc9295d3fb39bc5277 test/integration/build-output/test/index.test.js
Expand output● Build Output › Basic Application Output (with experimental.gzipSize: true) › should not deviate from snapshot ● Build Output › Basic Application Output (with experimental.gzipSize: false) › should not deviate from snapshot ● Build Output › Basic Application Output › should not deviate from snapshot |
Member
Stats from current PRDefault Build (Decrease detected ✓)General Overall increase
|
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| buildDuration | 14s | 13.9s | -84ms |
| buildDurationCached | 3.5s | 3.3s | -146ms |
| nodeModulesSize | 49.2 MB | 49.2 MB |
Page Load Tests Overall decrease ⚠️
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.633 | 2.639 | |
| / avg req/sec | 949.58 | 947.27 | |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.667 | 1.675 | |
| /error-in-render avg req/sec | 1499.3 | 1492.68 |
Client Bundles (main, webpack, commons) Overall decrease ✓
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| framework-HASH.js gzip | 42 kB | 42 kB | ✓ |
| main-HASH.js gzip | 20.2 kB | 20.2 kB | -6 B |
| webpack-HASH.js gzip | 810 B | 810 B | ✓ |
| Overall change | 63 kB | 63 kB | -6 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
| Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| _app-HASH.js gzip | 803 B | 803 B | ✓ |
| _error-HASH.js gzip | 3.17 kB | 3.17 kB | ✓ |
| amp-HASH.js gzip | 526 B | 526 B | ✓ |
| css-HASH.js gzip | 329 B | 329 B | ✓ |
| hooks-HASH.js gzip | 903 B | 903 B | ✓ |
| index-HASH.js gzip | 263 B | 263 B | ✓ |
| link-HASH.js gzip | 1.65 kB | 1.65 kB | ✓ |
| routerDirect..HASH.js gzip | 322 B | 322 B | ✓ |
| withRouter-HASH.js gzip | 320 B | 320 B | ✓ |
| bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
| Overall change | 8.42 kB | 8.42 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 391 B | 391 B | ✓ |
| Overall change | 391 B | 391 B | ✓ |
Rendered Page Sizes Overall decrease ✓
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| index.html gzip | 524 B | 524 B | ✓ |
| link.html gzip | 536 B | 536 B | ✓ |
| withRouter.html gzip | 516 B | 515 B | -1 B |
| Overall change | 1.58 kB | 1.57 kB | -1 B |
Diffs
Diff for main-HASH.js
@@ -1421,8 +1421,9 @@
});
}
- var reactRoot = null;
- var shouldHydrate = typeof _reactDom["default"].hydrate === "function";
+ var reactRoot = null; // On initial render a hydrate should always happen
+
+ var shouldHydrate = true;
function renderReactElement(domEl, fn) {
// mark start of hydrate/renderDiff for index.html
@@ -19,7 +19,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/main-4bbd306c4351c0299964.js"
+ src="/_next/static/chunks/main-136b7587ff7b18118687.js"
defer=""
></script>
<scriptDiff for link.html
@@ -19,7 +19,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/main-4bbd306c4351c0299964.js"
+ src="/_next/static/chunks/main-136b7587ff7b18118687.js"
defer=""
></script>
<scriptDiff for withRouter.html
@@ -19,7 +19,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/main-4bbd306c4351c0299964.js"
+ src="/_next/static/chunks/main-136b7587ff7b18118687.js"
defer=""
></script>
<scriptWebpack 4 Mode (Decrease detected ✓)
General Overall increase ⚠️
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| buildDuration | 12.4s | 12.3s | -77ms |
| buildDurationCached | 4.9s | 4.9s | -27ms |
| nodeModulesSize | 49.2 MB | 49.2 MB |
Page Load Tests Overall decrease ⚠️
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| / failed reqs | 0 | 0 | ✓ |
| / total time (seconds) | 2.619 | 2.638 | |
| / avg req/sec | 954.56 | 947.73 | |
| /error-in-render failed reqs | 0 | 0 | ✓ |
| /error-in-render total time (seconds) | 1.644 | 1.768 | |
| /error-in-render avg req/sec | 1520.69 | 1413.65 |
Client Bundles (main, webpack, commons) Overall decrease ✓
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| 677f882d2ed8..HASH.js gzip | 13.4 kB | 13.4 kB | ✓ |
| framework.HASH.js gzip | 41.8 kB | 41.8 kB | ✓ |
| main-HASH.js gzip | 7.99 kB | 7.99 kB | -5 B |
| webpack-HASH.js gzip | 757 B | 757 B | ✓ |
| Overall change | 63.9 kB | 63.9 kB | -5 B |
Legacy Client Bundles (polyfills)
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
| Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| _app-HASH.js gzip | 1.07 kB | 1.07 kB | ✓ |
| _error-HASH.js gzip | 3.83 kB | 3.83 kB | ✓ |
| amp-HASH.js gzip | 531 B | 531 B | ✓ |
| css-HASH.js gzip | 333 B | 333 B | ✓ |
| hooks-HASH.js gzip | 910 B | 910 B | ✓ |
| index-HASH.js gzip | 227 B | 227 B | ✓ |
| link-HASH.js gzip | 1.64 kB | 1.64 kB | ✓ |
| routerDirect..HASH.js gzip | 295 B | 295 B | ✓ |
| withRouter-HASH.js gzip | 292 B | 292 B | ✓ |
| e025d2764813..52f.css gzip | 125 B | 125 B | ✓ |
| Overall change | 9.26 kB | 9.26 kB | ✓ |
Client Build Manifests
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| _buildManifest.js gzip | 422 B | 422 B | ✓ |
| Overall change | 422 B | 422 B | ✓ |
Rendered Page Sizes Overall decrease ✓
| vercel/next.js canary | huozhi/next.js react18-hydrate | Change | |
|---|---|---|---|
| index.html gzip | 568 B | 566 B | -2 B |
| link.html gzip | 581 B | 580 B | -1 B |
| withRouter.html gzip | 561 B | 560 B | -1 B |
| Overall change | 1.71 kB | 1.71 kB | -4 B |
Diffs
Diff for main-HASH.js
@@ -1224,8 +1224,9 @@ _N_E = (window["webpackJsonp_N_E"] = window["webpackJsonp_N_E"] || []).push([
});
}
- var reactRoot = null;
- var shouldHydrate = typeof _reactDom["default"].hydrate === "function";
+ var reactRoot = null; // On initial render a hydrate should always happen
+
+ var shouldHydrate = true;
function renderReactElement(domEl, fn) {
// mark start of hydrate/renderDiff for index.html
@@ -23,7 +23,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/main-25e5b58c1b4bd1b5be7a.js"
+ src="/_next/static/chunks/main-4008960cdf4a16d81cc2.js"
defer=""
></script>
<scriptDiff for link.html
@@ -23,7 +23,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/main-25e5b58c1b4bd1b5be7a.js"
+ src="/_next/static/chunks/main-4008960cdf4a16d81cc2.js"
defer=""
></script>
<scriptDiff for withRouter.html
@@ -23,7 +23,7 @@
defer=""
></script>
<script
- src="/_next/static/chunks/main-25e5b58c1b4bd1b5be7a.js"
+ src="/_next/static/chunks/main-4008960cdf4a16d81cc2.js"
defer=""
></script>
<script
kodiakhq Bot
pushed a commit
that referenced
this pull request
Aug 2, 2021
Remove unnecessary `React.Suspense` checks, as the minimum supported version is `react@>=17.0.1`. Also removes some files from the `react-18` integration test that are no longer necessary as of #26664.
flybayer
pushed a commit
to blitz-js/next.js
that referenced
this pull request
Aug 19, 2021
* fix: react 18 new hydration API * support react 18 * compat latest react only, fix resolved version * fix tests * Some changes based on reactwg/react-18#5 * fix test Co-authored-by: Tim Neutkens <timneutkens@me.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
flybayer
pushed a commit
to blitz-js/next.js
that referenced
this pull request
Aug 19, 2021
Remove unnecessary `React.Suspense` checks, as the minimum supported version is `react@>=17.0.1`. Also removes some files from the `react-18` integration test that are no longer necessary as of vercel#26664.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #26663
ReactDOM hydration API changes: reactwg/react-18#5 (comment)
Bug
fixes #number