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 a870b2d54 #63976

Closed
wants to merge 1 commit 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-a870b2d54-20240314",
"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-a870b2d54-20240314",
"react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-a870b2d54-20240314",
"react-experimental-builtin": "npm:react@0.0.0-experimental-a870b2d54-20240314",
"react-server-dom-turbopack": "18.3.0-canary-a870b2d54-20240314",
"react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-a870b2d54-20240314",
"react-server-dom-webpack": "18.3.0-canary-a870b2d54-20240314",
"react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-a870b2d54-20240314",
"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-a870b2d54-20240314",
"scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-a870b2d54-20240314",
"seedrandom": "3.0.5",
"selenium-webdriver": "4.0.0-beta.4",
"semver": "7.3.7",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function formatProdErrorMessage(code) {
return "Minified React error #" + code + "; visit " + url + " for the full message or " + 'use the non-minified dev environment for full errors and additional ' + 'helpful warnings.';
}

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

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -191,6 +191,9 @@ function stringToChunk(content) {
function stringToPrecomputedChunk(content) {
return content;
}
function clonePrecomputedChunk(chunk) {
return chunk;
}
function closeWithError(destination, error) {
// $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types.
destination.destroy(error);
Expand Down Expand Up @@ -335,7 +338,7 @@ function escapeHtml(string) {


function escapeTextForBrowser(text) {
if (typeof text === 'boolean' || typeof text === 'number') {
if (typeof text === 'boolean' || typeof text === 'number' || typeof text === 'bigint') {
// this shortcircuit helps perf for types that we know will never have
// special characters, especially given that this function is used often
// for numeric dom ids.
Expand Down Expand Up @@ -365,7 +368,31 @@ function hyphenateStyleName(name) {
return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
}

// and any newline or tab are filtered out as if they're not part of the URL.
// https://url.spec.whatwg.org/#url-parsing
// Tab or newline are defined as \r\n\t:
// https://infra.spec.whatwg.org/#ascii-tab-or-newline
// A C0 control is a code point in the range \u0000 NULL to \u001F
// INFORMATION SEPARATOR ONE, inclusive:
// https://infra.spec.whatwg.org/#c0-control-or-space

/* eslint-disable max-len */

const isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;

function sanitizeURL(url) {
// We should never have symbols here because they get filtered out elsewhere.
// eslint-disable-next-line react-internal/safe-string-coercion
const stringifiedURL = '' + url;

{
if (isJavaScriptProtocol.test(stringifiedURL)) {
// Return a different javascript: url that doesn't cause any side-effects and just
// throws if ever visited.
// eslint-disable-next-line no-script-url
return "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')";
}
}

return url;
}
Expand All @@ -392,19 +419,17 @@ const NotPending = sharedNotPendingObject;

const ReactDOMSharedInternals = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

const ReactDOMCurrentDispatcher = ReactDOMSharedInternals.Dispatcher;
const ReactDOMServerDispatcher = {
const ReactDOMCurrentDispatcher = ReactDOMSharedInternals.ReactDOMCurrentDispatcher;
const previousDispatcher = ReactDOMCurrentDispatcher.current;
ReactDOMCurrentDispatcher.current = {
prefetchDNS,
preconnect,
preload,
preloadModule,
preinitStyle,
preinitScript,
preinitStyle,
preinitModuleScript
};
function prepareHostDispatcher() {
ReactDOMCurrentDispatcher.current = ReactDOMServerDispatcher;
} // We make every property of the descriptor optional because it is not a contract that
}; // We make every property of the descriptor optional because it is not a contract that
const ScriptStreamingFormat = 0;
const DataStreamingFormat = 1;
const NothingSent
Expand Down Expand Up @@ -482,10 +507,11 @@ const importMapScriptEnd = stringToPrecomputedChunk('</script>'); // Since we st
// It should also be noted that this maximum is a soft maximum. we have not reached the limit we will
// allow one more header to be captured which means in practice if the limit is approached it will be exceeded

const DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000; // Allows us to keep track of what we've already written so we can refer back to it.
const DEFAULT_HEADERS_CAPACITY_IN_UTF16_CODE_UNITS = 2000;
// if passed externalRuntimeConfig and the enableFizzExternalRuntime feature flag
// is set, the server will send instructions via data attributes (instead of inline scripts)


function createRenderState$1(resumableState, nonce, externalRuntimeConfig, importMap, onHeaders, maxHeadersLength) {
const inlineScriptWithNonce = nonce === undefined ? startInlineScript : stringToPrecomputedChunk('<script nonce="' + escapeTextForBrowser(nonce) + '">');
const idPrefix = resumableState.idPrefix;
Expand Down Expand Up @@ -1241,6 +1267,20 @@ function pushAttribute(target, name, value) // not null or undefined
pushStringAttribute(target, 'xml:space', value);
return;

case 'inert':
{
{


if (value && typeof value !== 'function' && typeof value !== 'symbol') {
target.push(attributeSeparator, stringToChunk(name), attributeEmptyString);
}

return;
}
}
// fallthrough for new boolean props without the flag on

default:
if ( // shouldIgnoreAttribute
// We have already filtered out null/undefined and reserved words.
Expand Down Expand Up @@ -2835,7 +2875,7 @@ function pushStartInstance(target, type, props, resumableState, renderState, hoi
return pushSelfClosing(target, props, type);
}
// These are reserved SVG and MathML elements, that are never custom elements.
// https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
// https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-core-concepts

case 'annotation-xml':
case 'color-profile':
Expand Down Expand Up @@ -3237,7 +3277,7 @@ function writeCompletedBoundaryInstruction(destination, resumableState, renderSt
if (requiresStyleInsertion) {
if ((resumableState.instructions & SentCompleteBoundaryFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction | SentCompleteBoundaryFunction;
writeChunk(destination, completeBoundaryWithStylesScript1FullBoth);
writeChunk(destination, clonePrecomputedChunk(completeBoundaryWithStylesScript1FullBoth));
} else if ((resumableState.instructions & SentStyleInsertionFunction) === NothingSent) {
resumableState.instructions |= SentStyleInsertionFunction;
writeChunk(destination, completeBoundaryWithStylesScript1FullPartial);
Expand Down Expand Up @@ -4094,6 +4134,7 @@ function prefetchDNS(href) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.prefetchDNS(href);
return;
}

Expand Down Expand Up @@ -4151,6 +4192,7 @@ function preconnect(href, crossOrigin) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.preconnect(href, crossOrigin);
return;
}

Expand Down Expand Up @@ -4209,6 +4251,7 @@ function preload(href, as, options) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.preload(href, as, options);
return;
}

Expand Down Expand Up @@ -4410,6 +4453,7 @@ function preloadModule(href, options) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.preloadModule(href, options);
return;
}

Expand Down Expand Up @@ -4477,6 +4521,7 @@ function preinitStyle(href, precedence, options) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.preinitStyle(href, precedence, options);
return;
}

Expand Down Expand Up @@ -4555,6 +4600,7 @@ function preinitScript(src, options) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.preinitScript(src, options);
return;
}

Expand Down Expand Up @@ -4616,6 +4662,7 @@ function preinitModuleScript(src, options) {
// the resources for this call in either case we opt to do nothing. We can consider making this a warning
// but there may be times where calling a function outside of render is intentional (i.e. to warm up data
// fetching) and we don't want to warn in those cases.
previousDispatcher.preinitModuleScript(src, options);
return;
}

Expand Down Expand Up @@ -5153,44 +5200,6 @@ function getComponentNameFromType(type) {

const emptyContextObject = {};

function getMaskedContext(type, unmaskedContext) {
{
const contextTypes = type.contextTypes;

if (!contextTypes) {
return emptyContextObject;
}

const context = {};

for (const key in contextTypes) {
context[key] = unmaskedContext[key];
}

return context;
}
}
function processChildContext(instance, type, parentContext, childContextTypes) {
{
// TODO (bvaughn) Replace this behavior with an invariant() in the future.
// It has only been added in Fiber to match the (unintentional) behavior in Stack.
if (typeof instance.getChildContext !== 'function') {

return parentContext;
}

const childContext = instance.getChildContext();

for (const contextKey in childContext) {
if (!(contextKey in childContextTypes)) {
throw Error(formatProdErrorMessage(108, getComponentNameFromType(type) || 'Unknown', contextKey));
}
}

return assign({}, parentContext, childContext);
}
}

// Forming a reverse tree.
// The structure of a context snapshot is an implementation of this file.
// Currently, it's implemented as tracking the current active node.
Expand Down Expand Up @@ -5421,8 +5430,6 @@ function constructClassInstance(ctor, props, maskedLegacyContext) {

if (typeof contextType === 'object' && contextType !== null) {
context = readContext$1(contextType);
} else {
context = maskedLegacyContext;
}

const instance = new ctor(props, context);
Expand Down Expand Up @@ -5501,7 +5508,7 @@ function mountClassInstance(instance, ctor, newProps, maskedLegacyContext) {
if (typeof contextType === 'object' && contextType !== null) {
instance.context = readContext$1(contextType);
} else {
instance.context = maskedLegacyContext;
instance.context = emptyContextObject;
}

const getDerivedStateFromProps = ctor.getDerivedStateFromProps;
Expand Down Expand Up @@ -6274,7 +6281,7 @@ function useFormState(action, initialState, permalink) {
};
}

return [state, dispatch];
return [state, dispatch, false];
} else {
// This is not a server action, so the implementation is much simpler.
// Bind the state to the first argument of the action.
Expand All @@ -6284,7 +6291,7 @@ function useFormState(action, initialState, permalink) {
boundAction(payload);
};

return [initialState, dispatch];
return [initialState, dispatch, false];
}
}

Expand Down Expand Up @@ -6725,7 +6732,6 @@ function defaultErrorHandler(error) {
function noop() {}

function createRequest(children, resumableState, renderState, rootFormatContext, progressiveChunkSize, onError, onAllReady, onShellReady, onShellError, onFatalError, onPostpone, formState) {
prepareHostDispatcher();
const pingedTasks = [];
const abortSet = new Set();
const request = {
Expand Down Expand Up @@ -7253,19 +7259,6 @@ function renderWithHooks(request, task, keyPath, Component, props, secondArg) {
function finishClassComponent(request, task, keyPath, instance, Component, props) {
const nextChildren = instance.render();

{
const childContextTypes = Component.childContextTypes;

if (childContextTypes !== null && childContextTypes !== undefined) {
const previousContext = task.legacyContext;
const mergedContext = processChildContext(instance, Component, previousContext, childContextTypes);
task.legacyContext = mergedContext;
renderNodeDestructive(request, task, nextChildren, -1);
task.legacyContext = previousContext;
return;
}
}

const prevKeyPath = task.keyPath;
task.keyPath = keyPath;
renderNodeDestructive(request, task, nextChildren, -1);
Expand All @@ -7275,21 +7268,17 @@ function finishClassComponent(request, task, keyPath, instance, Component, props
function renderClassComponent(request, task, keyPath, Component, props) {
const previousComponentStack = task.componentStack;
task.componentStack = createClassComponentStack(task, Component);
const maskedContext = getMaskedContext(Component, task.legacyContext) ;
const instance = constructClassInstance(Component, props, maskedContext);
const maskedContext = undefined;
const instance = constructClassInstance(Component, props);
mountClassInstance(instance, Component, props, maskedContext);
finishClassComponent(request, task, keyPath, instance, Component);
finishClassComponent(request, task, keyPath, instance);
task.componentStack = previousComponentStack;
}
// components for some reason.

function renderIndeterminateComponent(request, task, keyPath, Component, props) {
let legacyContext;

{
legacyContext = getMaskedContext(Component, task.legacyContext);
}

const previousComponentStack = task.componentStack;
task.componentStack = createFunctionComponentStack(task, Component);

Expand All @@ -7303,7 +7292,7 @@ function renderIndeterminateComponent(request, task, keyPath, Component, props)
typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {

mountClassInstance(value, Component, props, legacyContext);
finishClassComponent(request, task, keyPath, value, Component);
finishClassComponent(request, task, keyPath, value);
} else {

finishFunctionComponent(request, task, keyPath, value, hasId, formStateCount, formStateMatchingIndex);
Expand Down Expand Up @@ -7847,7 +7836,7 @@ function renderNodeDestructive(request, task, node, childIndex) {
return;
}

if (typeof node === 'number') {
if (typeof node === 'number' || typeof node === 'bigint') {
const segment = task.blockedSegment;

if (segment === null) ; else {
Expand Down
Loading
Loading