Skip to content

Commit

Permalink
Upgrade React to 18.3.0-canary-16d053d59-20230506
Browse files Browse the repository at this point in the history
Fixes a bug where `useFormStatus` crashed during SSR.

Includes the following upstream changes:

- [16d053d59](https://github.com/facebook/react/commits/16d053d59) Add useFormStatus to server rendering stub ([vercel#26788](facebook/react#26788)) (Andrew Clark)
- [efb381bbf](https://github.com/facebook/react/commits/efb381bbf) [Release Script] Print a hint where to get the token ([vercel#26783](facebook/react#26783)) (dan)
- [b00e27342](https://github.com/facebook/react/commits/b00e27342) Use native scheduler if defined in global scope ([vercel#26554](facebook/react#26554)) (Samuel Susla)
- [783e7fcfa](https://github.com/facebook/react/commits/783e7fcfa) React DevTools 4.27.6 -> 4.27.7 ([vercel#26780](facebook/react#26780)) (Ruslan Lesiutin)
- [377c5175f](https://github.com/facebook/react/commits/377c5175f) DevTools: fix backend activation ([vercel#26779](facebook/react#26779)) (Ruslan Lesiutin)
  • Loading branch information
acdlite committed May 7, 2023
1 parent 173381a commit 8b0485e
Show file tree
Hide file tree
Showing 61 changed files with 1,449 additions and 216 deletions.
16 changes: 8 additions & 8 deletions package.json
Expand Up @@ -197,14 +197,14 @@
"random-seed": "0.3.0",
"react": "18.2.0",
"react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@18.3.0-canary-aef7ce554-20230503",
"react-experimental-builtin": "npm:react@0.0.0-experimental-aef7ce554-20230503",
"react-builtin": "npm:react@18.3.0-canary-16d053d59-20230506",
"react-experimental-builtin": "npm:react@0.0.0-experimental-16d053d59-20230506",
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-aef7ce554-20230503",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-aef7ce554-20230503",
"react-server-dom-webpack": "18.3.0-canary-aef7ce554-20230503",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-aef7ce554-20230503",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-16d053d59-20230506",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-16d053d59-20230506",
"react-server-dom-webpack": "18.3.0-canary-16d053d59-20230506",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-16d053d59-20230506",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -215,8 +215,8 @@
"rimraf": "3.0.2",
"sass": "1.54.0",
"satori": "0.4.4",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-aef7ce554-20230503",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-aef7ce554-20230503",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-16d053d59-20230506",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-16d053d59-20230506",
"seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4",
"semver": "7.3.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/compiled/babel-packages/packages-bundle.js

Large diffs are not rendered by default.

Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-experimental-aef7ce554-20230503';
var ReactVersion = '18.3.0-experimental-16d053d59-20230506';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -18,7 +18,7 @@ var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');
var stream = require('stream');

var ReactVersion = '18.3.0-experimental-aef7ce554-20230503';
var ReactVersion = '18.3.0-experimental-16d053d59-20230506';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -14,7 +14,9 @@ if (process.env.NODE_ENV !== "production") {
(function() {
'use strict';

var ReactVersion = '18.3.0-experimental-aef7ce554-20230503';
var React = require("next/dist/compiled/react-experimental");

var ReactVersion = '18.3.0-experimental-16d053d59-20230506';

var Internals = {
usingClientEntryPoint: false,
Expand Down Expand Up @@ -84,6 +86,72 @@ function preinit(href, options) {

}

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

function error(format) {
{
{
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}

printWarning('error', format, args);
}
}
}

function printWarning(level, format, args) {
// When changing this logic, you might want to also
// update consoleWithStackDev.www.js as well.
{
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
var stack = ReactDebugCurrentFrame.getStackAddendum();

if (stack !== '') {
format += '%s';
args = args.concat([stack]);
} // eslint-disable-next-line react-internal/safe-string-coercion


var argsWithFormat = args.map(function (item) {
return String(item);
}); // Careful: RN currently depends on this prefix

argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
// breaks IE9: https://github.com/facebook/react/issues/13610
// eslint-disable-next-line react-internal/no-production-logging

Function.prototype.apply.call(console[level], console, argsWithFormat);
}
}

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; // Since the "not pending" value is always the same, we can reuse the

function resolveDispatcher() {
// Copied from react/src/ReactHooks.js. It's the same thing but in a
// different package.
var dispatcher = ReactCurrentDispatcher.current;

{
if (dispatcher === null) {
error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
}
} // Will result in a null access error if accessed outside render phase. We
// intentionally don't throw our own error because this is in a hot path.
// Also helps ensure this is inlined.


return dispatcher;
}

function useFormStatus() {
{
var dispatcher = resolveDispatcher(); // $FlowFixMe[not-a-function] We know this exists because of the feature check above.

return dispatcher.useHostTransitionStatus();
}
}

function createPortal() {
throw new Error('createPortal was called on the server. Portals are not currently' + ' supported on the server. Update your program to conditionally call' + ' createPortal on the client only.');
}
Expand All @@ -93,6 +161,7 @@ function flushSync() {

exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
exports.createPortal = createPortal;
exports.experimental_useFormStatus = useFormStatus;
exports.flushSync = flushSync;
exports.preconnect = preconnect;
exports.prefetchDNS = prefetchDNS;
Expand Down
Expand Up @@ -7,5 +7,6 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';var d={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function e(c){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+c,a=1;a<arguments.length;a++)b+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+c+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var f=d.Dispatcher;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=d;
exports.createPortal=function(){throw Error(e(448));};exports.flushSync=function(){throw Error(e(449));};exports.preconnect=function(c,b){var a=f.current;a&&a.preconnect(c,b)};exports.prefetchDNS=function(c){var b=f.current;b&&b.prefetchDNS(c)};exports.preinit=function(c,b){var a=f.current;a&&a.preinit(c,b)};exports.preload=function(c,b){var a=f.current;a&&a.preload(c,b)};exports.version="18.3.0-experimental-aef7ce554-20230503";
'use strict';var d=require("next/dist/compiled/react-experimental"),e={usingClientEntryPoint:!1,Events:null,Dispatcher:{current:null}};function f(c){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+c,a=1;a<arguments.length;a++)b+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+c+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var g=e.Dispatcher,h=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e;exports.createPortal=function(){throw Error(f(448));};exports.experimental_useFormStatus=function(){return h.current.useHostTransitionStatus()};exports.flushSync=function(){throw Error(f(449));};exports.preconnect=function(c,b){var a=g.current;a&&a.preconnect(c,b)};exports.prefetchDNS=function(c){var b=g.current;b&&b.prefetchDNS(c)};exports.preinit=function(c,b){var a=g.current;a&&a.preinit(c,b)};
exports.preload=function(c,b){var a=g.current;a&&a.preload(c,b)};exports.version="18.3.0-experimental-16d053d59-20230506";
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-experimental-aef7ce554-20230503';
var ReactVersion = '18.3.0-experimental-16d053d59-20230506';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-experimental-aef7ce554-20230503';
var ReactVersion = '18.3.0-experimental-16d053d59-20230506';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -19,7 +19,7 @@ var util = require('util');
var async_hooks = require('async_hooks');
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-experimental-aef7ce554-20230503';
var ReactVersion = '18.3.0-experimental-16d053d59-20230506';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-experimental-aef7ce554-20230503';
var ReactVersion = '18.3.0-experimental-16d053d59-20230506';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down

0 comments on commit 8b0485e

Please sign in to comment.