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

Automatically use createRoot for React@>=18 #26279

Merged
merged 5 commits into from Jun 17, 2021

Conversation

devknoll
Copy link
Contributor

@devknoll devknoll commented Jun 17, 2021

Also logs a message when defaulting, and a warning when using a prerelease build of react-dom (e.g. the React 18 alpha) which are not officially supported.

Note: I've done this in webpack-config.ts instead of the Next.js config, as we don't actually want you to be able to opt-out without downgrading back to React 17, and so it ought to be entirely removed from the config eventually.

@ijjk

This comment has been minimized.

@ijjk

This comment has been minimized.

@devknoll devknoll marked this pull request as ready for review June 17, 2021 20:13
@ijjk
Copy link
Member

ijjk commented Jun 17, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
buildDuration 15s 14.1s -933ms
buildDurationCached 3.3s 3.5s ⚠️ +146ms
nodeModulesSize 46.4 MB 46.4 MB ⚠️ +2.5 kB
Page Load Tests Overall increase ✓
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
/ failed reqs 0 0
/ total time (seconds) 2.682 2.723 ⚠️ +0.04
/ avg req/sec 932.09 918.22 ⚠️ -13.87
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.787 1.686 -0.1
/error-in-render avg req/sec 1399.35 1482.45 +83.1
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 20.2 kB 20.2 kB
webpack-HASH.js gzip 804 B 804 B
Overall change 63 kB 63 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js use-react-18-if-present 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 azukaru/next.js use-react-18-if-present Change
_app-HASH.js gzip 801 B 801 B
_error-HASH.js gzip 3.17 kB 3.17 kB
amp-HASH.js gzip 527 B 527 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.41 kB 8.41 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
_buildManifest.js gzip 391 B 391 B
Overall change 391 B 391 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
index.html gzip 524 B 524 B
link.html gzip 536 B 536 B
withRouter.html gzip 516 B 516 B
Overall change 1.58 kB 1.58 kB

Serverless Mode (Decrease detected ✓)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
buildDuration 15.9s 16.3s ⚠️ +377ms
buildDurationCached 4.4s 4.7s ⚠️ +278ms
nodeModulesSize 46.4 MB 46.4 MB ⚠️ +2.5 kB
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
framework-HASH.js gzip 42 kB 42 kB
main-HASH.js gzip 20.2 kB 20.2 kB
webpack-HASH.js gzip 804 B 804 B
Overall change 63 kB 63 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js use-react-18-if-present 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 azukaru/next.js use-react-18-if-present Change
_app-HASH.js gzip 801 B 801 B
_error-HASH.js gzip 3.17 kB 3.17 kB
amp-HASH.js gzip 527 B 527 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.41 kB 8.41 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
_buildManifest.js gzip 391 B 391 B
Overall change 391 B 391 B
Serverless bundles Overall decrease ✓
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
_error.js 16.9 kB 16.9 kB
404.html 1.98 kB 1.98 kB
500.html 1.96 kB 1.96 kB
amp.amp.html 10.8 kB 10.8 kB
amp.html 1.17 kB 1.17 kB
css.html 1.35 kB 1.35 kB
hooks.html 1.23 kB 1.23 kB
index.js 17.2 kB 17.2 kB
link.js 17.5 kB 17.5 kB -2 B
routerDirect.js 17.3 kB 17.3 kB
withRouter.js 17.3 kB 17.3 kB
Overall change 105 kB 105 kB -2 B

Webpack 4 Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
buildDuration 12.9s 11.8s -1.1s
buildDurationCached 4.9s 4.7s -169ms
nodeModulesSize 46.4 MB 46.4 MB ⚠️ +2.5 kB
Page Load Tests Overall increase ✓
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
/ failed reqs 0 0
/ total time (seconds) 2.749 2.646 -0.1
/ avg req/sec 909.53 944.97 +35.44
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.747 1.57 -0.18
/error-in-render avg req/sec 1431.2 1592.75 +161.55
Client Bundles (main, webpack, commons)
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
677f882d2ed8..HASH.js gzip 13.3 kB 13.3 kB
framework.HASH.js gzip 41.8 kB 41.8 kB
main-HASH.js gzip 7.99 kB 7.99 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 63.8 kB 63.8 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary azukaru/next.js use-react-18-if-present 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 azukaru/next.js use-react-18-if-present Change
_app-HASH.js gzip 1.07 kB 1.07 kB
_error-HASH.js gzip 3.84 kB 3.84 kB
amp-HASH.js gzip 536 B 536 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.28 kB 9.28 kB
Client Build Manifests
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
_buildManifest.js gzip 420 B 420 B
Overall change 420 B 420 B
Rendered Page Sizes
vercel/next.js canary azukaru/next.js use-react-18-if-present Change
index.html gzip 567 B 567 B
link.html gzip 579 B 579 B
withRouter.html gzip 561 B 561 B
Overall change 1.71 kB 1.71 kB
Commit: c295584

@kodiakhq kodiakhq bot merged commit 14f01a1 into vercel:canary Jun 17, 2021
flybayer pushed a commit to blitz-js/next.js that referenced this pull request Jun 24, 2021
Also logs a message when defaulting, and a warning when using a prerelease build of `react-dom` (e.g. the React 18 alpha) which are not officially supported.

Note: I've done this in `webpack-config.ts` instead of the Next.js config, as we don't actually want you to be able to opt-out *without* downgrading back to React 17, and so it ought to be entirely removed from the config eventually.
@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants