mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Ship diffInCommitPhase (#27409)
Performance tests at Meta showed neutral results.
DiffTrain build for [7f6201889e](https://github.com/facebook/react/commit/7f6201889e8e628eeb53e05d8850ddffa3c2e74a)
This commit is contained in:
@@ -1 +1 @@
|
||||
d9e00f795b77676fb14f2a3c6f421f48f73bec2a
|
||||
7f6201889e8e628eeb53e05d8850ddffa3c2e74a
|
||||
|
||||
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-2c91e2cd";
|
||||
var ReactVersion = "18.3.0-www-classic-2db55f27";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
@@ -623,4 +623,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactCurrentDispatcher.current.useTransition();
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-1613cb4a";
|
||||
exports.version = "18.3.0-www-classic-04278c02";
|
||||
|
||||
@@ -615,4 +615,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactCurrentDispatcher.current.useTransition();
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-a19b7375";
|
||||
exports.version = "18.3.0-www-modern-ee02aecb";
|
||||
|
||||
@@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactCurrentDispatcher.current.useTransition();
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-c5b7407c";
|
||||
exports.version = "18.3.0-www-classic-f0c12329";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
@@ -626,7 +626,7 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactCurrentDispatcher.current.useTransition();
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-4c57bafd";
|
||||
exports.version = "18.3.0-www-modern-957e7028";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-1613cb4a";
|
||||
var ReactVersion = "18.3.0-www-classic-04278c02";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -175,7 +175,6 @@ var replayFailedUnitOfWorkWithInvokeGuardedCallback =
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
@@ -2534,11 +2533,9 @@ var suspendResource = shim;
|
||||
|
||||
var pooledTransform = new Transform();
|
||||
var NO_CONTEXT = {};
|
||||
var UPDATE_SIGNAL = {};
|
||||
|
||||
{
|
||||
Object.freeze(NO_CONTEXT);
|
||||
Object.freeze(UPDATE_SIGNAL);
|
||||
}
|
||||
/** Helper Methods */
|
||||
|
||||
@@ -2819,9 +2816,6 @@ function prepareForCommit() {
|
||||
// Noop
|
||||
return null;
|
||||
}
|
||||
function prepareUpdate(domElement, type, oldProps, newProps) {
|
||||
return UPDATE_SIGNAL;
|
||||
}
|
||||
function resetTextContent(domElement) {
|
||||
// Noop
|
||||
}
|
||||
@@ -18213,22 +18207,7 @@ function updateHostComponent(
|
||||
return;
|
||||
}
|
||||
|
||||
if (diffInCommitPhase) {
|
||||
markUpdate(workInProgress);
|
||||
} else {
|
||||
// component is hitting the resume path. Figure out why. Possibly
|
||||
// related to `hidden`.
|
||||
|
||||
getHostContext();
|
||||
var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component.
|
||||
|
||||
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
|
||||
// is a new ref we mark this as an update. All the work is done in commitWork.
|
||||
|
||||
if (updatePayload) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
}
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} // This function must be called at the very end of the complete phase, because
|
||||
// it might throw to suspend, and if the resource immediately loads, the work
|
||||
@@ -18713,11 +18692,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
if (_wasHydrated2) {
|
||||
// TODO: Move this and createInstance step into the beginPhase
|
||||
// to consolidate.
|
||||
if (prepareToHydrateHostInstance()) {
|
||||
// If changes to the hydrated node need to be applied at the
|
||||
// commit-phase we mark this as such.
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
prepareToHydrateHostInstance();
|
||||
} else {
|
||||
getRootHostContainer();
|
||||
|
||||
@@ -21856,23 +21831,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var _updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (_updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-d6fa9db4";
|
||||
var ReactVersion = "18.3.0-www-modern-a4447545";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -175,7 +175,6 @@ var replayFailedUnitOfWorkWithInvokeGuardedCallback =
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
@@ -2531,11 +2530,9 @@ var suspendResource = shim;
|
||||
|
||||
var pooledTransform = new Transform();
|
||||
var NO_CONTEXT = {};
|
||||
var UPDATE_SIGNAL = {};
|
||||
|
||||
{
|
||||
Object.freeze(NO_CONTEXT);
|
||||
Object.freeze(UPDATE_SIGNAL);
|
||||
}
|
||||
/** Helper Methods */
|
||||
|
||||
@@ -2816,9 +2813,6 @@ function prepareForCommit() {
|
||||
// Noop
|
||||
return null;
|
||||
}
|
||||
function prepareUpdate(domElement, type, oldProps, newProps) {
|
||||
return UPDATE_SIGNAL;
|
||||
}
|
||||
function resetTextContent(domElement) {
|
||||
// Noop
|
||||
}
|
||||
@@ -17907,22 +17901,7 @@ function updateHostComponent(
|
||||
return;
|
||||
}
|
||||
|
||||
if (diffInCommitPhase) {
|
||||
markUpdate(workInProgress);
|
||||
} else {
|
||||
// component is hitting the resume path. Figure out why. Possibly
|
||||
// related to `hidden`.
|
||||
|
||||
getHostContext();
|
||||
var updatePayload = prepareUpdate(); // TODO: Type this specific to this type of component.
|
||||
|
||||
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
|
||||
// is a new ref we mark this as an update. All the work is done in commitWork.
|
||||
|
||||
if (updatePayload) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
}
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} // This function must be called at the very end of the complete phase, because
|
||||
// it might throw to suspend, and if the resource immediately loads, the work
|
||||
@@ -18400,11 +18379,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
if (_wasHydrated2) {
|
||||
// TODO: Move this and createInstance step into the beginPhase
|
||||
// to consolidate.
|
||||
if (prepareToHydrateHostInstance()) {
|
||||
// If changes to the hydrated node need to be applied at the
|
||||
// commit-phase we mark this as such.
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
prepareToHydrateHostInstance();
|
||||
} else {
|
||||
getRootHostContainer();
|
||||
|
||||
@@ -21521,23 +21496,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var _updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (_updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ var ReactSharedInternals =
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
@@ -644,8 +643,7 @@ function shim$1() {
|
||||
throw Error(formatProdErrorMessage(357));
|
||||
}
|
||||
var pooledTransform = new Transform(),
|
||||
NO_CONTEXT = {},
|
||||
UPDATE_SIGNAL = {};
|
||||
NO_CONTEXT = {};
|
||||
function createEventHandler(instance) {
|
||||
return function (event) {
|
||||
var listener = instance._listeners[event.type];
|
||||
@@ -5572,9 +5570,6 @@ function getChildContextValues(context) {
|
||||
collectNearestChildContextValues(currentFiber, context, childContextValues);
|
||||
return childContextValues;
|
||||
}
|
||||
function markUpdate(workInProgress) {
|
||||
workInProgress.flags |= 4;
|
||||
}
|
||||
function scheduleRetryEffect(workInProgress, retryQueue) {
|
||||
null !== retryQueue
|
||||
? (workInProgress.flags |= 4)
|
||||
@@ -5692,11 +5687,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
popHostContext(workInProgress);
|
||||
renderLanes = workInProgress.type;
|
||||
if (null !== current && null != workInProgress.stateNode)
|
||||
current.memoizedProps !== newProps &&
|
||||
(diffInCommitPhase
|
||||
? markUpdate(workInProgress)
|
||||
: (workInProgress.updateQueue = UPDATE_SIGNAL) &&
|
||||
markUpdate(workInProgress)),
|
||||
current.memoizedProps !== newProps && (workInProgress.flags |= 4),
|
||||
current.ref !== workInProgress.ref &&
|
||||
(workInProgress.flags |= 2097664);
|
||||
else {
|
||||
@@ -5763,7 +5754,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
return null;
|
||||
case 6:
|
||||
if (current && null != workInProgress.stateNode)
|
||||
current.memoizedProps !== newProps && markUpdate(workInProgress);
|
||||
current.memoizedProps !== newProps && (workInProgress.flags |= 4);
|
||||
else {
|
||||
if ("string" !== typeof newProps && null === workInProgress.stateNode)
|
||||
throw Error(formatProdErrorMessage(166));
|
||||
@@ -5933,8 +5924,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
}),
|
||||
shim$1(),
|
||||
null !== workInProgress.ref &&
|
||||
((workInProgress.flags |= 2097664), markUpdate(workInProgress)))
|
||||
: (null !== workInProgress.ref && markUpdate(workInProgress),
|
||||
((workInProgress.flags |= 2097664), (workInProgress.flags |= 4)))
|
||||
: (null !== workInProgress.ref && (workInProgress.flags |= 4),
|
||||
current.ref !== workInProgress.ref &&
|
||||
(workInProgress.flags |= 2097664)),
|
||||
bubbleProperties(workInProgress),
|
||||
@@ -6997,18 +6988,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) {
|
||||
var newProps = finishedWork.memoizedProps;
|
||||
current = null !== current ? current.memoizedProps : newProps;
|
||||
var updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
if (null !== updatePayload || diffInCommitPhase)
|
||||
try {
|
||||
flags._applyProps(flags, newProps, current);
|
||||
} catch (error$108) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$108
|
||||
);
|
||||
}
|
||||
try {
|
||||
flags._applyProps(flags, newProps, current);
|
||||
} catch (error$108) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$108);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
@@ -7093,13 +7078,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
if (null === current) {
|
||||
current = root;
|
||||
try {
|
||||
(newProps = root.stateNode),
|
||||
suspenseCallback
|
||||
? newProps.hide()
|
||||
: ((updatePayload = root.memoizedProps),
|
||||
(null == updatePayload.visible ||
|
||||
updatePayload.visible) &&
|
||||
root.stateNode.show());
|
||||
if (((newProps = root.stateNode), suspenseCallback))
|
||||
newProps.hide();
|
||||
else {
|
||||
var props = root.memoizedProps;
|
||||
(null == props.visible || props.visible) &&
|
||||
root.stateNode.show();
|
||||
}
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
@@ -10112,19 +10097,19 @@ var slice = Array.prototype.slice,
|
||||
};
|
||||
return Text;
|
||||
})(React.Component),
|
||||
devToolsConfig$jscomp$inline_1130 = {
|
||||
devToolsConfig$jscomp$inline_1128 = {
|
||||
findFiberByHostInstance: function () {
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-c5b7407c",
|
||||
version: "18.3.0-www-classic-f0c12329",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1303 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1130.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1130.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1130.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1130.rendererConfig,
|
||||
var internals$jscomp$inline_1301 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1128.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1128.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1128.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1128.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -10141,26 +10126,26 @@ var internals$jscomp$inline_1303 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1130.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1128.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-classic-c5b7407c"
|
||||
reconcilerVersion: "18.3.0-www-classic-f0c12329"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1304 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1302 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1304.isDisabled &&
|
||||
hook$jscomp$inline_1304.supportsFiber
|
||||
!hook$jscomp$inline_1302.isDisabled &&
|
||||
hook$jscomp$inline_1302.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1304.inject(
|
||||
internals$jscomp$inline_1303
|
||||
(rendererID = hook$jscomp$inline_1302.inject(
|
||||
internals$jscomp$inline_1301
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1304);
|
||||
(injectedHook = hook$jscomp$inline_1302);
|
||||
} catch (err) {}
|
||||
}
|
||||
var Path = Mode$1.Path;
|
||||
|
||||
@@ -71,7 +71,6 @@ var ReactSharedInternals =
|
||||
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
@@ -528,8 +527,7 @@ function shim$1() {
|
||||
throw Error(formatProdErrorMessage(357));
|
||||
}
|
||||
var pooledTransform = new Transform(),
|
||||
NO_CONTEXT = {},
|
||||
UPDATE_SIGNAL = {};
|
||||
NO_CONTEXT = {};
|
||||
function createEventHandler(instance) {
|
||||
return function (event) {
|
||||
var listener = instance._listeners[event.type];
|
||||
@@ -5327,9 +5325,6 @@ function getChildContextValues(context) {
|
||||
collectNearestChildContextValues(currentFiber, context, childContextValues);
|
||||
return childContextValues;
|
||||
}
|
||||
function markUpdate(workInProgress) {
|
||||
workInProgress.flags |= 4;
|
||||
}
|
||||
function scheduleRetryEffect(workInProgress, retryQueue) {
|
||||
null !== retryQueue
|
||||
? (workInProgress.flags |= 4)
|
||||
@@ -5441,11 +5436,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
popHostContext(workInProgress);
|
||||
renderLanes = workInProgress.type;
|
||||
if (null !== current && null != workInProgress.stateNode)
|
||||
current.memoizedProps !== newProps &&
|
||||
(diffInCommitPhase
|
||||
? markUpdate(workInProgress)
|
||||
: (workInProgress.updateQueue = UPDATE_SIGNAL) &&
|
||||
markUpdate(workInProgress)),
|
||||
current.memoizedProps !== newProps && (workInProgress.flags |= 4),
|
||||
current.ref !== workInProgress.ref &&
|
||||
(workInProgress.flags |= 2097664);
|
||||
else {
|
||||
@@ -5512,7 +5503,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
return null;
|
||||
case 6:
|
||||
if (current && null != workInProgress.stateNode)
|
||||
current.memoizedProps !== newProps && markUpdate(workInProgress);
|
||||
current.memoizedProps !== newProps && (workInProgress.flags |= 4);
|
||||
else {
|
||||
if ("string" !== typeof newProps && null === workInProgress.stateNode)
|
||||
throw Error(formatProdErrorMessage(166));
|
||||
@@ -5678,8 +5669,8 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
}),
|
||||
shim$1(),
|
||||
null !== workInProgress.ref &&
|
||||
((workInProgress.flags |= 2097664), markUpdate(workInProgress)))
|
||||
: (null !== workInProgress.ref && markUpdate(workInProgress),
|
||||
((workInProgress.flags |= 2097664), (workInProgress.flags |= 4)))
|
||||
: (null !== workInProgress.ref && (workInProgress.flags |= 4),
|
||||
current.ref !== workInProgress.ref &&
|
||||
(workInProgress.flags |= 2097664)),
|
||||
bubbleProperties(workInProgress),
|
||||
@@ -6733,18 +6724,12 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
if (flags & 4 && ((flags = finishedWork.stateNode), null != flags)) {
|
||||
var newProps = finishedWork.memoizedProps;
|
||||
current = null !== current ? current.memoizedProps : newProps;
|
||||
var updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
if (null !== updatePayload || diffInCommitPhase)
|
||||
try {
|
||||
flags._applyProps(flags, newProps, current);
|
||||
} catch (error$107) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error$107
|
||||
);
|
||||
}
|
||||
try {
|
||||
flags._applyProps(flags, newProps, current);
|
||||
} catch (error$107) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error$107);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
@@ -6829,13 +6814,13 @@ function commitMutationEffectsOnFiber(finishedWork, root) {
|
||||
if (null === current) {
|
||||
current = root;
|
||||
try {
|
||||
(newProps = root.stateNode),
|
||||
suspenseCallback
|
||||
? newProps.hide()
|
||||
: ((updatePayload = root.memoizedProps),
|
||||
(null == updatePayload.visible ||
|
||||
updatePayload.visible) &&
|
||||
root.stateNode.show());
|
||||
if (((newProps = root.stateNode), suspenseCallback))
|
||||
newProps.hide();
|
||||
else {
|
||||
var props = root.memoizedProps;
|
||||
(null == props.visible || props.visible) &&
|
||||
root.stateNode.show();
|
||||
}
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
@@ -9777,19 +9762,19 @@ var slice = Array.prototype.slice,
|
||||
};
|
||||
return Text;
|
||||
})(React.Component),
|
||||
devToolsConfig$jscomp$inline_1110 = {
|
||||
devToolsConfig$jscomp$inline_1108 = {
|
||||
findFiberByHostInstance: function () {
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-06894e4c",
|
||||
version: "18.3.0-www-modern-6b7c4026",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1283 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1110.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1110.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1110.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1110.rendererConfig,
|
||||
var internals$jscomp$inline_1281 = {
|
||||
bundleType: devToolsConfig$jscomp$inline_1108.bundleType,
|
||||
version: devToolsConfig$jscomp$inline_1108.version,
|
||||
rendererPackageName: devToolsConfig$jscomp$inline_1108.rendererPackageName,
|
||||
rendererConfig: devToolsConfig$jscomp$inline_1108.rendererConfig,
|
||||
overrideHookState: null,
|
||||
overrideHookStateDeletePath: null,
|
||||
overrideHookStateRenamePath: null,
|
||||
@@ -9806,26 +9791,26 @@ var internals$jscomp$inline_1283 = {
|
||||
return null === fiber ? null : fiber.stateNode;
|
||||
},
|
||||
findFiberByHostInstance:
|
||||
devToolsConfig$jscomp$inline_1110.findFiberByHostInstance ||
|
||||
devToolsConfig$jscomp$inline_1108.findFiberByHostInstance ||
|
||||
emptyFindFiberByHostInstance,
|
||||
findHostInstancesForRefresh: null,
|
||||
scheduleRefresh: null,
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-www-modern-06894e4c"
|
||||
reconcilerVersion: "18.3.0-www-modern-6b7c4026"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1284 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
var hook$jscomp$inline_1282 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
if (
|
||||
!hook$jscomp$inline_1284.isDisabled &&
|
||||
hook$jscomp$inline_1284.supportsFiber
|
||||
!hook$jscomp$inline_1282.isDisabled &&
|
||||
hook$jscomp$inline_1282.supportsFiber
|
||||
)
|
||||
try {
|
||||
(rendererID = hook$jscomp$inline_1284.inject(
|
||||
internals$jscomp$inline_1283
|
||||
(rendererID = hook$jscomp$inline_1282.inject(
|
||||
internals$jscomp$inline_1281
|
||||
)),
|
||||
(injectedHook = hook$jscomp$inline_1284);
|
||||
(injectedHook = hook$jscomp$inline_1282);
|
||||
} catch (err) {}
|
||||
}
|
||||
var Path = Mode$1.Path;
|
||||
|
||||
@@ -142,7 +142,6 @@ var disableInputAttributeSyncing =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
@@ -5624,7 +5623,7 @@ function setValueForStyles(node, styles, prevStyles) {
|
||||
|
||||
var style = node.style;
|
||||
|
||||
if (diffInCommitPhase && prevStyles != null) {
|
||||
if (prevStyles != null) {
|
||||
{
|
||||
validateShorthandPropertyCollisionInDev(prevStyles, styles);
|
||||
}
|
||||
@@ -8382,25 +8381,14 @@ function tryToClaimNextHydratableSuspenseInstance(fiber) {
|
||||
function prepareToHydrateHostInstance(fiber, hostContext) {
|
||||
var instance = fiber.stateNode;
|
||||
var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
|
||||
var updatePayload = hydrateInstance(
|
||||
hydrateInstance(
|
||||
instance,
|
||||
fiber.type,
|
||||
fiber.memoizedProps,
|
||||
hostContext,
|
||||
fiber,
|
||||
shouldWarnIfMismatchDev
|
||||
); // TODO: Type this specific to this type of component.
|
||||
|
||||
if (!diffInCommitPhase) {
|
||||
fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
|
||||
// is a new ref we mark this as an update.
|
||||
|
||||
if (updatePayload !== null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
);
|
||||
}
|
||||
|
||||
function prepareToHydrateHostTextInstance(fiber) {
|
||||
@@ -23090,27 +23078,7 @@ function updateHostComponent(
|
||||
return;
|
||||
}
|
||||
|
||||
if (diffInCommitPhase) {
|
||||
markUpdate(workInProgress);
|
||||
} else {
|
||||
// If we get updated because one of our children updated, we don't
|
||||
// have newProps so we'll have to reuse them.
|
||||
// TODO: Split the update API as separate for the props vs. children.
|
||||
// Even better would be if children weren't special cased at all tho.
|
||||
var instance = workInProgress.stateNode; // TODO: Experiencing an error where oldProps is null. Suggests a host
|
||||
// component is hitting the resume path. Figure out why. Possibly
|
||||
// related to `hidden`.
|
||||
|
||||
getHostContext();
|
||||
var updatePayload = prepareUpdate(instance, type, oldProps, newProps); // TODO: Type this specific to this type of component.
|
||||
|
||||
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
|
||||
// is a new ref we mark this as an update. All the work is done in commitWork.
|
||||
|
||||
if (updatePayload) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
}
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} // This function must be called at the very end of the complete phase, because
|
||||
// it might throw to suspend, and if the resource immediately loads, the work
|
||||
@@ -23616,10 +23584,6 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
|
||||
case HostHoistable: {
|
||||
{
|
||||
// The branching here is more complicated than you might expect because
|
||||
// a HostHoistable sometimes corresponds to a Resource and sometimes
|
||||
// corresponds to an Instance. It can also switch during an update.
|
||||
var type = workInProgress.type;
|
||||
var nextResource = workInProgress.memoizedState;
|
||||
|
||||
if (current === null) {
|
||||
@@ -23674,16 +23638,12 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
} else {
|
||||
// This is a Hoistable Instance
|
||||
// We may have props to update on the Hoistable instance.
|
||||
if (diffInCommitPhase && supportsMutation) {
|
||||
{
|
||||
var oldProps = current.memoizedProps;
|
||||
|
||||
if (oldProps !== newProps) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} else {
|
||||
// We use the updateHostComponent path becuase it produces
|
||||
// the update queue we need for Hoistables.
|
||||
updateHostComponent(current, workInProgress, type, newProps);
|
||||
} // This must come at the very end of the complete phase.
|
||||
|
||||
bubbleProperties(workInProgress);
|
||||
@@ -23701,14 +23661,12 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
var _type = workInProgress.type;
|
||||
|
||||
if (current !== null && workInProgress.stateNode != null) {
|
||||
if (diffInCommitPhase && supportsMutation) {
|
||||
{
|
||||
var _oldProps2 = current.memoizedProps;
|
||||
|
||||
if (_oldProps2 !== newProps) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} else {
|
||||
updateHostComponent(current, workInProgress, _type, newProps);
|
||||
}
|
||||
|
||||
if (current.ref !== workInProgress.ref) {
|
||||
@@ -23785,7 +23743,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var _currentHostContext2 = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
var _currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
// "stack" as the parent. Then append children as we go in beginWork
|
||||
// or completeWork depending on whether we want to add them top->down or
|
||||
// bottom->up. Top->down is faster in IE11.
|
||||
@@ -23795,13 +23753,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
if (_wasHydrated2) {
|
||||
// TODO: Move this and createInstance step into the beginPhase
|
||||
// to consolidate.
|
||||
if (
|
||||
prepareToHydrateHostInstance(workInProgress, _currentHostContext2)
|
||||
) {
|
||||
// If changes to the hydrated node need to be applied at the
|
||||
// commit-phase we mark this as such.
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
prepareToHydrateHostInstance(workInProgress, _currentHostContext);
|
||||
} else {
|
||||
var _rootContainerInstance = getRootHostContainer();
|
||||
|
||||
@@ -23809,7 +23761,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
_type2,
|
||||
newProps,
|
||||
_rootContainerInstance,
|
||||
_currentHostContext2,
|
||||
_currentHostContext,
|
||||
workInProgress
|
||||
);
|
||||
|
||||
@@ -23858,7 +23810,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
|
||||
var _rootContainerInstance2 = getRootHostContainer();
|
||||
|
||||
var _currentHostContext3 = getHostContext();
|
||||
var _currentHostContext2 = getHostContext();
|
||||
|
||||
var _wasHydrated3 = popHydrationState(workInProgress);
|
||||
|
||||
@@ -23870,7 +23822,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
workInProgress.stateNode = createTextInstance(
|
||||
newText,
|
||||
_rootContainerInstance2,
|
||||
_currentHostContext3,
|
||||
_currentHostContext2,
|
||||
workInProgress
|
||||
);
|
||||
}
|
||||
@@ -27194,23 +27146,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
finishedWork.stateNode,
|
||||
updatePayload,
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.memoizedProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
finishedWork.stateNode,
|
||||
updatePayload,
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.memoizedProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27282,23 +27228,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var _updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (_updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34021,7 +33961,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-bfae45bc";
|
||||
var ReactVersion = "18.3.0-www-classic-37c737b8";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -39621,128 +39561,6 @@ function setInitialProperties(domElement, tag, props) {
|
||||
|
||||
setProp(domElement, tag, _propKey6, _propValue6, props, null);
|
||||
}
|
||||
} // Calculate the diff between the two objects.
|
||||
|
||||
function diffProperties(domElement, tag, lastProps, nextProps) {
|
||||
{
|
||||
validatePropertiesInDevelopment(tag, nextProps);
|
||||
}
|
||||
|
||||
var updatePayload = null;
|
||||
var propKey;
|
||||
var styleName;
|
||||
var styleUpdates = null;
|
||||
|
||||
for (propKey in lastProps) {
|
||||
if (
|
||||
nextProps.hasOwnProperty(propKey) ||
|
||||
!lastProps.hasOwnProperty(propKey) ||
|
||||
lastProps[propKey] == null
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (propKey) {
|
||||
case "style": {
|
||||
var lastStyle = lastProps[propKey];
|
||||
|
||||
for (styleName in lastStyle) {
|
||||
if (lastStyle.hasOwnProperty(styleName)) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = "";
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
// For all other deleted properties we add it to the queue. We use
|
||||
// the allowed property list in the commit phase instead.
|
||||
(updatePayload = updatePayload || []).push(propKey, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (propKey in nextProps) {
|
||||
var nextProp = nextProps[propKey];
|
||||
var lastProp = lastProps != null ? lastProps[propKey] : undefined;
|
||||
|
||||
if (
|
||||
nextProps.hasOwnProperty(propKey) &&
|
||||
nextProp !== lastProp &&
|
||||
(nextProp != null || lastProp != null)
|
||||
) {
|
||||
switch (propKey) {
|
||||
case "style": {
|
||||
if (lastProp) {
|
||||
// Unset styles on `lastProp` but not on `nextProp`.
|
||||
for (styleName in lastProp) {
|
||||
if (
|
||||
lastProp.hasOwnProperty(styleName) &&
|
||||
(!nextProp || !nextProp.hasOwnProperty(styleName))
|
||||
) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = "";
|
||||
}
|
||||
} // Update styles that changed since `lastProp`.
|
||||
|
||||
for (styleName in nextProp) {
|
||||
if (
|
||||
nextProp.hasOwnProperty(styleName) &&
|
||||
lastProp[styleName] !== nextProp[styleName]
|
||||
) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = nextProp[styleName];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Relies on `updateStylesByID` not mutating `styleUpdates`.
|
||||
if (!styleUpdates) {
|
||||
if (!updatePayload) {
|
||||
updatePayload = [];
|
||||
}
|
||||
|
||||
updatePayload.push(propKey, styleUpdates);
|
||||
}
|
||||
|
||||
styleUpdates = nextProp;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "is": {
|
||||
error('Cannot update the "is" prop after it has been initialized.');
|
||||
}
|
||||
|
||||
// Fall through
|
||||
|
||||
default: {
|
||||
(updatePayload = updatePayload || []).push(propKey, nextProp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (styleUpdates) {
|
||||
{
|
||||
validateShorthandPropertyCollisionInDev(lastProps.style, nextProps.style);
|
||||
}
|
||||
|
||||
(updatePayload = updatePayload || []).push("style", styleUpdates);
|
||||
}
|
||||
|
||||
return updatePayload;
|
||||
}
|
||||
function updateProperties(domElement, tag, lastProps, nextProps) {
|
||||
{
|
||||
@@ -40291,348 +40109,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
|
||||
setProp(domElement, tag, _propKey19, _nextProp6, nextProps, _lastProp13);
|
||||
}
|
||||
}
|
||||
} // Apply the diff.
|
||||
|
||||
function updatePropertiesWithDiff(
|
||||
domElement,
|
||||
updatePayload,
|
||||
tag,
|
||||
lastProps,
|
||||
nextProps
|
||||
) {
|
||||
switch (tag) {
|
||||
case "div":
|
||||
case "span":
|
||||
case "svg":
|
||||
case "path":
|
||||
case "a":
|
||||
case "g":
|
||||
case "p":
|
||||
case "li": {
|
||||
// Fast track the most common tag types
|
||||
break;
|
||||
}
|
||||
|
||||
case "input": {
|
||||
var name = nextProps.name;
|
||||
var type = nextProps.type;
|
||||
var value = nextProps.value;
|
||||
var defaultValue = nextProps.defaultValue;
|
||||
var lastDefaultValue = lastProps.defaultValue;
|
||||
var checked = nextProps.checked;
|
||||
var defaultChecked = nextProps.defaultChecked;
|
||||
|
||||
for (var i = 0; i < updatePayload.length; i += 2) {
|
||||
var propKey = updatePayload[i];
|
||||
var propValue = updatePayload[i + 1];
|
||||
|
||||
switch (propKey) {
|
||||
case "type": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "name": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "checked": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "defaultChecked": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "value": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "defaultValue": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "children":
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (propValue != null) {
|
||||
throw new Error(
|
||||
tag +
|
||||
" is a void element tag and must neither have `children` nor " +
|
||||
"use `dangerouslySetInnerHTML`."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
propKey,
|
||||
propValue,
|
||||
nextProps,
|
||||
lastProps[propKey]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var wasControlled =
|
||||
lastProps.type === "checkbox" || lastProps.type === "radio"
|
||||
? lastProps.checked != null
|
||||
: lastProps.value != null;
|
||||
var isControlled =
|
||||
nextProps.type === "checkbox" || nextProps.type === "radio"
|
||||
? nextProps.checked != null
|
||||
: nextProps.value != null;
|
||||
|
||||
if (
|
||||
!wasControlled &&
|
||||
isControlled &&
|
||||
!didWarnUncontrolledToControlled
|
||||
) {
|
||||
error(
|
||||
"A component is changing an uncontrolled input to be controlled. " +
|
||||
"This is likely caused by the value changing from undefined to " +
|
||||
"a defined value, which should not happen. " +
|
||||
"Decide between using a controlled or uncontrolled input " +
|
||||
"element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"
|
||||
);
|
||||
|
||||
didWarnUncontrolledToControlled = true;
|
||||
}
|
||||
|
||||
if (
|
||||
wasControlled &&
|
||||
!isControlled &&
|
||||
!didWarnControlledToUncontrolled
|
||||
) {
|
||||
error(
|
||||
"A component is changing a controlled input to be uncontrolled. " +
|
||||
"This is likely caused by the value changing from a defined to " +
|
||||
"undefined, which should not happen. " +
|
||||
"Decide between using a controlled or uncontrolled input " +
|
||||
"element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"
|
||||
);
|
||||
|
||||
didWarnControlledToUncontrolled = true;
|
||||
}
|
||||
} // Update the wrapper around inputs *after* updating props. This has to
|
||||
// happen after updating the rest of props. Otherwise HTML5 input validations
|
||||
// raise warnings and prevent the new value from being assigned.
|
||||
|
||||
updateInput(
|
||||
domElement,
|
||||
value,
|
||||
defaultValue,
|
||||
lastDefaultValue,
|
||||
checked,
|
||||
defaultChecked,
|
||||
type,
|
||||
name
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
case "select": {
|
||||
var _value5 = nextProps.value;
|
||||
var _defaultValue5 = nextProps.defaultValue;
|
||||
var multiple = nextProps.multiple;
|
||||
var wasMultiple = lastProps.multiple;
|
||||
|
||||
for (var _i = 0; _i < updatePayload.length; _i += 2) {
|
||||
var _propKey20 = updatePayload[_i];
|
||||
var _propValue7 = updatePayload[_i + 1];
|
||||
|
||||
switch (_propKey20) {
|
||||
case "value": {
|
||||
// This is handled by updateWrapper below.
|
||||
break;
|
||||
}
|
||||
// defaultValue are ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey20,
|
||||
_propValue7,
|
||||
nextProps,
|
||||
lastProps[_propKey20]
|
||||
);
|
||||
}
|
||||
}
|
||||
} // <select> value update needs to occur after <option> children
|
||||
// reconciliation
|
||||
|
||||
updateSelect(domElement, _value5, _defaultValue5, multiple, wasMultiple);
|
||||
return;
|
||||
}
|
||||
|
||||
case "textarea": {
|
||||
var _value6 = nextProps.value;
|
||||
var _defaultValue6 = nextProps.defaultValue;
|
||||
|
||||
for (var _i2 = 0; _i2 < updatePayload.length; _i2 += 2) {
|
||||
var _propKey21 = updatePayload[_i2];
|
||||
var _propValue8 = updatePayload[_i2 + 1];
|
||||
|
||||
switch (_propKey21) {
|
||||
case "value": {
|
||||
// This is handled by updateWrapper below.
|
||||
break;
|
||||
}
|
||||
|
||||
case "children": {
|
||||
// TODO: This doesn't actually do anything if it updates.
|
||||
break;
|
||||
}
|
||||
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (_propValue8 != null) {
|
||||
// TODO: Do we really need a special error message for this. It's also pretty blunt.
|
||||
throw new Error(
|
||||
"`dangerouslySetInnerHTML` does not make sense on <textarea>."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// defaultValue is ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey21,
|
||||
_propValue8,
|
||||
nextProps,
|
||||
lastProps[_propKey21]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateTextarea(domElement, _value6, _defaultValue6);
|
||||
return;
|
||||
}
|
||||
|
||||
case "option": {
|
||||
for (var _i3 = 0; _i3 < updatePayload.length; _i3 += 2) {
|
||||
var _propKey22 = updatePayload[_i3];
|
||||
var _propValue9 = updatePayload[_i3 + 1];
|
||||
|
||||
switch (_propKey22) {
|
||||
case "selected": {
|
||||
// TODO: Remove support for selected on option.
|
||||
domElement.selected =
|
||||
_propValue9 &&
|
||||
typeof _propValue9 !== "function" &&
|
||||
typeof _propValue9 !== "symbol";
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey22,
|
||||
_propValue9,
|
||||
nextProps,
|
||||
lastProps[_propKey22]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
case "img":
|
||||
case "link":
|
||||
case "area":
|
||||
case "base":
|
||||
case "br":
|
||||
case "col":
|
||||
case "embed":
|
||||
case "hr":
|
||||
case "keygen":
|
||||
case "meta":
|
||||
case "param":
|
||||
case "source":
|
||||
case "track":
|
||||
case "wbr":
|
||||
case "menuitem": {
|
||||
// Void elements
|
||||
for (var _i4 = 0; _i4 < updatePayload.length; _i4 += 2) {
|
||||
var _propKey23 = updatePayload[_i4];
|
||||
var _propValue10 = updatePayload[_i4 + 1];
|
||||
|
||||
switch (_propKey23) {
|
||||
case "children":
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (_propValue10 != null) {
|
||||
// TODO: Can we make this a DEV warning to avoid this deny list?
|
||||
throw new Error(
|
||||
tag +
|
||||
" is a void element tag and must neither have `children` nor " +
|
||||
"use `dangerouslySetInnerHTML`."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// defaultChecked and defaultValue are ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey23,
|
||||
_propValue10,
|
||||
nextProps,
|
||||
lastProps[_propKey23]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
default: {
|
||||
if (isCustomElement(tag)) {
|
||||
for (var _i5 = 0; _i5 < updatePayload.length; _i5 += 2) {
|
||||
var _propKey24 = updatePayload[_i5];
|
||||
var _propValue11 = updatePayload[_i5 + 1];
|
||||
setPropOnCustomElement(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey24,
|
||||
_propValue11,
|
||||
nextProps,
|
||||
lastProps[_propKey24]
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
} // Apply the diff.
|
||||
|
||||
for (var _i6 = 0; _i6 < updatePayload.length; _i6 += 2) {
|
||||
var _propKey25 = updatePayload[_i6];
|
||||
var _propValue12 = updatePayload[_i6 + 1];
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey25,
|
||||
_propValue12,
|
||||
nextProps,
|
||||
lastProps[_propKey25]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function getPossibleStandardName(propName) {
|
||||
@@ -41668,7 +41144,6 @@ function diffHydratedProperties(
|
||||
break;
|
||||
}
|
||||
|
||||
var updatePayload = null;
|
||||
var children = props.children; // For text content children we compare against textContent. This
|
||||
// might match additional HTML that is hidden when we read it using
|
||||
// textContent. E.g. "foo" will match "f<span>oo</span>" but that still
|
||||
@@ -41691,17 +41166,13 @@ function diffHydratedProperties(
|
||||
}
|
||||
|
||||
if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) {
|
||||
if (diffInCommitPhase) {
|
||||
// We really should be patching this in the commit phase but since
|
||||
// this only affects legacy mode hydration which is deprecated anyway
|
||||
// we can get away with it.
|
||||
// Host singletons get their children appended and don't use the text
|
||||
// content mechanism.
|
||||
if (tag !== "body") {
|
||||
domElement.textContent = children;
|
||||
}
|
||||
} else {
|
||||
updatePayload = ["children", children];
|
||||
// We really should be patching this in the commit phase but since
|
||||
// this only affects legacy mode hydration which is deprecated anyway
|
||||
// we can get away with it.
|
||||
// Host singletons get their children appended and don't use the text
|
||||
// content mechanism.
|
||||
if (tag !== "body") {
|
||||
domElement.textContent = children;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41720,8 +41191,8 @@ function diffHydratedProperties(
|
||||
var extraAttributes = new Set();
|
||||
var attributes = domElement.attributes;
|
||||
|
||||
for (var _i7 = 0; _i7 < attributes.length; _i7++) {
|
||||
var name = attributes[_i7].name.toLowerCase();
|
||||
for (var _i = 0; _i < attributes.length; _i++) {
|
||||
var name = attributes[_i].name.toLowerCase();
|
||||
|
||||
switch (name) {
|
||||
// Controlled attributes are not validated
|
||||
@@ -41738,7 +41209,7 @@ function diffHydratedProperties(
|
||||
default:
|
||||
// Intentionally use the original name.
|
||||
// See discussion in https://github.com/facebook/react/pull/10676.
|
||||
extraAttributes.add(attributes[_i7].name);
|
||||
extraAttributes.add(attributes[_i].name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41764,8 +41235,6 @@ function diffHydratedProperties(
|
||||
warnForExtraAttributes(extraAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
return updatePayload;
|
||||
}
|
||||
function diffHydratedText(textNode, text, isConcurrentMode) {
|
||||
var isDifferent = textNode.nodeValue !== text;
|
||||
@@ -42274,14 +41743,6 @@ function finalizeInitialChildren(domElement, type, props, hostContext) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function prepareUpdate(domElement, type, oldProps, newProps, hostContext) {
|
||||
if (diffInCommitPhase) {
|
||||
// TODO: Figure out how to validateDOMNesting when children turn into a string.
|
||||
return null;
|
||||
}
|
||||
|
||||
return diffProperties(domElement, type, oldProps, newProps);
|
||||
}
|
||||
function shouldSetTextContent(type, props) {
|
||||
return (
|
||||
type === "textarea" ||
|
||||
@@ -42371,10 +41832,6 @@ function handleErrorInNextTick(error) {
|
||||
throw error;
|
||||
});
|
||||
} // -------------------
|
||||
// Mutation
|
||||
// -------------------
|
||||
|
||||
var supportsMutation = true;
|
||||
function commitMount(domElement, type, newProps, internalInstanceHandle) {
|
||||
// Despite the naming that might imply otherwise, this method only
|
||||
// fires if there is an `Update` effect scheduled during mounting.
|
||||
@@ -42410,19 +41867,8 @@ function commitUpdate(
|
||||
newProps,
|
||||
internalInstanceHandle
|
||||
) {
|
||||
if (diffInCommitPhase) {
|
||||
// Diff and update the properties.
|
||||
updateProperties(domElement, type, oldProps, newProps);
|
||||
} else {
|
||||
// Apply the diff to the DOM node.
|
||||
updatePropertiesWithDiff(
|
||||
domElement,
|
||||
updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps
|
||||
);
|
||||
} // Update the props handle so that we know which props are the ones with
|
||||
// Diff and update the properties.
|
||||
updateProperties(domElement, type, oldProps, newProps); // Update the props handle so that we know which props are the ones with
|
||||
// with current event handlers.
|
||||
|
||||
updateFiberProps(domElement, newProps);
|
||||
@@ -42933,7 +42379,7 @@ function hydrateInstance(
|
||||
|
||||
var isConcurrentMode =
|
||||
(internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
|
||||
return diffHydratedProperties(
|
||||
diffHydratedProperties(
|
||||
instance,
|
||||
type,
|
||||
props,
|
||||
|
||||
@@ -128,7 +128,6 @@ var disableInputAttributeSyncing =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
@@ -5446,7 +5445,7 @@ function setValueForStyles(node, styles, prevStyles) {
|
||||
|
||||
var style = node.style;
|
||||
|
||||
if (diffInCommitPhase && prevStyles != null) {
|
||||
if (prevStyles != null) {
|
||||
{
|
||||
validateShorthandPropertyCollisionInDev(prevStyles, styles);
|
||||
}
|
||||
@@ -8323,25 +8322,14 @@ function tryToClaimNextHydratableSuspenseInstance(fiber) {
|
||||
function prepareToHydrateHostInstance(fiber, hostContext) {
|
||||
var instance = fiber.stateNode;
|
||||
var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
|
||||
var updatePayload = hydrateInstance(
|
||||
hydrateInstance(
|
||||
instance,
|
||||
fiber.type,
|
||||
fiber.memoizedProps,
|
||||
hostContext,
|
||||
fiber,
|
||||
shouldWarnIfMismatchDev
|
||||
); // TODO: Type this specific to this type of component.
|
||||
|
||||
if (!diffInCommitPhase) {
|
||||
fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
|
||||
// is a new ref we mark this as an update.
|
||||
|
||||
if (updatePayload !== null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
);
|
||||
}
|
||||
|
||||
function prepareToHydrateHostTextInstance(fiber) {
|
||||
@@ -22969,27 +22957,7 @@ function updateHostComponent(
|
||||
return;
|
||||
}
|
||||
|
||||
if (diffInCommitPhase) {
|
||||
markUpdate(workInProgress);
|
||||
} else {
|
||||
// If we get updated because one of our children updated, we don't
|
||||
// have newProps so we'll have to reuse them.
|
||||
// TODO: Split the update API as separate for the props vs. children.
|
||||
// Even better would be if children weren't special cased at all tho.
|
||||
var instance = workInProgress.stateNode; // TODO: Experiencing an error where oldProps is null. Suggests a host
|
||||
// component is hitting the resume path. Figure out why. Possibly
|
||||
// related to `hidden`.
|
||||
|
||||
getHostContext();
|
||||
var updatePayload = prepareUpdate(instance, type, oldProps, newProps); // TODO: Type this specific to this type of component.
|
||||
|
||||
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
|
||||
// is a new ref we mark this as an update. All the work is done in commitWork.
|
||||
|
||||
if (updatePayload) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
}
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} // This function must be called at the very end of the complete phase, because
|
||||
// it might throw to suspend, and if the resource immediately loads, the work
|
||||
@@ -23488,10 +23456,6 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
|
||||
case HostHoistable: {
|
||||
{
|
||||
// The branching here is more complicated than you might expect because
|
||||
// a HostHoistable sometimes corresponds to a Resource and sometimes
|
||||
// corresponds to an Instance. It can also switch during an update.
|
||||
var type = workInProgress.type;
|
||||
var nextResource = workInProgress.memoizedState;
|
||||
|
||||
if (current === null) {
|
||||
@@ -23546,16 +23510,12 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
} else {
|
||||
// This is a Hoistable Instance
|
||||
// We may have props to update on the Hoistable instance.
|
||||
if (diffInCommitPhase && supportsMutation) {
|
||||
{
|
||||
var oldProps = current.memoizedProps;
|
||||
|
||||
if (oldProps !== newProps) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} else {
|
||||
// We use the updateHostComponent path becuase it produces
|
||||
// the update queue we need for Hoistables.
|
||||
updateHostComponent(current, workInProgress, type, newProps);
|
||||
} // This must come at the very end of the complete phase.
|
||||
|
||||
bubbleProperties(workInProgress);
|
||||
@@ -23573,14 +23533,12 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
var _type = workInProgress.type;
|
||||
|
||||
if (current !== null && workInProgress.stateNode != null) {
|
||||
if (diffInCommitPhase && supportsMutation) {
|
||||
{
|
||||
var _oldProps2 = current.memoizedProps;
|
||||
|
||||
if (_oldProps2 !== newProps) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} else {
|
||||
updateHostComponent(current, workInProgress, _type, newProps);
|
||||
}
|
||||
|
||||
if (current.ref !== workInProgress.ref) {
|
||||
@@ -23657,7 +23615,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var _currentHostContext2 = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
var _currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
// "stack" as the parent. Then append children as we go in beginWork
|
||||
// or completeWork depending on whether we want to add them top->down or
|
||||
// bottom->up. Top->down is faster in IE11.
|
||||
@@ -23667,13 +23625,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
if (_wasHydrated2) {
|
||||
// TODO: Move this and createInstance step into the beginPhase
|
||||
// to consolidate.
|
||||
if (
|
||||
prepareToHydrateHostInstance(workInProgress, _currentHostContext2)
|
||||
) {
|
||||
// If changes to the hydrated node need to be applied at the
|
||||
// commit-phase we mark this as such.
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
prepareToHydrateHostInstance(workInProgress, _currentHostContext);
|
||||
} else {
|
||||
var _rootContainerInstance = getRootHostContainer();
|
||||
|
||||
@@ -23681,7 +23633,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
_type2,
|
||||
newProps,
|
||||
_rootContainerInstance,
|
||||
_currentHostContext2,
|
||||
_currentHostContext,
|
||||
workInProgress
|
||||
);
|
||||
|
||||
@@ -23730,7 +23682,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
|
||||
var _rootContainerInstance2 = getRootHostContainer();
|
||||
|
||||
var _currentHostContext3 = getHostContext();
|
||||
var _currentHostContext2 = getHostContext();
|
||||
|
||||
var _wasHydrated3 = popHydrationState(workInProgress);
|
||||
|
||||
@@ -23742,7 +23694,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
workInProgress.stateNode = createTextInstance(
|
||||
newText,
|
||||
_rootContainerInstance2,
|
||||
_currentHostContext3,
|
||||
_currentHostContext2,
|
||||
workInProgress
|
||||
);
|
||||
}
|
||||
@@ -27044,23 +26996,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
finishedWork.stateNode,
|
||||
updatePayload,
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.memoizedProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
finishedWork.stateNode,
|
||||
updatePayload,
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.memoizedProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27132,23 +27078,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var _updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (_updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33866,7 +33806,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-f84a446a";
|
||||
var ReactVersion = "18.3.0-www-modern-fe718cda";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -40131,128 +40071,6 @@ function setInitialProperties(domElement, tag, props) {
|
||||
|
||||
setProp(domElement, tag, _propKey6, _propValue6, props, null);
|
||||
}
|
||||
} // Calculate the diff between the two objects.
|
||||
|
||||
function diffProperties(domElement, tag, lastProps, nextProps) {
|
||||
{
|
||||
validatePropertiesInDevelopment(tag, nextProps);
|
||||
}
|
||||
|
||||
var updatePayload = null;
|
||||
var propKey;
|
||||
var styleName;
|
||||
var styleUpdates = null;
|
||||
|
||||
for (propKey in lastProps) {
|
||||
if (
|
||||
nextProps.hasOwnProperty(propKey) ||
|
||||
!lastProps.hasOwnProperty(propKey) ||
|
||||
lastProps[propKey] == null
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (propKey) {
|
||||
case "style": {
|
||||
var lastStyle = lastProps[propKey];
|
||||
|
||||
for (styleName in lastStyle) {
|
||||
if (lastStyle.hasOwnProperty(styleName)) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = "";
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
// For all other deleted properties we add it to the queue. We use
|
||||
// the allowed property list in the commit phase instead.
|
||||
(updatePayload = updatePayload || []).push(propKey, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (propKey in nextProps) {
|
||||
var nextProp = nextProps[propKey];
|
||||
var lastProp = lastProps != null ? lastProps[propKey] : undefined;
|
||||
|
||||
if (
|
||||
nextProps.hasOwnProperty(propKey) &&
|
||||
nextProp !== lastProp &&
|
||||
(nextProp != null || lastProp != null)
|
||||
) {
|
||||
switch (propKey) {
|
||||
case "style": {
|
||||
if (lastProp) {
|
||||
// Unset styles on `lastProp` but not on `nextProp`.
|
||||
for (styleName in lastProp) {
|
||||
if (
|
||||
lastProp.hasOwnProperty(styleName) &&
|
||||
(!nextProp || !nextProp.hasOwnProperty(styleName))
|
||||
) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = "";
|
||||
}
|
||||
} // Update styles that changed since `lastProp`.
|
||||
|
||||
for (styleName in nextProp) {
|
||||
if (
|
||||
nextProp.hasOwnProperty(styleName) &&
|
||||
lastProp[styleName] !== nextProp[styleName]
|
||||
) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = nextProp[styleName];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Relies on `updateStylesByID` not mutating `styleUpdates`.
|
||||
if (!styleUpdates) {
|
||||
if (!updatePayload) {
|
||||
updatePayload = [];
|
||||
}
|
||||
|
||||
updatePayload.push(propKey, styleUpdates);
|
||||
}
|
||||
|
||||
styleUpdates = nextProp;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "is": {
|
||||
error('Cannot update the "is" prop after it has been initialized.');
|
||||
}
|
||||
|
||||
// Fall through
|
||||
|
||||
default: {
|
||||
(updatePayload = updatePayload || []).push(propKey, nextProp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (styleUpdates) {
|
||||
{
|
||||
validateShorthandPropertyCollisionInDev(lastProps.style, nextProps.style);
|
||||
}
|
||||
|
||||
(updatePayload = updatePayload || []).push("style", styleUpdates);
|
||||
}
|
||||
|
||||
return updatePayload;
|
||||
}
|
||||
function updateProperties(domElement, tag, lastProps, nextProps) {
|
||||
{
|
||||
@@ -40801,348 +40619,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
|
||||
setProp(domElement, tag, _propKey19, _nextProp6, nextProps, _lastProp13);
|
||||
}
|
||||
}
|
||||
} // Apply the diff.
|
||||
|
||||
function updatePropertiesWithDiff(
|
||||
domElement,
|
||||
updatePayload,
|
||||
tag,
|
||||
lastProps,
|
||||
nextProps
|
||||
) {
|
||||
switch (tag) {
|
||||
case "div":
|
||||
case "span":
|
||||
case "svg":
|
||||
case "path":
|
||||
case "a":
|
||||
case "g":
|
||||
case "p":
|
||||
case "li": {
|
||||
// Fast track the most common tag types
|
||||
break;
|
||||
}
|
||||
|
||||
case "input": {
|
||||
var name = nextProps.name;
|
||||
var type = nextProps.type;
|
||||
var value = nextProps.value;
|
||||
var defaultValue = nextProps.defaultValue;
|
||||
var lastDefaultValue = lastProps.defaultValue;
|
||||
var checked = nextProps.checked;
|
||||
var defaultChecked = nextProps.defaultChecked;
|
||||
|
||||
for (var i = 0; i < updatePayload.length; i += 2) {
|
||||
var propKey = updatePayload[i];
|
||||
var propValue = updatePayload[i + 1];
|
||||
|
||||
switch (propKey) {
|
||||
case "type": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "name": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "checked": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "defaultChecked": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "value": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "defaultValue": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "children":
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (propValue != null) {
|
||||
throw new Error(
|
||||
tag +
|
||||
" is a void element tag and must neither have `children` nor " +
|
||||
"use `dangerouslySetInnerHTML`."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
propKey,
|
||||
propValue,
|
||||
nextProps,
|
||||
lastProps[propKey]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var wasControlled =
|
||||
lastProps.type === "checkbox" || lastProps.type === "radio"
|
||||
? lastProps.checked != null
|
||||
: lastProps.value != null;
|
||||
var isControlled =
|
||||
nextProps.type === "checkbox" || nextProps.type === "radio"
|
||||
? nextProps.checked != null
|
||||
: nextProps.value != null;
|
||||
|
||||
if (
|
||||
!wasControlled &&
|
||||
isControlled &&
|
||||
!didWarnUncontrolledToControlled
|
||||
) {
|
||||
error(
|
||||
"A component is changing an uncontrolled input to be controlled. " +
|
||||
"This is likely caused by the value changing from undefined to " +
|
||||
"a defined value, which should not happen. " +
|
||||
"Decide between using a controlled or uncontrolled input " +
|
||||
"element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"
|
||||
);
|
||||
|
||||
didWarnUncontrolledToControlled = true;
|
||||
}
|
||||
|
||||
if (
|
||||
wasControlled &&
|
||||
!isControlled &&
|
||||
!didWarnControlledToUncontrolled
|
||||
) {
|
||||
error(
|
||||
"A component is changing a controlled input to be uncontrolled. " +
|
||||
"This is likely caused by the value changing from a defined to " +
|
||||
"undefined, which should not happen. " +
|
||||
"Decide between using a controlled or uncontrolled input " +
|
||||
"element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"
|
||||
);
|
||||
|
||||
didWarnControlledToUncontrolled = true;
|
||||
}
|
||||
} // Update the wrapper around inputs *after* updating props. This has to
|
||||
// happen after updating the rest of props. Otherwise HTML5 input validations
|
||||
// raise warnings and prevent the new value from being assigned.
|
||||
|
||||
updateInput(
|
||||
domElement,
|
||||
value,
|
||||
defaultValue,
|
||||
lastDefaultValue,
|
||||
checked,
|
||||
defaultChecked,
|
||||
type,
|
||||
name
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
case "select": {
|
||||
var _value5 = nextProps.value;
|
||||
var _defaultValue5 = nextProps.defaultValue;
|
||||
var multiple = nextProps.multiple;
|
||||
var wasMultiple = lastProps.multiple;
|
||||
|
||||
for (var _i = 0; _i < updatePayload.length; _i += 2) {
|
||||
var _propKey20 = updatePayload[_i];
|
||||
var _propValue7 = updatePayload[_i + 1];
|
||||
|
||||
switch (_propKey20) {
|
||||
case "value": {
|
||||
// This is handled by updateWrapper below.
|
||||
break;
|
||||
}
|
||||
// defaultValue are ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey20,
|
||||
_propValue7,
|
||||
nextProps,
|
||||
lastProps[_propKey20]
|
||||
);
|
||||
}
|
||||
}
|
||||
} // <select> value update needs to occur after <option> children
|
||||
// reconciliation
|
||||
|
||||
updateSelect(domElement, _value5, _defaultValue5, multiple, wasMultiple);
|
||||
return;
|
||||
}
|
||||
|
||||
case "textarea": {
|
||||
var _value6 = nextProps.value;
|
||||
var _defaultValue6 = nextProps.defaultValue;
|
||||
|
||||
for (var _i2 = 0; _i2 < updatePayload.length; _i2 += 2) {
|
||||
var _propKey21 = updatePayload[_i2];
|
||||
var _propValue8 = updatePayload[_i2 + 1];
|
||||
|
||||
switch (_propKey21) {
|
||||
case "value": {
|
||||
// This is handled by updateWrapper below.
|
||||
break;
|
||||
}
|
||||
|
||||
case "children": {
|
||||
// TODO: This doesn't actually do anything if it updates.
|
||||
break;
|
||||
}
|
||||
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (_propValue8 != null) {
|
||||
// TODO: Do we really need a special error message for this. It's also pretty blunt.
|
||||
throw new Error(
|
||||
"`dangerouslySetInnerHTML` does not make sense on <textarea>."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// defaultValue is ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey21,
|
||||
_propValue8,
|
||||
nextProps,
|
||||
lastProps[_propKey21]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateTextarea(domElement, _value6, _defaultValue6);
|
||||
return;
|
||||
}
|
||||
|
||||
case "option": {
|
||||
for (var _i3 = 0; _i3 < updatePayload.length; _i3 += 2) {
|
||||
var _propKey22 = updatePayload[_i3];
|
||||
var _propValue9 = updatePayload[_i3 + 1];
|
||||
|
||||
switch (_propKey22) {
|
||||
case "selected": {
|
||||
// TODO: Remove support for selected on option.
|
||||
domElement.selected =
|
||||
_propValue9 &&
|
||||
typeof _propValue9 !== "function" &&
|
||||
typeof _propValue9 !== "symbol";
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey22,
|
||||
_propValue9,
|
||||
nextProps,
|
||||
lastProps[_propKey22]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
case "img":
|
||||
case "link":
|
||||
case "area":
|
||||
case "base":
|
||||
case "br":
|
||||
case "col":
|
||||
case "embed":
|
||||
case "hr":
|
||||
case "keygen":
|
||||
case "meta":
|
||||
case "param":
|
||||
case "source":
|
||||
case "track":
|
||||
case "wbr":
|
||||
case "menuitem": {
|
||||
// Void elements
|
||||
for (var _i4 = 0; _i4 < updatePayload.length; _i4 += 2) {
|
||||
var _propKey23 = updatePayload[_i4];
|
||||
var _propValue10 = updatePayload[_i4 + 1];
|
||||
|
||||
switch (_propKey23) {
|
||||
case "children":
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (_propValue10 != null) {
|
||||
// TODO: Can we make this a DEV warning to avoid this deny list?
|
||||
throw new Error(
|
||||
tag +
|
||||
" is a void element tag and must neither have `children` nor " +
|
||||
"use `dangerouslySetInnerHTML`."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// defaultChecked and defaultValue are ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey23,
|
||||
_propValue10,
|
||||
nextProps,
|
||||
lastProps[_propKey23]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
default: {
|
||||
if (isCustomElement(tag)) {
|
||||
for (var _i5 = 0; _i5 < updatePayload.length; _i5 += 2) {
|
||||
var _propKey24 = updatePayload[_i5];
|
||||
var _propValue11 = updatePayload[_i5 + 1];
|
||||
setPropOnCustomElement(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey24,
|
||||
_propValue11,
|
||||
nextProps,
|
||||
lastProps[_propKey24]
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
} // Apply the diff.
|
||||
|
||||
for (var _i6 = 0; _i6 < updatePayload.length; _i6 += 2) {
|
||||
var _propKey25 = updatePayload[_i6];
|
||||
var _propValue12 = updatePayload[_i6 + 1];
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey25,
|
||||
_propValue12,
|
||||
nextProps,
|
||||
lastProps[_propKey25]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function getPossibleStandardName(propName) {
|
||||
@@ -42178,7 +41654,6 @@ function diffHydratedProperties(
|
||||
break;
|
||||
}
|
||||
|
||||
var updatePayload = null;
|
||||
var children = props.children; // For text content children we compare against textContent. This
|
||||
// might match additional HTML that is hidden when we read it using
|
||||
// textContent. E.g. "foo" will match "f<span>oo</span>" but that still
|
||||
@@ -42201,17 +41676,13 @@ function diffHydratedProperties(
|
||||
}
|
||||
|
||||
if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) {
|
||||
if (diffInCommitPhase) {
|
||||
// We really should be patching this in the commit phase but since
|
||||
// this only affects legacy mode hydration which is deprecated anyway
|
||||
// we can get away with it.
|
||||
// Host singletons get their children appended and don't use the text
|
||||
// content mechanism.
|
||||
if (tag !== "body") {
|
||||
domElement.textContent = children;
|
||||
}
|
||||
} else {
|
||||
updatePayload = ["children", children];
|
||||
// We really should be patching this in the commit phase but since
|
||||
// this only affects legacy mode hydration which is deprecated anyway
|
||||
// we can get away with it.
|
||||
// Host singletons get their children appended and don't use the text
|
||||
// content mechanism.
|
||||
if (tag !== "body") {
|
||||
domElement.textContent = children;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42230,8 +41701,8 @@ function diffHydratedProperties(
|
||||
var extraAttributes = new Set();
|
||||
var attributes = domElement.attributes;
|
||||
|
||||
for (var _i7 = 0; _i7 < attributes.length; _i7++) {
|
||||
var name = attributes[_i7].name.toLowerCase();
|
||||
for (var _i = 0; _i < attributes.length; _i++) {
|
||||
var name = attributes[_i].name.toLowerCase();
|
||||
|
||||
switch (name) {
|
||||
// Controlled attributes are not validated
|
||||
@@ -42248,7 +41719,7 @@ function diffHydratedProperties(
|
||||
default:
|
||||
// Intentionally use the original name.
|
||||
// See discussion in https://github.com/facebook/react/pull/10676.
|
||||
extraAttributes.add(attributes[_i7].name);
|
||||
extraAttributes.add(attributes[_i].name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42274,8 +41745,6 @@ function diffHydratedProperties(
|
||||
warnForExtraAttributes(extraAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
return updatePayload;
|
||||
}
|
||||
function diffHydratedText(textNode, text, isConcurrentMode) {
|
||||
var isDifferent = textNode.nodeValue !== text;
|
||||
@@ -42784,14 +42253,6 @@ function finalizeInitialChildren(domElement, type, props, hostContext) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function prepareUpdate(domElement, type, oldProps, newProps, hostContext) {
|
||||
if (diffInCommitPhase) {
|
||||
// TODO: Figure out how to validateDOMNesting when children turn into a string.
|
||||
return null;
|
||||
}
|
||||
|
||||
return diffProperties(domElement, type, oldProps, newProps);
|
||||
}
|
||||
function shouldSetTextContent(type, props) {
|
||||
return (
|
||||
type === "textarea" ||
|
||||
@@ -42881,10 +42342,6 @@ function handleErrorInNextTick(error) {
|
||||
throw error;
|
||||
});
|
||||
} // -------------------
|
||||
// Mutation
|
||||
// -------------------
|
||||
|
||||
var supportsMutation = true;
|
||||
function commitMount(domElement, type, newProps, internalInstanceHandle) {
|
||||
// Despite the naming that might imply otherwise, this method only
|
||||
// fires if there is an `Update` effect scheduled during mounting.
|
||||
@@ -42920,19 +42377,8 @@ function commitUpdate(
|
||||
newProps,
|
||||
internalInstanceHandle
|
||||
) {
|
||||
if (diffInCommitPhase) {
|
||||
// Diff and update the properties.
|
||||
updateProperties(domElement, type, oldProps, newProps);
|
||||
} else {
|
||||
// Apply the diff to the DOM node.
|
||||
updatePropertiesWithDiff(
|
||||
domElement,
|
||||
updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps
|
||||
);
|
||||
} // Update the props handle so that we know which props are the ones with
|
||||
// Diff and update the properties.
|
||||
updateProperties(domElement, type, oldProps, newProps); // Update the props handle so that we know which props are the ones with
|
||||
// with current event handlers.
|
||||
|
||||
updateFiberProps(domElement, newProps);
|
||||
@@ -43443,7 +42889,7 @@ function hydrateInstance(
|
||||
|
||||
var isConcurrentMode =
|
||||
(internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
|
||||
return diffHydratedProperties(
|
||||
diffHydratedProperties(
|
||||
instance,
|
||||
type,
|
||||
props,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -131,7 +131,6 @@ var disableInputAttributeSyncing =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
@@ -5758,7 +5757,7 @@ function setValueForStyles(node, styles, prevStyles) {
|
||||
|
||||
var style = node.style;
|
||||
|
||||
if (diffInCommitPhase && prevStyles != null) {
|
||||
if (prevStyles != null) {
|
||||
{
|
||||
validateShorthandPropertyCollisionInDev(prevStyles, styles);
|
||||
}
|
||||
@@ -8516,25 +8515,14 @@ function tryToClaimNextHydratableSuspenseInstance(fiber) {
|
||||
function prepareToHydrateHostInstance(fiber, hostContext) {
|
||||
var instance = fiber.stateNode;
|
||||
var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
|
||||
var updatePayload = hydrateInstance(
|
||||
hydrateInstance(
|
||||
instance,
|
||||
fiber.type,
|
||||
fiber.memoizedProps,
|
||||
hostContext,
|
||||
fiber,
|
||||
shouldWarnIfMismatchDev
|
||||
); // TODO: Type this specific to this type of component.
|
||||
|
||||
if (!diffInCommitPhase) {
|
||||
fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
|
||||
// is a new ref we mark this as an update.
|
||||
|
||||
if (updatePayload !== null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
);
|
||||
}
|
||||
|
||||
function prepareToHydrateHostTextInstance(fiber) {
|
||||
@@ -23224,27 +23212,7 @@ function updateHostComponent(
|
||||
return;
|
||||
}
|
||||
|
||||
if (diffInCommitPhase) {
|
||||
markUpdate(workInProgress);
|
||||
} else {
|
||||
// If we get updated because one of our children updated, we don't
|
||||
// have newProps so we'll have to reuse them.
|
||||
// TODO: Split the update API as separate for the props vs. children.
|
||||
// Even better would be if children weren't special cased at all tho.
|
||||
var instance = workInProgress.stateNode; // TODO: Experiencing an error where oldProps is null. Suggests a host
|
||||
// component is hitting the resume path. Figure out why. Possibly
|
||||
// related to `hidden`.
|
||||
|
||||
getHostContext();
|
||||
var updatePayload = prepareUpdate(instance, type, oldProps, newProps); // TODO: Type this specific to this type of component.
|
||||
|
||||
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
|
||||
// is a new ref we mark this as an update. All the work is done in commitWork.
|
||||
|
||||
if (updatePayload) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
}
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} // This function must be called at the very end of the complete phase, because
|
||||
// it might throw to suspend, and if the resource immediately loads, the work
|
||||
@@ -23750,10 +23718,6 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
|
||||
case HostHoistable: {
|
||||
{
|
||||
// The branching here is more complicated than you might expect because
|
||||
// a HostHoistable sometimes corresponds to a Resource and sometimes
|
||||
// corresponds to an Instance. It can also switch during an update.
|
||||
var type = workInProgress.type;
|
||||
var nextResource = workInProgress.memoizedState;
|
||||
|
||||
if (current === null) {
|
||||
@@ -23808,16 +23772,12 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
} else {
|
||||
// This is a Hoistable Instance
|
||||
// We may have props to update on the Hoistable instance.
|
||||
if (diffInCommitPhase && supportsMutation) {
|
||||
{
|
||||
var oldProps = current.memoizedProps;
|
||||
|
||||
if (oldProps !== newProps) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} else {
|
||||
// We use the updateHostComponent path becuase it produces
|
||||
// the update queue we need for Hoistables.
|
||||
updateHostComponent(current, workInProgress, type, newProps);
|
||||
} // This must come at the very end of the complete phase.
|
||||
|
||||
bubbleProperties(workInProgress);
|
||||
@@ -23835,14 +23795,12 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
var _type = workInProgress.type;
|
||||
|
||||
if (current !== null && workInProgress.stateNode != null) {
|
||||
if (diffInCommitPhase && supportsMutation) {
|
||||
{
|
||||
var _oldProps2 = current.memoizedProps;
|
||||
|
||||
if (_oldProps2 !== newProps) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} else {
|
||||
updateHostComponent(current, workInProgress, _type, newProps);
|
||||
}
|
||||
|
||||
if (current.ref !== workInProgress.ref) {
|
||||
@@ -23919,7 +23877,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var _currentHostContext2 = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
var _currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
// "stack" as the parent. Then append children as we go in beginWork
|
||||
// or completeWork depending on whether we want to add them top->down or
|
||||
// bottom->up. Top->down is faster in IE11.
|
||||
@@ -23929,13 +23887,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
if (_wasHydrated2) {
|
||||
// TODO: Move this and createInstance step into the beginPhase
|
||||
// to consolidate.
|
||||
if (
|
||||
prepareToHydrateHostInstance(workInProgress, _currentHostContext2)
|
||||
) {
|
||||
// If changes to the hydrated node need to be applied at the
|
||||
// commit-phase we mark this as such.
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
prepareToHydrateHostInstance(workInProgress, _currentHostContext);
|
||||
} else {
|
||||
var _rootContainerInstance = getRootHostContainer();
|
||||
|
||||
@@ -23943,7 +23895,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
_type2,
|
||||
newProps,
|
||||
_rootContainerInstance,
|
||||
_currentHostContext2,
|
||||
_currentHostContext,
|
||||
workInProgress
|
||||
);
|
||||
|
||||
@@ -23992,7 +23944,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
|
||||
var _rootContainerInstance2 = getRootHostContainer();
|
||||
|
||||
var _currentHostContext3 = getHostContext();
|
||||
var _currentHostContext2 = getHostContext();
|
||||
|
||||
var _wasHydrated3 = popHydrationState(workInProgress);
|
||||
|
||||
@@ -24004,7 +23956,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
workInProgress.stateNode = createTextInstance(
|
||||
newText,
|
||||
_rootContainerInstance2,
|
||||
_currentHostContext3,
|
||||
_currentHostContext2,
|
||||
workInProgress
|
||||
);
|
||||
}
|
||||
@@ -27328,23 +27280,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
finishedWork.stateNode,
|
||||
updatePayload,
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.memoizedProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
finishedWork.stateNode,
|
||||
updatePayload,
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.memoizedProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27416,23 +27362,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var _updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (_updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34638,7 +34578,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-c7ac40c0";
|
||||
var ReactVersion = "18.3.0-www-classic-29934d02";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -40238,128 +40178,6 @@ function setInitialProperties(domElement, tag, props) {
|
||||
|
||||
setProp(domElement, tag, _propKey6, _propValue6, props, null);
|
||||
}
|
||||
} // Calculate the diff between the two objects.
|
||||
|
||||
function diffProperties(domElement, tag, lastProps, nextProps) {
|
||||
{
|
||||
validatePropertiesInDevelopment(tag, nextProps);
|
||||
}
|
||||
|
||||
var updatePayload = null;
|
||||
var propKey;
|
||||
var styleName;
|
||||
var styleUpdates = null;
|
||||
|
||||
for (propKey in lastProps) {
|
||||
if (
|
||||
nextProps.hasOwnProperty(propKey) ||
|
||||
!lastProps.hasOwnProperty(propKey) ||
|
||||
lastProps[propKey] == null
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (propKey) {
|
||||
case "style": {
|
||||
var lastStyle = lastProps[propKey];
|
||||
|
||||
for (styleName in lastStyle) {
|
||||
if (lastStyle.hasOwnProperty(styleName)) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = "";
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
// For all other deleted properties we add it to the queue. We use
|
||||
// the allowed property list in the commit phase instead.
|
||||
(updatePayload = updatePayload || []).push(propKey, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (propKey in nextProps) {
|
||||
var nextProp = nextProps[propKey];
|
||||
var lastProp = lastProps != null ? lastProps[propKey] : undefined;
|
||||
|
||||
if (
|
||||
nextProps.hasOwnProperty(propKey) &&
|
||||
nextProp !== lastProp &&
|
||||
(nextProp != null || lastProp != null)
|
||||
) {
|
||||
switch (propKey) {
|
||||
case "style": {
|
||||
if (lastProp) {
|
||||
// Unset styles on `lastProp` but not on `nextProp`.
|
||||
for (styleName in lastProp) {
|
||||
if (
|
||||
lastProp.hasOwnProperty(styleName) &&
|
||||
(!nextProp || !nextProp.hasOwnProperty(styleName))
|
||||
) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = "";
|
||||
}
|
||||
} // Update styles that changed since `lastProp`.
|
||||
|
||||
for (styleName in nextProp) {
|
||||
if (
|
||||
nextProp.hasOwnProperty(styleName) &&
|
||||
lastProp[styleName] !== nextProp[styleName]
|
||||
) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = nextProp[styleName];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Relies on `updateStylesByID` not mutating `styleUpdates`.
|
||||
if (!styleUpdates) {
|
||||
if (!updatePayload) {
|
||||
updatePayload = [];
|
||||
}
|
||||
|
||||
updatePayload.push(propKey, styleUpdates);
|
||||
}
|
||||
|
||||
styleUpdates = nextProp;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "is": {
|
||||
error('Cannot update the "is" prop after it has been initialized.');
|
||||
}
|
||||
|
||||
// Fall through
|
||||
|
||||
default: {
|
||||
(updatePayload = updatePayload || []).push(propKey, nextProp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (styleUpdates) {
|
||||
{
|
||||
validateShorthandPropertyCollisionInDev(lastProps.style, nextProps.style);
|
||||
}
|
||||
|
||||
(updatePayload = updatePayload || []).push("style", styleUpdates);
|
||||
}
|
||||
|
||||
return updatePayload;
|
||||
}
|
||||
function updateProperties(domElement, tag, lastProps, nextProps) {
|
||||
{
|
||||
@@ -40908,348 +40726,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
|
||||
setProp(domElement, tag, _propKey19, _nextProp6, nextProps, _lastProp13);
|
||||
}
|
||||
}
|
||||
} // Apply the diff.
|
||||
|
||||
function updatePropertiesWithDiff(
|
||||
domElement,
|
||||
updatePayload,
|
||||
tag,
|
||||
lastProps,
|
||||
nextProps
|
||||
) {
|
||||
switch (tag) {
|
||||
case "div":
|
||||
case "span":
|
||||
case "svg":
|
||||
case "path":
|
||||
case "a":
|
||||
case "g":
|
||||
case "p":
|
||||
case "li": {
|
||||
// Fast track the most common tag types
|
||||
break;
|
||||
}
|
||||
|
||||
case "input": {
|
||||
var name = nextProps.name;
|
||||
var type = nextProps.type;
|
||||
var value = nextProps.value;
|
||||
var defaultValue = nextProps.defaultValue;
|
||||
var lastDefaultValue = lastProps.defaultValue;
|
||||
var checked = nextProps.checked;
|
||||
var defaultChecked = nextProps.defaultChecked;
|
||||
|
||||
for (var i = 0; i < updatePayload.length; i += 2) {
|
||||
var propKey = updatePayload[i];
|
||||
var propValue = updatePayload[i + 1];
|
||||
|
||||
switch (propKey) {
|
||||
case "type": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "name": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "checked": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "defaultChecked": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "value": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "defaultValue": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "children":
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (propValue != null) {
|
||||
throw new Error(
|
||||
tag +
|
||||
" is a void element tag and must neither have `children` nor " +
|
||||
"use `dangerouslySetInnerHTML`."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
propKey,
|
||||
propValue,
|
||||
nextProps,
|
||||
lastProps[propKey]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var wasControlled =
|
||||
lastProps.type === "checkbox" || lastProps.type === "radio"
|
||||
? lastProps.checked != null
|
||||
: lastProps.value != null;
|
||||
var isControlled =
|
||||
nextProps.type === "checkbox" || nextProps.type === "radio"
|
||||
? nextProps.checked != null
|
||||
: nextProps.value != null;
|
||||
|
||||
if (
|
||||
!wasControlled &&
|
||||
isControlled &&
|
||||
!didWarnUncontrolledToControlled
|
||||
) {
|
||||
error(
|
||||
"A component is changing an uncontrolled input to be controlled. " +
|
||||
"This is likely caused by the value changing from undefined to " +
|
||||
"a defined value, which should not happen. " +
|
||||
"Decide between using a controlled or uncontrolled input " +
|
||||
"element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"
|
||||
);
|
||||
|
||||
didWarnUncontrolledToControlled = true;
|
||||
}
|
||||
|
||||
if (
|
||||
wasControlled &&
|
||||
!isControlled &&
|
||||
!didWarnControlledToUncontrolled
|
||||
) {
|
||||
error(
|
||||
"A component is changing a controlled input to be uncontrolled. " +
|
||||
"This is likely caused by the value changing from a defined to " +
|
||||
"undefined, which should not happen. " +
|
||||
"Decide between using a controlled or uncontrolled input " +
|
||||
"element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"
|
||||
);
|
||||
|
||||
didWarnControlledToUncontrolled = true;
|
||||
}
|
||||
} // Update the wrapper around inputs *after* updating props. This has to
|
||||
// happen after updating the rest of props. Otherwise HTML5 input validations
|
||||
// raise warnings and prevent the new value from being assigned.
|
||||
|
||||
updateInput(
|
||||
domElement,
|
||||
value,
|
||||
defaultValue,
|
||||
lastDefaultValue,
|
||||
checked,
|
||||
defaultChecked,
|
||||
type,
|
||||
name
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
case "select": {
|
||||
var _value5 = nextProps.value;
|
||||
var _defaultValue5 = nextProps.defaultValue;
|
||||
var multiple = nextProps.multiple;
|
||||
var wasMultiple = lastProps.multiple;
|
||||
|
||||
for (var _i = 0; _i < updatePayload.length; _i += 2) {
|
||||
var _propKey20 = updatePayload[_i];
|
||||
var _propValue7 = updatePayload[_i + 1];
|
||||
|
||||
switch (_propKey20) {
|
||||
case "value": {
|
||||
// This is handled by updateWrapper below.
|
||||
break;
|
||||
}
|
||||
// defaultValue are ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey20,
|
||||
_propValue7,
|
||||
nextProps,
|
||||
lastProps[_propKey20]
|
||||
);
|
||||
}
|
||||
}
|
||||
} // <select> value update needs to occur after <option> children
|
||||
// reconciliation
|
||||
|
||||
updateSelect(domElement, _value5, _defaultValue5, multiple, wasMultiple);
|
||||
return;
|
||||
}
|
||||
|
||||
case "textarea": {
|
||||
var _value6 = nextProps.value;
|
||||
var _defaultValue6 = nextProps.defaultValue;
|
||||
|
||||
for (var _i2 = 0; _i2 < updatePayload.length; _i2 += 2) {
|
||||
var _propKey21 = updatePayload[_i2];
|
||||
var _propValue8 = updatePayload[_i2 + 1];
|
||||
|
||||
switch (_propKey21) {
|
||||
case "value": {
|
||||
// This is handled by updateWrapper below.
|
||||
break;
|
||||
}
|
||||
|
||||
case "children": {
|
||||
// TODO: This doesn't actually do anything if it updates.
|
||||
break;
|
||||
}
|
||||
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (_propValue8 != null) {
|
||||
// TODO: Do we really need a special error message for this. It's also pretty blunt.
|
||||
throw new Error(
|
||||
"`dangerouslySetInnerHTML` does not make sense on <textarea>."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// defaultValue is ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey21,
|
||||
_propValue8,
|
||||
nextProps,
|
||||
lastProps[_propKey21]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateTextarea(domElement, _value6, _defaultValue6);
|
||||
return;
|
||||
}
|
||||
|
||||
case "option": {
|
||||
for (var _i3 = 0; _i3 < updatePayload.length; _i3 += 2) {
|
||||
var _propKey22 = updatePayload[_i3];
|
||||
var _propValue9 = updatePayload[_i3 + 1];
|
||||
|
||||
switch (_propKey22) {
|
||||
case "selected": {
|
||||
// TODO: Remove support for selected on option.
|
||||
domElement.selected =
|
||||
_propValue9 &&
|
||||
typeof _propValue9 !== "function" &&
|
||||
typeof _propValue9 !== "symbol";
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey22,
|
||||
_propValue9,
|
||||
nextProps,
|
||||
lastProps[_propKey22]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
case "img":
|
||||
case "link":
|
||||
case "area":
|
||||
case "base":
|
||||
case "br":
|
||||
case "col":
|
||||
case "embed":
|
||||
case "hr":
|
||||
case "keygen":
|
||||
case "meta":
|
||||
case "param":
|
||||
case "source":
|
||||
case "track":
|
||||
case "wbr":
|
||||
case "menuitem": {
|
||||
// Void elements
|
||||
for (var _i4 = 0; _i4 < updatePayload.length; _i4 += 2) {
|
||||
var _propKey23 = updatePayload[_i4];
|
||||
var _propValue10 = updatePayload[_i4 + 1];
|
||||
|
||||
switch (_propKey23) {
|
||||
case "children":
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (_propValue10 != null) {
|
||||
// TODO: Can we make this a DEV warning to avoid this deny list?
|
||||
throw new Error(
|
||||
tag +
|
||||
" is a void element tag and must neither have `children` nor " +
|
||||
"use `dangerouslySetInnerHTML`."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// defaultChecked and defaultValue are ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey23,
|
||||
_propValue10,
|
||||
nextProps,
|
||||
lastProps[_propKey23]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
default: {
|
||||
if (isCustomElement(tag)) {
|
||||
for (var _i5 = 0; _i5 < updatePayload.length; _i5 += 2) {
|
||||
var _propKey24 = updatePayload[_i5];
|
||||
var _propValue11 = updatePayload[_i5 + 1];
|
||||
setPropOnCustomElement(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey24,
|
||||
_propValue11,
|
||||
nextProps,
|
||||
lastProps[_propKey24]
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
} // Apply the diff.
|
||||
|
||||
for (var _i6 = 0; _i6 < updatePayload.length; _i6 += 2) {
|
||||
var _propKey25 = updatePayload[_i6];
|
||||
var _propValue12 = updatePayload[_i6 + 1];
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey25,
|
||||
_propValue12,
|
||||
nextProps,
|
||||
lastProps[_propKey25]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function getPossibleStandardName(propName) {
|
||||
@@ -42285,7 +41761,6 @@ function diffHydratedProperties(
|
||||
break;
|
||||
}
|
||||
|
||||
var updatePayload = null;
|
||||
var children = props.children; // For text content children we compare against textContent. This
|
||||
// might match additional HTML that is hidden when we read it using
|
||||
// textContent. E.g. "foo" will match "f<span>oo</span>" but that still
|
||||
@@ -42308,17 +41783,13 @@ function diffHydratedProperties(
|
||||
}
|
||||
|
||||
if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) {
|
||||
if (diffInCommitPhase) {
|
||||
// We really should be patching this in the commit phase but since
|
||||
// this only affects legacy mode hydration which is deprecated anyway
|
||||
// we can get away with it.
|
||||
// Host singletons get their children appended and don't use the text
|
||||
// content mechanism.
|
||||
if (tag !== "body") {
|
||||
domElement.textContent = children;
|
||||
}
|
||||
} else {
|
||||
updatePayload = ["children", children];
|
||||
// We really should be patching this in the commit phase but since
|
||||
// this only affects legacy mode hydration which is deprecated anyway
|
||||
// we can get away with it.
|
||||
// Host singletons get their children appended and don't use the text
|
||||
// content mechanism.
|
||||
if (tag !== "body") {
|
||||
domElement.textContent = children;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42337,8 +41808,8 @@ function diffHydratedProperties(
|
||||
var extraAttributes = new Set();
|
||||
var attributes = domElement.attributes;
|
||||
|
||||
for (var _i7 = 0; _i7 < attributes.length; _i7++) {
|
||||
var name = attributes[_i7].name.toLowerCase();
|
||||
for (var _i = 0; _i < attributes.length; _i++) {
|
||||
var name = attributes[_i].name.toLowerCase();
|
||||
|
||||
switch (name) {
|
||||
// Controlled attributes are not validated
|
||||
@@ -42355,7 +41826,7 @@ function diffHydratedProperties(
|
||||
default:
|
||||
// Intentionally use the original name.
|
||||
// See discussion in https://github.com/facebook/react/pull/10676.
|
||||
extraAttributes.add(attributes[_i7].name);
|
||||
extraAttributes.add(attributes[_i].name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42381,8 +41852,6 @@ function diffHydratedProperties(
|
||||
warnForExtraAttributes(extraAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
return updatePayload;
|
||||
}
|
||||
function diffHydratedText(textNode, text, isConcurrentMode) {
|
||||
var isDifferent = textNode.nodeValue !== text;
|
||||
@@ -42891,14 +42360,6 @@ function finalizeInitialChildren(domElement, type, props, hostContext) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function prepareUpdate(domElement, type, oldProps, newProps, hostContext) {
|
||||
if (diffInCommitPhase) {
|
||||
// TODO: Figure out how to validateDOMNesting when children turn into a string.
|
||||
return null;
|
||||
}
|
||||
|
||||
return diffProperties(domElement, type, oldProps, newProps);
|
||||
}
|
||||
function shouldSetTextContent(type, props) {
|
||||
return (
|
||||
type === "textarea" ||
|
||||
@@ -42988,10 +42449,6 @@ function handleErrorInNextTick(error) {
|
||||
throw error;
|
||||
});
|
||||
} // -------------------
|
||||
// Mutation
|
||||
// -------------------
|
||||
|
||||
var supportsMutation = true;
|
||||
function commitMount(domElement, type, newProps, internalInstanceHandle) {
|
||||
// Despite the naming that might imply otherwise, this method only
|
||||
// fires if there is an `Update` effect scheduled during mounting.
|
||||
@@ -43027,19 +42484,8 @@ function commitUpdate(
|
||||
newProps,
|
||||
internalInstanceHandle
|
||||
) {
|
||||
if (diffInCommitPhase) {
|
||||
// Diff and update the properties.
|
||||
updateProperties(domElement, type, oldProps, newProps);
|
||||
} else {
|
||||
// Apply the diff to the DOM node.
|
||||
updatePropertiesWithDiff(
|
||||
domElement,
|
||||
updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps
|
||||
);
|
||||
} // Update the props handle so that we know which props are the ones with
|
||||
// Diff and update the properties.
|
||||
updateProperties(domElement, type, oldProps, newProps); // Update the props handle so that we know which props are the ones with
|
||||
// with current event handlers.
|
||||
|
||||
updateFiberProps(domElement, newProps);
|
||||
@@ -43550,7 +42996,7 @@ function hydrateInstance(
|
||||
|
||||
var isConcurrentMode =
|
||||
(internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
|
||||
return diffHydratedProperties(
|
||||
diffHydratedProperties(
|
||||
instance,
|
||||
type,
|
||||
props,
|
||||
|
||||
@@ -117,7 +117,6 @@ var disableInputAttributeSyncing =
|
||||
dynamicFeatureFlags.enableCustomElementPropertySupport,
|
||||
enableDeferRootSchedulingToMicrotask =
|
||||
dynamicFeatureFlags.enableDeferRootSchedulingToMicrotask,
|
||||
diffInCommitPhase = dynamicFeatureFlags.diffInCommitPhase,
|
||||
enableAsyncActions = dynamicFeatureFlags.enableAsyncActions,
|
||||
alwaysThrottleRetries = dynamicFeatureFlags.alwaysThrottleRetries,
|
||||
enableDO_NOT_USE_disableStrictPassiveEffect =
|
||||
@@ -5580,7 +5579,7 @@ function setValueForStyles(node, styles, prevStyles) {
|
||||
|
||||
var style = node.style;
|
||||
|
||||
if (diffInCommitPhase && prevStyles != null) {
|
||||
if (prevStyles != null) {
|
||||
{
|
||||
validateShorthandPropertyCollisionInDev(prevStyles, styles);
|
||||
}
|
||||
@@ -8457,25 +8456,14 @@ function tryToClaimNextHydratableSuspenseInstance(fiber) {
|
||||
function prepareToHydrateHostInstance(fiber, hostContext) {
|
||||
var instance = fiber.stateNode;
|
||||
var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV;
|
||||
var updatePayload = hydrateInstance(
|
||||
hydrateInstance(
|
||||
instance,
|
||||
fiber.type,
|
||||
fiber.memoizedProps,
|
||||
hostContext,
|
||||
fiber,
|
||||
shouldWarnIfMismatchDev
|
||||
); // TODO: Type this specific to this type of component.
|
||||
|
||||
if (!diffInCommitPhase) {
|
||||
fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
|
||||
// is a new ref we mark this as an update.
|
||||
|
||||
if (updatePayload !== null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
);
|
||||
}
|
||||
|
||||
function prepareToHydrateHostTextInstance(fiber) {
|
||||
@@ -23103,27 +23091,7 @@ function updateHostComponent(
|
||||
return;
|
||||
}
|
||||
|
||||
if (diffInCommitPhase) {
|
||||
markUpdate(workInProgress);
|
||||
} else {
|
||||
// If we get updated because one of our children updated, we don't
|
||||
// have newProps so we'll have to reuse them.
|
||||
// TODO: Split the update API as separate for the props vs. children.
|
||||
// Even better would be if children weren't special cased at all tho.
|
||||
var instance = workInProgress.stateNode; // TODO: Experiencing an error where oldProps is null. Suggests a host
|
||||
// component is hitting the resume path. Figure out why. Possibly
|
||||
// related to `hidden`.
|
||||
|
||||
getHostContext();
|
||||
var updatePayload = prepareUpdate(instance, type, oldProps, newProps); // TODO: Type this specific to this type of component.
|
||||
|
||||
workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
|
||||
// is a new ref we mark this as an update. All the work is done in commitWork.
|
||||
|
||||
if (updatePayload) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
}
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} // This function must be called at the very end of the complete phase, because
|
||||
// it might throw to suspend, and if the resource immediately loads, the work
|
||||
@@ -23622,10 +23590,6 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
|
||||
case HostHoistable: {
|
||||
{
|
||||
// The branching here is more complicated than you might expect because
|
||||
// a HostHoistable sometimes corresponds to a Resource and sometimes
|
||||
// corresponds to an Instance. It can also switch during an update.
|
||||
var type = workInProgress.type;
|
||||
var nextResource = workInProgress.memoizedState;
|
||||
|
||||
if (current === null) {
|
||||
@@ -23680,16 +23644,12 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
} else {
|
||||
// This is a Hoistable Instance
|
||||
// We may have props to update on the Hoistable instance.
|
||||
if (diffInCommitPhase && supportsMutation) {
|
||||
{
|
||||
var oldProps = current.memoizedProps;
|
||||
|
||||
if (oldProps !== newProps) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} else {
|
||||
// We use the updateHostComponent path becuase it produces
|
||||
// the update queue we need for Hoistables.
|
||||
updateHostComponent(current, workInProgress, type, newProps);
|
||||
} // This must come at the very end of the complete phase.
|
||||
|
||||
bubbleProperties(workInProgress);
|
||||
@@ -23707,14 +23667,12 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
var _type = workInProgress.type;
|
||||
|
||||
if (current !== null && workInProgress.stateNode != null) {
|
||||
if (diffInCommitPhase && supportsMutation) {
|
||||
{
|
||||
var _oldProps2 = current.memoizedProps;
|
||||
|
||||
if (_oldProps2 !== newProps) {
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} else {
|
||||
updateHostComponent(current, workInProgress, _type, newProps);
|
||||
}
|
||||
|
||||
if (current.ref !== workInProgress.ref) {
|
||||
@@ -23791,7 +23749,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var _currentHostContext2 = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
var _currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
// "stack" as the parent. Then append children as we go in beginWork
|
||||
// or completeWork depending on whether we want to add them top->down or
|
||||
// bottom->up. Top->down is faster in IE11.
|
||||
@@ -23801,13 +23759,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
if (_wasHydrated2) {
|
||||
// TODO: Move this and createInstance step into the beginPhase
|
||||
// to consolidate.
|
||||
if (
|
||||
prepareToHydrateHostInstance(workInProgress, _currentHostContext2)
|
||||
) {
|
||||
// If changes to the hydrated node need to be applied at the
|
||||
// commit-phase we mark this as such.
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
prepareToHydrateHostInstance(workInProgress, _currentHostContext);
|
||||
} else {
|
||||
var _rootContainerInstance = getRootHostContainer();
|
||||
|
||||
@@ -23815,7 +23767,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
_type2,
|
||||
newProps,
|
||||
_rootContainerInstance,
|
||||
_currentHostContext2,
|
||||
_currentHostContext,
|
||||
workInProgress
|
||||
);
|
||||
|
||||
@@ -23864,7 +23816,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
|
||||
var _rootContainerInstance2 = getRootHostContainer();
|
||||
|
||||
var _currentHostContext3 = getHostContext();
|
||||
var _currentHostContext2 = getHostContext();
|
||||
|
||||
var _wasHydrated3 = popHydrationState(workInProgress);
|
||||
|
||||
@@ -23876,7 +23828,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
workInProgress.stateNode = createTextInstance(
|
||||
newText,
|
||||
_rootContainerInstance2,
|
||||
_currentHostContext3,
|
||||
_currentHostContext2,
|
||||
workInProgress
|
||||
);
|
||||
}
|
||||
@@ -27178,23 +27130,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
finishedWork.stateNode,
|
||||
updatePayload,
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.memoizedProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
finishedWork.stateNode,
|
||||
updatePayload,
|
||||
finishedWork.type,
|
||||
current.memoizedProps,
|
||||
finishedWork.memoizedProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27266,23 +27212,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var _updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (_updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34483,7 +34423,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-a19b7375";
|
||||
var ReactVersion = "18.3.0-www-modern-ee02aecb";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
@@ -40748,128 +40688,6 @@ function setInitialProperties(domElement, tag, props) {
|
||||
|
||||
setProp(domElement, tag, _propKey6, _propValue6, props, null);
|
||||
}
|
||||
} // Calculate the diff between the two objects.
|
||||
|
||||
function diffProperties(domElement, tag, lastProps, nextProps) {
|
||||
{
|
||||
validatePropertiesInDevelopment(tag, nextProps);
|
||||
}
|
||||
|
||||
var updatePayload = null;
|
||||
var propKey;
|
||||
var styleName;
|
||||
var styleUpdates = null;
|
||||
|
||||
for (propKey in lastProps) {
|
||||
if (
|
||||
nextProps.hasOwnProperty(propKey) ||
|
||||
!lastProps.hasOwnProperty(propKey) ||
|
||||
lastProps[propKey] == null
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (propKey) {
|
||||
case "style": {
|
||||
var lastStyle = lastProps[propKey];
|
||||
|
||||
for (styleName in lastStyle) {
|
||||
if (lastStyle.hasOwnProperty(styleName)) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = "";
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
// For all other deleted properties we add it to the queue. We use
|
||||
// the allowed property list in the commit phase instead.
|
||||
(updatePayload = updatePayload || []).push(propKey, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (propKey in nextProps) {
|
||||
var nextProp = nextProps[propKey];
|
||||
var lastProp = lastProps != null ? lastProps[propKey] : undefined;
|
||||
|
||||
if (
|
||||
nextProps.hasOwnProperty(propKey) &&
|
||||
nextProp !== lastProp &&
|
||||
(nextProp != null || lastProp != null)
|
||||
) {
|
||||
switch (propKey) {
|
||||
case "style": {
|
||||
if (lastProp) {
|
||||
// Unset styles on `lastProp` but not on `nextProp`.
|
||||
for (styleName in lastProp) {
|
||||
if (
|
||||
lastProp.hasOwnProperty(styleName) &&
|
||||
(!nextProp || !nextProp.hasOwnProperty(styleName))
|
||||
) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = "";
|
||||
}
|
||||
} // Update styles that changed since `lastProp`.
|
||||
|
||||
for (styleName in nextProp) {
|
||||
if (
|
||||
nextProp.hasOwnProperty(styleName) &&
|
||||
lastProp[styleName] !== nextProp[styleName]
|
||||
) {
|
||||
if (!styleUpdates) {
|
||||
styleUpdates = {};
|
||||
}
|
||||
|
||||
styleUpdates[styleName] = nextProp[styleName];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Relies on `updateStylesByID` not mutating `styleUpdates`.
|
||||
if (!styleUpdates) {
|
||||
if (!updatePayload) {
|
||||
updatePayload = [];
|
||||
}
|
||||
|
||||
updatePayload.push(propKey, styleUpdates);
|
||||
}
|
||||
|
||||
styleUpdates = nextProp;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "is": {
|
||||
error('Cannot update the "is" prop after it has been initialized.');
|
||||
}
|
||||
|
||||
// Fall through
|
||||
|
||||
default: {
|
||||
(updatePayload = updatePayload || []).push(propKey, nextProp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (styleUpdates) {
|
||||
{
|
||||
validateShorthandPropertyCollisionInDev(lastProps.style, nextProps.style);
|
||||
}
|
||||
|
||||
(updatePayload = updatePayload || []).push("style", styleUpdates);
|
||||
}
|
||||
|
||||
return updatePayload;
|
||||
}
|
||||
function updateProperties(domElement, tag, lastProps, nextProps) {
|
||||
{
|
||||
@@ -41418,348 +41236,6 @@ function updateProperties(domElement, tag, lastProps, nextProps) {
|
||||
setProp(domElement, tag, _propKey19, _nextProp6, nextProps, _lastProp13);
|
||||
}
|
||||
}
|
||||
} // Apply the diff.
|
||||
|
||||
function updatePropertiesWithDiff(
|
||||
domElement,
|
||||
updatePayload,
|
||||
tag,
|
||||
lastProps,
|
||||
nextProps
|
||||
) {
|
||||
switch (tag) {
|
||||
case "div":
|
||||
case "span":
|
||||
case "svg":
|
||||
case "path":
|
||||
case "a":
|
||||
case "g":
|
||||
case "p":
|
||||
case "li": {
|
||||
// Fast track the most common tag types
|
||||
break;
|
||||
}
|
||||
|
||||
case "input": {
|
||||
var name = nextProps.name;
|
||||
var type = nextProps.type;
|
||||
var value = nextProps.value;
|
||||
var defaultValue = nextProps.defaultValue;
|
||||
var lastDefaultValue = lastProps.defaultValue;
|
||||
var checked = nextProps.checked;
|
||||
var defaultChecked = nextProps.defaultChecked;
|
||||
|
||||
for (var i = 0; i < updatePayload.length; i += 2) {
|
||||
var propKey = updatePayload[i];
|
||||
var propValue = updatePayload[i + 1];
|
||||
|
||||
switch (propKey) {
|
||||
case "type": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "name": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "checked": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "defaultChecked": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "value": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "defaultValue": {
|
||||
break;
|
||||
}
|
||||
|
||||
case "children":
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (propValue != null) {
|
||||
throw new Error(
|
||||
tag +
|
||||
" is a void element tag and must neither have `children` nor " +
|
||||
"use `dangerouslySetInnerHTML`."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
propKey,
|
||||
propValue,
|
||||
nextProps,
|
||||
lastProps[propKey]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var wasControlled =
|
||||
lastProps.type === "checkbox" || lastProps.type === "radio"
|
||||
? lastProps.checked != null
|
||||
: lastProps.value != null;
|
||||
var isControlled =
|
||||
nextProps.type === "checkbox" || nextProps.type === "radio"
|
||||
? nextProps.checked != null
|
||||
: nextProps.value != null;
|
||||
|
||||
if (
|
||||
!wasControlled &&
|
||||
isControlled &&
|
||||
!didWarnUncontrolledToControlled
|
||||
) {
|
||||
error(
|
||||
"A component is changing an uncontrolled input to be controlled. " +
|
||||
"This is likely caused by the value changing from undefined to " +
|
||||
"a defined value, which should not happen. " +
|
||||
"Decide between using a controlled or uncontrolled input " +
|
||||
"element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"
|
||||
);
|
||||
|
||||
didWarnUncontrolledToControlled = true;
|
||||
}
|
||||
|
||||
if (
|
||||
wasControlled &&
|
||||
!isControlled &&
|
||||
!didWarnControlledToUncontrolled
|
||||
) {
|
||||
error(
|
||||
"A component is changing a controlled input to be uncontrolled. " +
|
||||
"This is likely caused by the value changing from a defined to " +
|
||||
"undefined, which should not happen. " +
|
||||
"Decide between using a controlled or uncontrolled input " +
|
||||
"element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"
|
||||
);
|
||||
|
||||
didWarnControlledToUncontrolled = true;
|
||||
}
|
||||
} // Update the wrapper around inputs *after* updating props. This has to
|
||||
// happen after updating the rest of props. Otherwise HTML5 input validations
|
||||
// raise warnings and prevent the new value from being assigned.
|
||||
|
||||
updateInput(
|
||||
domElement,
|
||||
value,
|
||||
defaultValue,
|
||||
lastDefaultValue,
|
||||
checked,
|
||||
defaultChecked,
|
||||
type,
|
||||
name
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
case "select": {
|
||||
var _value5 = nextProps.value;
|
||||
var _defaultValue5 = nextProps.defaultValue;
|
||||
var multiple = nextProps.multiple;
|
||||
var wasMultiple = lastProps.multiple;
|
||||
|
||||
for (var _i = 0; _i < updatePayload.length; _i += 2) {
|
||||
var _propKey20 = updatePayload[_i];
|
||||
var _propValue7 = updatePayload[_i + 1];
|
||||
|
||||
switch (_propKey20) {
|
||||
case "value": {
|
||||
// This is handled by updateWrapper below.
|
||||
break;
|
||||
}
|
||||
// defaultValue are ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey20,
|
||||
_propValue7,
|
||||
nextProps,
|
||||
lastProps[_propKey20]
|
||||
);
|
||||
}
|
||||
}
|
||||
} // <select> value update needs to occur after <option> children
|
||||
// reconciliation
|
||||
|
||||
updateSelect(domElement, _value5, _defaultValue5, multiple, wasMultiple);
|
||||
return;
|
||||
}
|
||||
|
||||
case "textarea": {
|
||||
var _value6 = nextProps.value;
|
||||
var _defaultValue6 = nextProps.defaultValue;
|
||||
|
||||
for (var _i2 = 0; _i2 < updatePayload.length; _i2 += 2) {
|
||||
var _propKey21 = updatePayload[_i2];
|
||||
var _propValue8 = updatePayload[_i2 + 1];
|
||||
|
||||
switch (_propKey21) {
|
||||
case "value": {
|
||||
// This is handled by updateWrapper below.
|
||||
break;
|
||||
}
|
||||
|
||||
case "children": {
|
||||
// TODO: This doesn't actually do anything if it updates.
|
||||
break;
|
||||
}
|
||||
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (_propValue8 != null) {
|
||||
// TODO: Do we really need a special error message for this. It's also pretty blunt.
|
||||
throw new Error(
|
||||
"`dangerouslySetInnerHTML` does not make sense on <textarea>."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// defaultValue is ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey21,
|
||||
_propValue8,
|
||||
nextProps,
|
||||
lastProps[_propKey21]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateTextarea(domElement, _value6, _defaultValue6);
|
||||
return;
|
||||
}
|
||||
|
||||
case "option": {
|
||||
for (var _i3 = 0; _i3 < updatePayload.length; _i3 += 2) {
|
||||
var _propKey22 = updatePayload[_i3];
|
||||
var _propValue9 = updatePayload[_i3 + 1];
|
||||
|
||||
switch (_propKey22) {
|
||||
case "selected": {
|
||||
// TODO: Remove support for selected on option.
|
||||
domElement.selected =
|
||||
_propValue9 &&
|
||||
typeof _propValue9 !== "function" &&
|
||||
typeof _propValue9 !== "symbol";
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey22,
|
||||
_propValue9,
|
||||
nextProps,
|
||||
lastProps[_propKey22]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
case "img":
|
||||
case "link":
|
||||
case "area":
|
||||
case "base":
|
||||
case "br":
|
||||
case "col":
|
||||
case "embed":
|
||||
case "hr":
|
||||
case "keygen":
|
||||
case "meta":
|
||||
case "param":
|
||||
case "source":
|
||||
case "track":
|
||||
case "wbr":
|
||||
case "menuitem": {
|
||||
// Void elements
|
||||
for (var _i4 = 0; _i4 < updatePayload.length; _i4 += 2) {
|
||||
var _propKey23 = updatePayload[_i4];
|
||||
var _propValue10 = updatePayload[_i4 + 1];
|
||||
|
||||
switch (_propKey23) {
|
||||
case "children":
|
||||
case "dangerouslySetInnerHTML": {
|
||||
if (_propValue10 != null) {
|
||||
// TODO: Can we make this a DEV warning to avoid this deny list?
|
||||
throw new Error(
|
||||
tag +
|
||||
" is a void element tag and must neither have `children` nor " +
|
||||
"use `dangerouslySetInnerHTML`."
|
||||
);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// defaultChecked and defaultValue are ignored by setProp
|
||||
|
||||
default: {
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey23,
|
||||
_propValue10,
|
||||
nextProps,
|
||||
lastProps[_propKey23]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
default: {
|
||||
if (isCustomElement(tag)) {
|
||||
for (var _i5 = 0; _i5 < updatePayload.length; _i5 += 2) {
|
||||
var _propKey24 = updatePayload[_i5];
|
||||
var _propValue11 = updatePayload[_i5 + 1];
|
||||
setPropOnCustomElement(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey24,
|
||||
_propValue11,
|
||||
nextProps,
|
||||
lastProps[_propKey24]
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
} // Apply the diff.
|
||||
|
||||
for (var _i6 = 0; _i6 < updatePayload.length; _i6 += 2) {
|
||||
var _propKey25 = updatePayload[_i6];
|
||||
var _propValue12 = updatePayload[_i6 + 1];
|
||||
setProp(
|
||||
domElement,
|
||||
tag,
|
||||
_propKey25,
|
||||
_propValue12,
|
||||
nextProps,
|
||||
lastProps[_propKey25]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function getPossibleStandardName(propName) {
|
||||
@@ -42795,7 +42271,6 @@ function diffHydratedProperties(
|
||||
break;
|
||||
}
|
||||
|
||||
var updatePayload = null;
|
||||
var children = props.children; // For text content children we compare against textContent. This
|
||||
// might match additional HTML that is hidden when we read it using
|
||||
// textContent. E.g. "foo" will match "f<span>oo</span>" but that still
|
||||
@@ -42818,17 +42293,13 @@ function diffHydratedProperties(
|
||||
}
|
||||
|
||||
if (!isConcurrentMode || !enableClientRenderFallbackOnTextMismatch) {
|
||||
if (diffInCommitPhase) {
|
||||
// We really should be patching this in the commit phase but since
|
||||
// this only affects legacy mode hydration which is deprecated anyway
|
||||
// we can get away with it.
|
||||
// Host singletons get their children appended and don't use the text
|
||||
// content mechanism.
|
||||
if (tag !== "body") {
|
||||
domElement.textContent = children;
|
||||
}
|
||||
} else {
|
||||
updatePayload = ["children", children];
|
||||
// We really should be patching this in the commit phase but since
|
||||
// this only affects legacy mode hydration which is deprecated anyway
|
||||
// we can get away with it.
|
||||
// Host singletons get their children appended and don't use the text
|
||||
// content mechanism.
|
||||
if (tag !== "body") {
|
||||
domElement.textContent = children;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42847,8 +42318,8 @@ function diffHydratedProperties(
|
||||
var extraAttributes = new Set();
|
||||
var attributes = domElement.attributes;
|
||||
|
||||
for (var _i7 = 0; _i7 < attributes.length; _i7++) {
|
||||
var name = attributes[_i7].name.toLowerCase();
|
||||
for (var _i = 0; _i < attributes.length; _i++) {
|
||||
var name = attributes[_i].name.toLowerCase();
|
||||
|
||||
switch (name) {
|
||||
// Controlled attributes are not validated
|
||||
@@ -42865,7 +42336,7 @@ function diffHydratedProperties(
|
||||
default:
|
||||
// Intentionally use the original name.
|
||||
// See discussion in https://github.com/facebook/react/pull/10676.
|
||||
extraAttributes.add(attributes[_i7].name);
|
||||
extraAttributes.add(attributes[_i].name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42891,8 +42362,6 @@ function diffHydratedProperties(
|
||||
warnForExtraAttributes(extraAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
return updatePayload;
|
||||
}
|
||||
function diffHydratedText(textNode, text, isConcurrentMode) {
|
||||
var isDifferent = textNode.nodeValue !== text;
|
||||
@@ -43401,14 +42870,6 @@ function finalizeInitialChildren(domElement, type, props, hostContext) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function prepareUpdate(domElement, type, oldProps, newProps, hostContext) {
|
||||
if (diffInCommitPhase) {
|
||||
// TODO: Figure out how to validateDOMNesting when children turn into a string.
|
||||
return null;
|
||||
}
|
||||
|
||||
return diffProperties(domElement, type, oldProps, newProps);
|
||||
}
|
||||
function shouldSetTextContent(type, props) {
|
||||
return (
|
||||
type === "textarea" ||
|
||||
@@ -43498,10 +42959,6 @@ function handleErrorInNextTick(error) {
|
||||
throw error;
|
||||
});
|
||||
} // -------------------
|
||||
// Mutation
|
||||
// -------------------
|
||||
|
||||
var supportsMutation = true;
|
||||
function commitMount(domElement, type, newProps, internalInstanceHandle) {
|
||||
// Despite the naming that might imply otherwise, this method only
|
||||
// fires if there is an `Update` effect scheduled during mounting.
|
||||
@@ -43537,19 +42994,8 @@ function commitUpdate(
|
||||
newProps,
|
||||
internalInstanceHandle
|
||||
) {
|
||||
if (diffInCommitPhase) {
|
||||
// Diff and update the properties.
|
||||
updateProperties(domElement, type, oldProps, newProps);
|
||||
} else {
|
||||
// Apply the diff to the DOM node.
|
||||
updatePropertiesWithDiff(
|
||||
domElement,
|
||||
updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps
|
||||
);
|
||||
} // Update the props handle so that we know which props are the ones with
|
||||
// Diff and update the properties.
|
||||
updateProperties(domElement, type, oldProps, newProps); // Update the props handle so that we know which props are the ones with
|
||||
// with current event handlers.
|
||||
|
||||
updateFiberProps(domElement, newProps);
|
||||
@@ -44060,7 +43506,7 @@ function hydrateInstance(
|
||||
|
||||
var isConcurrentMode =
|
||||
(internalInstanceHandle.mode & ConcurrentMode) !== NoMode;
|
||||
return diffHydratedProperties(
|
||||
diffHydratedProperties(
|
||||
instance,
|
||||
type,
|
||||
props,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -140,7 +140,6 @@ var enableProfilerNestedUpdatePhase = true;
|
||||
var createRootStrictEffectsByDefault = false;
|
||||
var enableLazyContextPropagation = false;
|
||||
var enableLegacyHidden = false;
|
||||
var diffInCommitPhase = true;
|
||||
var enableAsyncActions = false;
|
||||
var alwaysThrottleRetries = true; // Flow magic to verify the exports of this file match the original version.
|
||||
|
||||
@@ -15518,9 +15517,7 @@ function updateHostComponent(
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} // This function must be called at the very end of the complete phase, because
|
||||
// it might throw to suspend, and if the resource immediately loads, the work
|
||||
@@ -15970,7 +15967,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var _currentHostContext2 = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
var _currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
// "stack" as the parent. Then append children as we go in beginWork
|
||||
// or completeWork depending on whether we want to add them top->down or
|
||||
// bottom->up. Top->down is faster in IE11.
|
||||
@@ -15980,11 +15977,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
if (_wasHydrated2) {
|
||||
// TODO: Move this and createInstance step into the beginPhase
|
||||
// to consolidate.
|
||||
if (prepareToHydrateHostInstance()) {
|
||||
// If changes to the hydrated node need to be applied at the
|
||||
// commit-phase we mark this as such.
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
prepareToHydrateHostInstance();
|
||||
} else {
|
||||
var _rootContainerInstance = getRootHostContainer();
|
||||
|
||||
@@ -15992,7 +15985,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
_type2,
|
||||
newProps,
|
||||
_rootContainerInstance,
|
||||
_currentHostContext2,
|
||||
_currentHostContext,
|
||||
workInProgress
|
||||
);
|
||||
|
||||
@@ -18683,23 +18676,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var _updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (_updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24360,7 +24347,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-c7ac40c0";
|
||||
var ReactVersion = "18.3.0-www-classic-29934d02";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
@@ -140,7 +140,6 @@ var enableProfilerNestedUpdatePhase = true;
|
||||
var createRootStrictEffectsByDefault = false;
|
||||
var enableLazyContextPropagation = false;
|
||||
var enableLegacyHidden = false;
|
||||
var diffInCommitPhase = true;
|
||||
var enableAsyncActions = false;
|
||||
var alwaysThrottleRetries = true; // Flow magic to verify the exports of this file match the original version.
|
||||
|
||||
@@ -15518,9 +15517,7 @@ function updateHostComponent(
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
} // This function must be called at the very end of the complete phase, because
|
||||
// it might throw to suspend, and if the resource immediately loads, the work
|
||||
@@ -15970,7 +15967,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var _currentHostContext2 = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
var _currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
|
||||
// "stack" as the parent. Then append children as we go in beginWork
|
||||
// or completeWork depending on whether we want to add them top->down or
|
||||
// bottom->up. Top->down is faster in IE11.
|
||||
@@ -15980,11 +15977,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
if (_wasHydrated2) {
|
||||
// TODO: Move this and createInstance step into the beginPhase
|
||||
// to consolidate.
|
||||
if (prepareToHydrateHostInstance()) {
|
||||
// If changes to the hydrated node need to be applied at the
|
||||
// commit-phase we mark this as such.
|
||||
markUpdate(workInProgress);
|
||||
}
|
||||
prepareToHydrateHostInstance();
|
||||
} else {
|
||||
var _rootContainerInstance = getRootHostContainer();
|
||||
|
||||
@@ -15992,7 +15985,7 @@ function completeWork(current, workInProgress, renderLanes) {
|
||||
_type2,
|
||||
newProps,
|
||||
_rootContainerInstance,
|
||||
_currentHostContext2,
|
||||
_currentHostContext,
|
||||
workInProgress
|
||||
);
|
||||
|
||||
@@ -18683,23 +18676,17 @@ function commitMutationEffectsOnFiber(finishedWork, root, lanes) {
|
||||
var _updatePayload = finishedWork.updateQueue;
|
||||
finishedWork.updateQueue = null;
|
||||
|
||||
if (_updatePayload !== null || diffInCommitPhase) {
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(
|
||||
finishedWork,
|
||||
finishedWork.return,
|
||||
error
|
||||
);
|
||||
}
|
||||
try {
|
||||
commitUpdate(
|
||||
_instance2,
|
||||
_updatePayload,
|
||||
type,
|
||||
oldProps,
|
||||
newProps,
|
||||
finishedWork
|
||||
);
|
||||
} catch (error) {
|
||||
captureCommitPhaseError(finishedWork, finishedWork.return, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24360,7 +24347,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-9ffb854c";
|
||||
var ReactVersion = "18.3.0-www-modern-cf02fff8";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user