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

Update React from 14898b6a9 to e373190fa #63685

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@
"random-seed": "0.3.0",
"react": "18.2.0",
"react-17": "npm:react@17.0.2",
"react-builtin": "npm:react@18.3.0-canary-14898b6a9-20240318",
"react-builtin": "npm:react@18.3.0-canary-e373190fa-20240325",
"react-dom": "18.2.0",
"react-dom-17": "npm:react-dom@17.0.2",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-14898b6a9-20240318",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-14898b6a9-20240318",
"react-experimental-builtin": "npm:react@0.0.0-experimental-14898b6a9-20240318",
"react-server-dom-turbopack": "18.3.0-canary-14898b6a9-20240318",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-14898b6a9-20240318",
"react-server-dom-webpack": "18.3.0-canary-14898b6a9-20240318",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-14898b6a9-20240318",
"react-dom-builtin": "npm:react-dom@18.3.0-canary-e373190fa-20240325",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-e373190fa-20240325",
"react-experimental-builtin": "npm:react@0.0.0-experimental-e373190fa-20240325",
"react-server-dom-turbopack": "18.3.0-canary-e373190fa-20240325",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-e373190fa-20240325",
"react-server-dom-webpack": "18.3.0-canary-e373190fa-20240325",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-e373190fa-20240325",
"react-ssr-prepass": "1.0.8",
"react-virtualized": "9.22.3",
"relay-compiler": "13.0.2",
Expand All @@ -217,8 +217,8 @@
"resolve-from": "5.0.0",
"sass": "1.54.0",
"satori": "0.10.9",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-14898b6a9-20240318",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-14898b6a9-20240318",
"scheduler-builtin": "npm:scheduler@0.24.0-canary-e373190fa-20240325",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-e373190fa-20240325",
"seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4",
"semver": "7.3.7",
Expand Down
5 changes: 4 additions & 1 deletion packages/next/src/client/app-index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import { HMR_ACTIONS_SENT_TO_BROWSER } from '../server/dev/hot-reloader-types'
// Since React doesn't call onerror for errors caught in error boundaries.
const origConsoleError = window.console.error
window.console.error = (...args) => {
if (isNextRouterError(args[0])) {
// in dev, the actual error is the second argument.
const error = process.env.NODE_ENV === 'development' ? args[1] : args[0]

if (isNextRouterError(error)) {
return
}
origConsoleError.apply(window.console, args)
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,24 @@ function printWarning(level, format, args) {
}
}

var ReactVersion = '18.3.0-experimental-14898b6a9-20240318';

var ReactVersion = '18.3.0-experimental-e373190fa-20240325';

function noop() {}

var DefaultDispatcher = {
prefetchDNS: noop,
preconnect: noop,
preload: noop,
preloadModule: noop,
preinitScript: noop,
preinitStyle: noop,
preinitModuleScript: noop
};
var Internals = {
usingClientEntryPoint: false,
Events: null,
Dispatcher: {
current: null
ReactDOMCurrentDispatcher: {
current: DefaultDispatcher
}
};

Expand All @@ -84,7 +95,7 @@ function getCrossOriginStringAs(as, input) {
return undefined;
}

var Dispatcher = Internals.Dispatcher;
var ReactDOMCurrentDispatcher = Internals.ReactDOMCurrentDispatcher;
function prefetchDNS(href) {
{
if (typeof href !== 'string' || !href) {
Expand All @@ -100,10 +111,8 @@ function prefetchDNS(href) {
}
}

var dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string') {
dispatcher.prefetchDNS(href);
if (typeof href === 'string') {
ReactDOMCurrentDispatcher.current.prefetchDNS(href);
} // We don't error because preconnect needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
// so we favor silent bailout over warning or erroring.
Expand All @@ -120,11 +129,9 @@ function preconnect(href, options) {
}
}

var dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string') {
if (typeof href === 'string') {
var crossOrigin = options ? getCrossOriginString(options.crossOrigin) : null;
dispatcher.preconnect(href, crossOrigin);
ReactDOMCurrentDispatcher.current.preconnect(href, crossOrigin);
} // We don't error because preconnect needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
// so we favor silent bailout over warning or erroring.
Expand All @@ -149,13 +156,11 @@ function preload(href, options) {
}
}

var dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string' && // We check existence because we cannot enforce this function is actually called with the stated type
if (typeof href === 'string' && // We check existence because we cannot enforce this function is actually called with the stated type
typeof options === 'object' && options !== null && typeof options.as === 'string') {
var as = options.as;
var crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
dispatcher.preload(href, as, {
ReactDOMCurrentDispatcher.current.preload(href, as, {
crossOrigin: crossOrigin,
integrity: typeof options.integrity === 'string' ? options.integrity : undefined,
nonce: typeof options.nonce === 'string' ? options.nonce : undefined,
Expand Down Expand Up @@ -189,18 +194,16 @@ function preloadModule(href, options) {
}
}

var dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string') {
if (typeof href === 'string') {
if (options) {
var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
dispatcher.preloadModule(href, {
ReactDOMCurrentDispatcher.current.preloadModule(href, {
as: typeof options.as === 'string' && options.as !== 'script' ? options.as : undefined,
crossOrigin: crossOrigin,
integrity: typeof options.integrity === 'string' ? options.integrity : undefined
});
} else {
dispatcher.preloadModule(href);
ReactDOMCurrentDispatcher.current.preloadModule(href);
}
} // We don't error because preload needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
Expand All @@ -218,22 +221,20 @@ function preinit(href, options) {
}
}

var dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string' && options && typeof options.as === 'string') {
if (typeof href === 'string' && options && typeof options.as === 'string') {
var as = options.as;
var crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
var integrity = typeof options.integrity === 'string' ? options.integrity : undefined;
var fetchPriority = typeof options.fetchPriority === 'string' ? options.fetchPriority : undefined;

if (as === 'style') {
dispatcher.preinitStyle(href, typeof options.precedence === 'string' ? options.precedence : undefined, {
ReactDOMCurrentDispatcher.current.preinitStyle(href, typeof options.precedence === 'string' ? options.precedence : undefined, {
crossOrigin: crossOrigin,
integrity: integrity,
fetchPriority: fetchPriority
});
} else if (as === 'script') {
dispatcher.preinitScript(href, {
ReactDOMCurrentDispatcher.current.preinitScript(href, {
crossOrigin: crossOrigin,
integrity: integrity,
fetchPriority: fetchPriority,
Expand Down Expand Up @@ -281,20 +282,18 @@ function preinitModule(href, options) {
}
}

var dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string') {
if (typeof href === 'string') {
if (typeof options === 'object' && options !== null) {
if (options.as == null || options.as === 'script') {
var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
dispatcher.preinitModuleScript(href, {
ReactDOMCurrentDispatcher.current.preinitModuleScript(href, {
crossOrigin: crossOrigin,
integrity: typeof options.integrity === 'string' ? options.integrity : undefined,
nonce: typeof options.nonce === 'string' ? options.nonce : undefined
});
}
} else if (options == null) {
dispatcher.preinitModuleScript(href);
ReactDOMCurrentDispatcher.current.preinitModuleScript(href);
}
} // We don't error because preinit needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
Expand All @@ -319,7 +318,7 @@ function resolveDispatcher() {

{
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.');
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://react.dev/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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,24 @@

var React = require("next/dist/compiled/react-experimental");

var ReactVersion = '18.3.0-experimental-14898b6a9-20240318';

var ReactVersion = '18.3.0-experimental-e373190fa-20240325';

function noop() {}

const DefaultDispatcher = {
prefetchDNS: noop,
preconnect: noop,
preload: noop,
preloadModule: noop,
preinitScript: noop,
preinitStyle: noop,
preinitModuleScript: noop
};
const Internals = {
usingClientEntryPoint: false,
Events: null,
Dispatcher: {
current: null
ReactDOMCurrentDispatcher: {
current: DefaultDispatcher
}
};

Expand Down Expand Up @@ -58,39 +69,33 @@ function getCrossOriginStringAs(as, input) {
return undefined;
}

const Dispatcher = Internals.Dispatcher;
const ReactDOMCurrentDispatcher = Internals.ReactDOMCurrentDispatcher;
function prefetchDNS(href) {

const dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string') {
dispatcher.prefetchDNS(href);
if (typeof href === 'string') {
ReactDOMCurrentDispatcher.current.prefetchDNS(href);
} // We don't error because preconnect needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
// so we favor silent bailout over warning or erroring.

}
function preconnect(href, options) {

const dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string') {
if (typeof href === 'string') {
const crossOrigin = options ? getCrossOriginString(options.crossOrigin) : null;
dispatcher.preconnect(href, crossOrigin);
ReactDOMCurrentDispatcher.current.preconnect(href, crossOrigin);
} // We don't error because preconnect needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
// so we favor silent bailout over warning or erroring.

}
function preload(href, options) {

const dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string' && // We check existence because we cannot enforce this function is actually called with the stated type
if (typeof href === 'string' && // We check existence because we cannot enforce this function is actually called with the stated type
typeof options === 'object' && options !== null && typeof options.as === 'string') {
const as = options.as;
const crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
dispatcher.preload(href, as, {
ReactDOMCurrentDispatcher.current.preload(href, as, {
crossOrigin,
integrity: typeof options.integrity === 'string' ? options.integrity : undefined,
nonce: typeof options.nonce === 'string' ? options.nonce : undefined,
Expand All @@ -107,18 +112,16 @@ function preload(href, options) {
}
function preloadModule(href, options) {

const dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string') {
if (typeof href === 'string') {
if (options) {
const crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
dispatcher.preloadModule(href, {
ReactDOMCurrentDispatcher.current.preloadModule(href, {
as: typeof options.as === 'string' && options.as !== 'script' ? options.as : undefined,
crossOrigin,
integrity: typeof options.integrity === 'string' ? options.integrity : undefined
});
} else {
dispatcher.preloadModule(href);
ReactDOMCurrentDispatcher.current.preloadModule(href);
}
} // We don't error because preload needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
Expand All @@ -127,22 +130,20 @@ function preloadModule(href, options) {
}
function preinit(href, options) {

const dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string' && options && typeof options.as === 'string') {
if (typeof href === 'string' && options && typeof options.as === 'string') {
const as = options.as;
const crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
const integrity = typeof options.integrity === 'string' ? options.integrity : undefined;
const fetchPriority = typeof options.fetchPriority === 'string' ? options.fetchPriority : undefined;

if (as === 'style') {
dispatcher.preinitStyle(href, typeof options.precedence === 'string' ? options.precedence : undefined, {
ReactDOMCurrentDispatcher.current.preinitStyle(href, typeof options.precedence === 'string' ? options.precedence : undefined, {
crossOrigin,
integrity,
fetchPriority
});
} else if (as === 'script') {
dispatcher.preinitScript(href, {
ReactDOMCurrentDispatcher.current.preinitScript(href, {
crossOrigin,
integrity,
fetchPriority,
Expand All @@ -156,20 +157,18 @@ function preinit(href, options) {
}
function preinitModule(href, options) {

const dispatcher = Dispatcher.current;

if (dispatcher && typeof href === 'string') {
if (typeof href === 'string') {
if (typeof options === 'object' && options !== null) {
if (options.as == null || options.as === 'script') {
const crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
dispatcher.preinitModuleScript(href, {
ReactDOMCurrentDispatcher.current.preinitModuleScript(href, {
crossOrigin,
integrity: typeof options.integrity === 'string' ? options.integrity : undefined,
nonce: typeof options.nonce === 'string' ? options.nonce : undefined
});
}
} else if (options == null) {
dispatcher.preinitModuleScript(href);
ReactDOMCurrentDispatcher.current.preinitModuleScript(href);
}
} // We don't error because preinit needs to be resilient to being called in a variety of scopes
// and the runtime may not be capable of responding. The function is optimistic and not critical
Expand Down
Loading
Loading