From 1622d0f5f328e360be68650357826cd0fcd79005 Mon Sep 17 00:00:00 2001 From: poteto <1390709+poteto@users.noreply.github.com> Date: Tue, 11 Feb 2025 11:25:53 -0800 Subject: [PATCH] [crud] Remove useResourceEffect (#32206) Removes useResourceEffect. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32206). * __->__ #32206 * #32205 DiffTrain build for [a69b80d07e5d1bf363ed15d6209a55b35e0765c2](https://github.com/facebook/react/commit/a69b80d07e5d1bf363ed15d6209a55b35e0765c2) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/REVISION_TRANSFORMS | 2 +- compiled/facebook-www/React-dev.classic.js | 50 +- compiled/facebook-www/React-dev.modern.js | 50 +- compiled/facebook-www/React-prod.classic.js | 38 +- compiled/facebook-www/React-prod.modern.js | 38 +- .../facebook-www/React-profiling.classic.js | 38 +- .../facebook-www/React-profiling.modern.js | 38 +- compiled/facebook-www/ReactART-dev.classic.js | 678 ++++++----- compiled/facebook-www/ReactART-dev.modern.js | 678 ++++++----- .../facebook-www/ReactART-prod.classic.js | 650 +++++------ compiled/facebook-www/ReactART-prod.modern.js | 650 +++++------ compiled/facebook-www/ReactDOM-dev.classic.js | 1013 ++++++++--------- compiled/facebook-www/ReactDOM-dev.modern.js | 1013 ++++++++--------- .../facebook-www/ReactDOM-prod.classic.js | 735 ++++++------ compiled/facebook-www/ReactDOM-prod.modern.js | 735 ++++++------ .../ReactDOM-profiling.classic.js | 740 ++++++------ .../facebook-www/ReactDOM-profiling.modern.js | 740 ++++++------ .../ReactDOMServer-dev.classic.js | 9 +- .../facebook-www/ReactDOMServer-dev.modern.js | 9 +- .../ReactDOMServer-prod.classic.js | 182 +-- .../ReactDOMServer-prod.modern.js | 182 +-- .../ReactDOMServerStreaming-dev.modern.js | 7 +- .../ReactDOMServerStreaming-prod.modern.js | 190 ++-- .../ReactDOMTesting-dev.classic.js | 1013 ++++++++--------- .../ReactDOMTesting-dev.modern.js | 1013 ++++++++--------- .../ReactDOMTesting-prod.classic.js | 735 ++++++------ .../ReactDOMTesting-prod.modern.js | 735 ++++++------ .../ReactReconciler-dev.classic.js | 690 ++++++----- .../ReactReconciler-dev.modern.js | 690 ++++++----- .../ReactReconciler-prod.classic.js | 695 ++++++----- .../ReactReconciler-prod.modern.js | 695 ++++++----- .../ReactTestRenderer-dev.classic.js | 71 +- .../ReactTestRenderer-dev.modern.js | 71 +- compiled/facebook-www/VERSION_CLASSIC | 2 +- compiled/facebook-www/VERSION_MODERN | 2 +- .../__test_utils__/ReactAllWarnings.js | 4 +- 37 files changed, 7302 insertions(+), 7581 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index 1c9523a8b9..5011987b80 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -0461c0d8a49730d1c8ebca2071d9bb7adfc8ac92 +a69b80d07e5d1bf363ed15d6209a55b35e0765c2 diff --git a/compiled/facebook-www/REVISION_TRANSFORMS b/compiled/facebook-www/REVISION_TRANSFORMS index 1c9523a8b9..5011987b80 100644 --- a/compiled/facebook-www/REVISION_TRANSFORMS +++ b/compiled/facebook-www/REVISION_TRANSFORMS @@ -1 +1 @@ -0461c0d8a49730d1c8ebca2071d9bb7adfc8ac92 +a69b80d07e5d1bf363ed15d6209a55b35e0765c2 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index 36cb05941e..f8ae8f80dc 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -1011,22 +1011,6 @@ __DEV__ && function useMemoCache(size) { return resolveDispatcher().useMemoCache(size); } - function useResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ) { - if (!enableUseEffectCRUDOverload) throw Error("Not implemented."); - return resolveDispatcher().useResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - } function noop() {} function enqueueTask(task) { if (null === enqueueTaskImpl) @@ -1333,10 +1317,7 @@ __DEV__ && ); return children; } - }, - experimental_useResourceEffect = enableUseEffectCRUDOverload - ? useResourceEffect - : void 0; + }; exports.captureOwnerStack = void 0; enableOwnerStacks && (exports.captureOwnerStack = captureOwnerStack); exports.Children = Children; @@ -1703,7 +1684,6 @@ __DEV__ && exports.experimental_useEffectEvent = function (callback) { return resolveDispatcher().useEffectEvent(callback); }; - exports.experimental_useResourceEffect = experimental_useResourceEffect; exports.forwardRef = function (render) { null != render && render.$$typeof === REACT_MEMO_TYPE ? error$jscomp$0( @@ -1928,8 +1908,30 @@ __DEV__ && exports.useDeferredValue = function (value, initialValue) { return resolveDispatcher().useDeferredValue(value, initialValue); }; - exports.useEffect = function (create, deps) { - return resolveDispatcher().useEffect(create, deps); + exports.useEffect = function ( + create, + createDeps, + update, + updateDeps, + destroy + ) { + var dispatcher = resolveDispatcher(); + if ( + enableUseEffectCRUDOverload && + ("function" === typeof update || "function" === typeof destroy) + ) + return dispatcher.useEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); + if ("function" === typeof update) + throw Error( + "useEffect CRUD overload is not enabled in this build of React." + ); + return dispatcher.useEffect(create, createDeps); }; exports.useId = function () { return resolveDispatcher().useId(); @@ -1972,7 +1974,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.1.0-www-classic-0461c0d8-20250211"; + exports.version = "19.1.0-www-classic-a69b80d0-20250211"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-dev.modern.js b/compiled/facebook-www/React-dev.modern.js index 201eb1af69..3c5a3cf4a2 100644 --- a/compiled/facebook-www/React-dev.modern.js +++ b/compiled/facebook-www/React-dev.modern.js @@ -1011,22 +1011,6 @@ __DEV__ && function useMemoCache(size) { return resolveDispatcher().useMemoCache(size); } - function useResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ) { - if (!enableUseEffectCRUDOverload) throw Error("Not implemented."); - return resolveDispatcher().useResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - } function noop() {} function enqueueTask(task) { if (null === enqueueTaskImpl) @@ -1333,10 +1317,7 @@ __DEV__ && ); return children; } - }, - experimental_useResourceEffect = enableUseEffectCRUDOverload - ? useResourceEffect - : void 0; + }; exports.captureOwnerStack = void 0; enableOwnerStacks && (exports.captureOwnerStack = captureOwnerStack); exports.Children = Children; @@ -1703,7 +1684,6 @@ __DEV__ && exports.experimental_useEffectEvent = function (callback) { return resolveDispatcher().useEffectEvent(callback); }; - exports.experimental_useResourceEffect = experimental_useResourceEffect; exports.forwardRef = function (render) { null != render && render.$$typeof === REACT_MEMO_TYPE ? error$jscomp$0( @@ -1928,8 +1908,30 @@ __DEV__ && exports.useDeferredValue = function (value, initialValue) { return resolveDispatcher().useDeferredValue(value, initialValue); }; - exports.useEffect = function (create, deps) { - return resolveDispatcher().useEffect(create, deps); + exports.useEffect = function ( + create, + createDeps, + update, + updateDeps, + destroy + ) { + var dispatcher = resolveDispatcher(); + if ( + enableUseEffectCRUDOverload && + ("function" === typeof update || "function" === typeof destroy) + ) + return dispatcher.useEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); + if ("function" === typeof update) + throw Error( + "useEffect CRUD overload is not enabled in this build of React." + ); + return dispatcher.useEffect(create, createDeps); }; exports.useId = function () { return resolveDispatcher().useId(); @@ -1972,7 +1974,7 @@ __DEV__ && exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.1.0-www-modern-0461c0d8-20250211"; + exports.version = "19.1.0-www-modern-a69b80d0-20250211"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index 8934b8f914..b38b3dd5c8 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -325,16 +325,6 @@ function lazyInitializer(payload) { function useMemoCache(size) { return ReactSharedInternals.H.useMemoCache(size); } -function useResourceEffect(create, createDeps, update, updateDeps, destroy) { - if (!enableUseEffectCRUDOverload) throw Error("Not implemented."); - return ReactSharedInternals.H.useResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); -} var reportGlobalError = "function" === typeof reportError ? reportError @@ -365,10 +355,7 @@ var reportGlobalError = console.error(error); }; function noop() {} -var ReactCompilerRuntime = { __proto__: null, c: useMemoCache }, - experimental_useResourceEffect = enableUseEffectCRUDOverload - ? useResourceEffect - : void 0; +var ReactCompilerRuntime = { __proto__: null, c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -512,7 +499,6 @@ exports.createRef = function () { exports.experimental_useEffectEvent = function (callback) { return ReactSharedInternals.H.useEffectEvent(callback); }; -exports.experimental_useResourceEffect = experimental_useResourceEffect; exports.forwardRef = function (render) { return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; }; @@ -595,8 +581,24 @@ exports.useDebugValue = function () {}; exports.useDeferredValue = function (value, initialValue) { return ReactSharedInternals.H.useDeferredValue(value, initialValue); }; -exports.useEffect = function (create, deps) { - return ReactSharedInternals.H.useEffect(create, deps); +exports.useEffect = function (create, createDeps, update, updateDeps, destroy) { + var dispatcher = ReactSharedInternals.H; + if ( + enableUseEffectCRUDOverload && + ("function" === typeof update || "function" === typeof destroy) + ) + return dispatcher.useEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); + if ("function" === typeof update) + throw Error( + "useEffect CRUD overload is not enabled in this build of React." + ); + return dispatcher.useEffect(create, createDeps); }; exports.useId = function () { return ReactSharedInternals.H.useId(); @@ -639,4 +641,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-classic-0461c0d8-20250211"; +exports.version = "19.1.0-www-classic-a69b80d0-20250211"; diff --git a/compiled/facebook-www/React-prod.modern.js b/compiled/facebook-www/React-prod.modern.js index 499628b7ef..9355b0d8e6 100644 --- a/compiled/facebook-www/React-prod.modern.js +++ b/compiled/facebook-www/React-prod.modern.js @@ -325,16 +325,6 @@ function lazyInitializer(payload) { function useMemoCache(size) { return ReactSharedInternals.H.useMemoCache(size); } -function useResourceEffect(create, createDeps, update, updateDeps, destroy) { - if (!enableUseEffectCRUDOverload) throw Error("Not implemented."); - return ReactSharedInternals.H.useResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); -} var reportGlobalError = "function" === typeof reportError ? reportError @@ -365,10 +355,7 @@ var reportGlobalError = console.error(error); }; function noop() {} -var ReactCompilerRuntime = { __proto__: null, c: useMemoCache }, - experimental_useResourceEffect = enableUseEffectCRUDOverload - ? useResourceEffect - : void 0; +var ReactCompilerRuntime = { __proto__: null, c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -512,7 +499,6 @@ exports.createRef = function () { exports.experimental_useEffectEvent = function (callback) { return ReactSharedInternals.H.useEffectEvent(callback); }; -exports.experimental_useResourceEffect = experimental_useResourceEffect; exports.forwardRef = function (render) { return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; }; @@ -595,8 +581,24 @@ exports.useDebugValue = function () {}; exports.useDeferredValue = function (value, initialValue) { return ReactSharedInternals.H.useDeferredValue(value, initialValue); }; -exports.useEffect = function (create, deps) { - return ReactSharedInternals.H.useEffect(create, deps); +exports.useEffect = function (create, createDeps, update, updateDeps, destroy) { + var dispatcher = ReactSharedInternals.H; + if ( + enableUseEffectCRUDOverload && + ("function" === typeof update || "function" === typeof destroy) + ) + return dispatcher.useEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); + if ("function" === typeof update) + throw Error( + "useEffect CRUD overload is not enabled in this build of React." + ); + return dispatcher.useEffect(create, createDeps); }; exports.useId = function () { return ReactSharedInternals.H.useId(); @@ -639,4 +641,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-modern-0461c0d8-20250211"; +exports.version = "19.1.0-www-modern-a69b80d0-20250211"; diff --git a/compiled/facebook-www/React-profiling.classic.js b/compiled/facebook-www/React-profiling.classic.js index 0d34dede93..f11cf87e0e 100644 --- a/compiled/facebook-www/React-profiling.classic.js +++ b/compiled/facebook-www/React-profiling.classic.js @@ -329,16 +329,6 @@ function lazyInitializer(payload) { function useMemoCache(size) { return ReactSharedInternals.H.useMemoCache(size); } -function useResourceEffect(create, createDeps, update, updateDeps, destroy) { - if (!enableUseEffectCRUDOverload) throw Error("Not implemented."); - return ReactSharedInternals.H.useResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); -} var reportGlobalError = "function" === typeof reportError ? reportError @@ -369,10 +359,7 @@ var reportGlobalError = console.error(error); }; function noop() {} -var ReactCompilerRuntime = { __proto__: null, c: useMemoCache }, - experimental_useResourceEffect = enableUseEffectCRUDOverload - ? useResourceEffect - : void 0; +var ReactCompilerRuntime = { __proto__: null, c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -516,7 +503,6 @@ exports.createRef = function () { exports.experimental_useEffectEvent = function (callback) { return ReactSharedInternals.H.useEffectEvent(callback); }; -exports.experimental_useResourceEffect = experimental_useResourceEffect; exports.forwardRef = function (render) { return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; }; @@ -599,8 +585,24 @@ exports.useDebugValue = function () {}; exports.useDeferredValue = function (value, initialValue) { return ReactSharedInternals.H.useDeferredValue(value, initialValue); }; -exports.useEffect = function (create, deps) { - return ReactSharedInternals.H.useEffect(create, deps); +exports.useEffect = function (create, createDeps, update, updateDeps, destroy) { + var dispatcher = ReactSharedInternals.H; + if ( + enableUseEffectCRUDOverload && + ("function" === typeof update || "function" === typeof destroy) + ) + return dispatcher.useEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); + if ("function" === typeof update) + throw Error( + "useEffect CRUD overload is not enabled in this build of React." + ); + return dispatcher.useEffect(create, createDeps); }; exports.useId = function () { return ReactSharedInternals.H.useId(); @@ -643,7 +645,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-classic-0461c0d8-20250211"; +exports.version = "19.1.0-www-classic-a69b80d0-20250211"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/React-profiling.modern.js b/compiled/facebook-www/React-profiling.modern.js index dac25f9097..8d877d1aab 100644 --- a/compiled/facebook-www/React-profiling.modern.js +++ b/compiled/facebook-www/React-profiling.modern.js @@ -329,16 +329,6 @@ function lazyInitializer(payload) { function useMemoCache(size) { return ReactSharedInternals.H.useMemoCache(size); } -function useResourceEffect(create, createDeps, update, updateDeps, destroy) { - if (!enableUseEffectCRUDOverload) throw Error("Not implemented."); - return ReactSharedInternals.H.useResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); -} var reportGlobalError = "function" === typeof reportError ? reportError @@ -369,10 +359,7 @@ var reportGlobalError = console.error(error); }; function noop() {} -var ReactCompilerRuntime = { __proto__: null, c: useMemoCache }, - experimental_useResourceEffect = enableUseEffectCRUDOverload - ? useResourceEffect - : void 0; +var ReactCompilerRuntime = { __proto__: null, c: useMemoCache }; exports.Children = { map: mapChildren, forEach: function (children, forEachFunc, forEachContext) { @@ -516,7 +503,6 @@ exports.createRef = function () { exports.experimental_useEffectEvent = function (callback) { return ReactSharedInternals.H.useEffectEvent(callback); }; -exports.experimental_useResourceEffect = experimental_useResourceEffect; exports.forwardRef = function (render) { return { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; }; @@ -599,8 +585,24 @@ exports.useDebugValue = function () {}; exports.useDeferredValue = function (value, initialValue) { return ReactSharedInternals.H.useDeferredValue(value, initialValue); }; -exports.useEffect = function (create, deps) { - return ReactSharedInternals.H.useEffect(create, deps); +exports.useEffect = function (create, createDeps, update, updateDeps, destroy) { + var dispatcher = ReactSharedInternals.H; + if ( + enableUseEffectCRUDOverload && + ("function" === typeof update || "function" === typeof destroy) + ) + return dispatcher.useEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); + if ("function" === typeof update) + throw Error( + "useEffect CRUD overload is not enabled in this build of React." + ); + return dispatcher.useEffect(create, createDeps); }; exports.useId = function () { return ReactSharedInternals.H.useId(); @@ -643,7 +645,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.1.0-www-modern-0461c0d8-20250211"; +exports.version = "19.1.0-www-modern-a69b80d0-20250211"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.classic.js b/compiled/facebook-www/ReactART-dev.classic.js index 0153dd917f..e18ef8e2a0 100644 --- a/compiled/facebook-www/ReactART-dev.classic.js +++ b/compiled/facebook-www/ReactART-dev.classic.js @@ -3743,8 +3743,9 @@ __DEV__ && ) (hook.memoizedState = nextSnapshot), (didReceiveUpdate = !0); hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); if ( hook.getSnapshot !== getSnapshot || cachedSnapshot || @@ -4099,11 +4100,11 @@ __DEV__ && currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { + function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -4160,15 +4161,15 @@ __DEV__ && initialValue = { current: initialValue }; return (hook.memoizedState = initialValue); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -4187,11 +4188,47 @@ __DEV__ && deps ))); } - function mountEffect(create, deps) { + function mountEffect(create, createDeps, update, updateDeps, destroy) { 0 !== (currentlyRenderingFiber.mode & 16) && 0 === (currentlyRenderingFiber.mode & 64) - ? mountEffectImpl(276826112, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + ? !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(276826112, Passive, create, createDeps) + : mountResourceEffectImpl( + 276826112, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ) + : !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(8390656, Passive, create, createDeps) + : mountResourceEffectImpl( + 8390656, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); + } + function updateEffect(create, createDeps, update, updateDeps, destroy) { + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? updateEffectImpl(2048, Passive, create, createDeps) + : updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); } function mountResourceEffect( create, @@ -4200,39 +4237,40 @@ __DEV__ && updateDeps, destroy ) { - if ( - 0 !== (currentlyRenderingFiber.mode & 16) && - 0 === (currentlyRenderingFiber.mode & 64) - ) { - var hookFlags = Passive, - hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 276826112; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, + (0 !== (currentlyRenderingFiber.mode & 16) && + 0 === (currentlyRenderingFiber.mode & 64)) || + mountResourceEffectImpl( + 8390656, + Passive, create, createDeps, update, - updateDeps + updateDeps, + destroy ); - } else - (hookFlags = Passive), - (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber.flags |= 8390656), - (inst = createEffectInstance()), - (inst.destroy = destroy), - (hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps - )); + } + function mountResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy + ) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= fiberFlags; + fiberFlags = createEffectInstance(); + fiberFlags.destroy = destroy; + hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + fiberFlags, + create, + createDeps, + update, + updateDeps + ); } function updateResourceEffectImpl( fiberFlags, @@ -9679,7 +9717,7 @@ __DEV__ && )), null == updateQueue.inst.resource && error$jscomp$0( - "useResourceEffect must provide a callback which returns a resource. If a managed resource is not needed here, use useEffect. Received %s", + "useEffect must provide a callback which returns a resource. If a managed resource is not needed here, do not provide an updater or destroy callback. Received %s", updateQueue.inst.resource ), (lastEffect = updateQueue.inst.destroy)), @@ -9729,10 +9767,7 @@ __DEV__ && ? "useLayoutEffect" : 0 !== (updateQueue.tag & Insertion) ? "useInsertionEffect" - : enableUseEffectCRUDOverload && - null != updateQueue.resourceKind - ? "useResourceEffect" - : "useEffect"; + : "useEffect"; var addendum = void 0; addendum = null === lastEffect @@ -9767,7 +9802,7 @@ __DEV__ && function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -9779,10 +9814,10 @@ __DEV__ && if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) { - enableUseEffectCRUDOverload + void 0 !== destroy && + (enableUseEffectCRUDOverload ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0); + : (inst.destroy = void 0), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -9799,51 +9834,38 @@ __DEV__ && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( finishedWork - )); + )), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0); - if (enableUseEffectCRUDOverload) { - if ( - updateQueue.resourceKind === ResourceEffectIdentityKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = - nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - runWithFiberInDEV( - lastEffect, - callDestroyInDEV, - lastEffect, + (isRunningInsertionEffect = !0), + enableUseEffectCRUDOverload + ? (updateQueue.resourceKind === ResourceEffectIdentityKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy, + updateQueue.inst.resource + ), + updateQueue.next.resourceKind === ResourceEffectUpdateKind + ? (updateQueue.next.update = void 0) + : error$jscomp$0( + "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", + updateQueue.next.resourceKind + ), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - destroy_ - ); - updateQueue.next.resourceKind === ResourceEffectUpdateKind - ? (updateQueue.next.update = void 0) - : error$jscomp$0( - "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", - updateQueue.next.resourceKind - ); - updateQueue.inst.resource = null; - } - null == updateQueue.resourceKind && - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, destroy - ); - } else - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, - destroy - ); + ), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1); + (isRunningInsertionEffect = !1), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -9856,8 +9878,7 @@ __DEV__ && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); - } + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -10083,6 +10104,21 @@ __DEV__ && } else ref.current = null; } + function safelyCallDestroy( + current, + nearestMountedAncestor, + destroy, + resource + ) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + runWithFiberInDEV( + current, + callDestroyInDEV, + current, + nearestMountedAncestor, + destroy + ); + } function commitProfiler( finishedWork, current, @@ -15643,8 +15679,6 @@ __DEV__ && useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -15668,132 +15702,16 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountEffect(create, deps); - }, - useImperativeHandle: function (ref, create, deps) { - currentHookNameInDev = "useImperativeHandle"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountImperativeHandle(ref, create, deps); - }, - useInsertionEffect: function (create, deps) { - currentHookNameInDev = "useInsertionEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - mountEffectImpl(4, Insertion, create, deps); - }, - useLayoutEffect: function (create, deps) { - currentHookNameInDev = "useLayoutEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountLayoutEffect(create, deps); - }, - useMemo: function (create, deps) { - currentHookNameInDev = "useMemo"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountMemo(create, deps); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useReducer: function (reducer, initialArg, init) { - currentHookNameInDev = "useReducer"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountReducer(reducer, initialArg, init); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useRef: function (initialValue) { - currentHookNameInDev = "useRef"; - mountHookTypesDev(); - return mountRef(initialValue); - }, - useState: function (initialState) { - currentHookNameInDev = "useState"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountState(initialState); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useDebugValue: function () { - currentHookNameInDev = "useDebugValue"; - mountHookTypesDev(); - }, - useDeferredValue: function (value, initialValue) { - currentHookNameInDev = "useDeferredValue"; - mountHookTypesDev(); - return mountDeferredValue(value, initialValue); - }, - useTransition: function () { - currentHookNameInDev = "useTransition"; - mountHookTypesDev(); - return mountTransition(); - }, - useSyncExternalStore: function (subscribe, getSnapshot) { - currentHookNameInDev = "useSyncExternalStore"; - mountHookTypesDev(); - return mountSyncExternalStore(subscribe, getSnapshot); - }, - useId: function () { - currentHookNameInDev = "useId"; - mountHookTypesDev(); - return mountId(); - }, - useFormState: function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }, - useActionState: function (action, initialState) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }, - useOptimistic: function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }, - useHostTransitionStatus: useHostTransitionStatus, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; - mountHookTypesDev(); - return mountRefresh(); - }, - useEffectEvent: function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - } - }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - mountHookTypesDev(); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return ( + checkDepsAreArrayDev(createDeps), mountEffect(create, createDeps) + ); void 0 !== updateDeps && null !== updateDeps && isArrayImpl(updateDeps) && @@ -15809,7 +15727,117 @@ __DEV__ && updateDeps, destroy ); - }); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function (create, deps) { + currentHookNameInDev = "useInsertionEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + mountEffectImpl(4, Insertion, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = "useLayoutEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = "useMemo"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = "useRef"; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = "useState"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useDebugValue: function () { + currentHookNameInDev = "useDebugValue"; + mountHookTypesDev(); + }, + useDeferredValue: function (value, initialValue) { + currentHookNameInDev = "useDeferredValue"; + mountHookTypesDev(); + return mountDeferredValue(value, initialValue); + }, + useTransition: function () { + currentHookNameInDev = "useTransition"; + mountHookTypesDev(); + return mountTransition(); + }, + useSyncExternalStore: function (subscribe, getSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + mountHookTypesDev(); + return mountSyncExternalStore(subscribe, getSnapshot); + }, + useId: function () { + currentHookNameInDev = "useId"; + mountHookTypesDev(); + return mountId(); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); + } + }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -15825,10 +15853,19 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -15936,24 +15973,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -15969,10 +15988,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -16080,26 +16112,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -16115,10 +16127,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -16226,26 +16251,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16267,11 +16272,20 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); mountHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -16397,25 +16411,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16437,11 +16432,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -16567,27 +16575,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16609,11 +16596,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -16739,22 +16739,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnRerenderInDEV.useResourceEffect = - function (create, createDeps, update, updateDeps, destroy) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -17413,10 +17397,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-0461c0d8-20250211", + version: "19.1.0-www-classic-a69b80d0-20250211", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-classic-a69b80d0-20250211" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -17450,7 +17434,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.1.0-www-classic-0461c0d8-20250211"; + exports.version = "19.1.0-www-classic-a69b80d0-20250211"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-dev.modern.js b/compiled/facebook-www/ReactART-dev.modern.js index 7b85edf759..13de018540 100644 --- a/compiled/facebook-www/ReactART-dev.modern.js +++ b/compiled/facebook-www/ReactART-dev.modern.js @@ -3649,8 +3649,9 @@ __DEV__ && ) (hook.memoizedState = nextSnapshot), (didReceiveUpdate = !0); hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); if ( hook.getSnapshot !== getSnapshot || cachedSnapshot || @@ -4005,11 +4006,11 @@ __DEV__ && currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { + function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -4066,15 +4067,15 @@ __DEV__ && initialValue = { current: initialValue }; return (hook.memoizedState = initialValue); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -4093,11 +4094,47 @@ __DEV__ && deps ))); } - function mountEffect(create, deps) { + function mountEffect(create, createDeps, update, updateDeps, destroy) { 0 !== (currentlyRenderingFiber.mode & 16) && 0 === (currentlyRenderingFiber.mode & 64) - ? mountEffectImpl(276826112, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + ? !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(276826112, Passive, create, createDeps) + : mountResourceEffectImpl( + 276826112, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ) + : !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(8390656, Passive, create, createDeps) + : mountResourceEffectImpl( + 8390656, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); + } + function updateEffect(create, createDeps, update, updateDeps, destroy) { + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? updateEffectImpl(2048, Passive, create, createDeps) + : updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); } function mountResourceEffect( create, @@ -4106,39 +4143,40 @@ __DEV__ && updateDeps, destroy ) { - if ( - 0 !== (currentlyRenderingFiber.mode & 16) && - 0 === (currentlyRenderingFiber.mode & 64) - ) { - var hookFlags = Passive, - hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 276826112; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, + (0 !== (currentlyRenderingFiber.mode & 16) && + 0 === (currentlyRenderingFiber.mode & 64)) || + mountResourceEffectImpl( + 8390656, + Passive, create, createDeps, update, - updateDeps + updateDeps, + destroy ); - } else - (hookFlags = Passive), - (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber.flags |= 8390656), - (inst = createEffectInstance()), - (inst.destroy = destroy), - (hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps - )); + } + function mountResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy + ) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= fiberFlags; + fiberFlags = createEffectInstance(); + fiberFlags.destroy = destroy; + hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + fiberFlags, + create, + createDeps, + update, + updateDeps + ); } function updateResourceEffectImpl( fiberFlags, @@ -9497,7 +9535,7 @@ __DEV__ && )), null == updateQueue.inst.resource && error$jscomp$0( - "useResourceEffect must provide a callback which returns a resource. If a managed resource is not needed here, use useEffect. Received %s", + "useEffect must provide a callback which returns a resource. If a managed resource is not needed here, do not provide an updater or destroy callback. Received %s", updateQueue.inst.resource ), (lastEffect = updateQueue.inst.destroy)), @@ -9547,10 +9585,7 @@ __DEV__ && ? "useLayoutEffect" : 0 !== (updateQueue.tag & Insertion) ? "useInsertionEffect" - : enableUseEffectCRUDOverload && - null != updateQueue.resourceKind - ? "useResourceEffect" - : "useEffect"; + : "useEffect"; var addendum = void 0; addendum = null === lastEffect @@ -9585,7 +9620,7 @@ __DEV__ && function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -9597,10 +9632,10 @@ __DEV__ && if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) { - enableUseEffectCRUDOverload + void 0 !== destroy && + (enableUseEffectCRUDOverload ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0); + : (inst.destroy = void 0), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -9617,51 +9652,38 @@ __DEV__ && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( finishedWork - )); + )), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0); - if (enableUseEffectCRUDOverload) { - if ( - updateQueue.resourceKind === ResourceEffectIdentityKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = - nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - runWithFiberInDEV( - lastEffect, - callDestroyInDEV, - lastEffect, + (isRunningInsertionEffect = !0), + enableUseEffectCRUDOverload + ? (updateQueue.resourceKind === ResourceEffectIdentityKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy, + updateQueue.inst.resource + ), + updateQueue.next.resourceKind === ResourceEffectUpdateKind + ? (updateQueue.next.update = void 0) + : error$jscomp$0( + "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", + updateQueue.next.resourceKind + ), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - destroy_ - ); - updateQueue.next.resourceKind === ResourceEffectUpdateKind - ? (updateQueue.next.update = void 0) - : error$jscomp$0( - "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", - updateQueue.next.resourceKind - ); - updateQueue.inst.resource = null; - } - null == updateQueue.resourceKind && - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, destroy - ); - } else - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, - destroy - ); + ), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1); + (isRunningInsertionEffect = !1), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -9674,8 +9696,7 @@ __DEV__ && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); - } + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -9901,6 +9922,21 @@ __DEV__ && } else ref.current = null; } + function safelyCallDestroy( + current, + nearestMountedAncestor, + destroy, + resource + ) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + runWithFiberInDEV( + current, + callDestroyInDEV, + current, + nearestMountedAncestor, + destroy + ); + } function commitProfiler( finishedWork, current, @@ -15416,8 +15452,6 @@ __DEV__ && useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -15441,132 +15475,16 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountEffect(create, deps); - }, - useImperativeHandle: function (ref, create, deps) { - currentHookNameInDev = "useImperativeHandle"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountImperativeHandle(ref, create, deps); - }, - useInsertionEffect: function (create, deps) { - currentHookNameInDev = "useInsertionEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - mountEffectImpl(4, Insertion, create, deps); - }, - useLayoutEffect: function (create, deps) { - currentHookNameInDev = "useLayoutEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountLayoutEffect(create, deps); - }, - useMemo: function (create, deps) { - currentHookNameInDev = "useMemo"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountMemo(create, deps); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useReducer: function (reducer, initialArg, init) { - currentHookNameInDev = "useReducer"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountReducer(reducer, initialArg, init); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useRef: function (initialValue) { - currentHookNameInDev = "useRef"; - mountHookTypesDev(); - return mountRef(initialValue); - }, - useState: function (initialState) { - currentHookNameInDev = "useState"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountState(initialState); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useDebugValue: function () { - currentHookNameInDev = "useDebugValue"; - mountHookTypesDev(); - }, - useDeferredValue: function (value, initialValue) { - currentHookNameInDev = "useDeferredValue"; - mountHookTypesDev(); - return mountDeferredValue(value, initialValue); - }, - useTransition: function () { - currentHookNameInDev = "useTransition"; - mountHookTypesDev(); - return mountTransition(); - }, - useSyncExternalStore: function (subscribe, getSnapshot) { - currentHookNameInDev = "useSyncExternalStore"; - mountHookTypesDev(); - return mountSyncExternalStore(subscribe, getSnapshot); - }, - useId: function () { - currentHookNameInDev = "useId"; - mountHookTypesDev(); - return mountId(); - }, - useFormState: function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }, - useActionState: function (action, initialState) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }, - useOptimistic: function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }, - useHostTransitionStatus: useHostTransitionStatus, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; - mountHookTypesDev(); - return mountRefresh(); - }, - useEffectEvent: function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - } - }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - mountHookTypesDev(); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return ( + checkDepsAreArrayDev(createDeps), mountEffect(create, createDeps) + ); void 0 !== updateDeps && null !== updateDeps && isArrayImpl(updateDeps) && @@ -15582,7 +15500,117 @@ __DEV__ && updateDeps, destroy ); - }); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function (create, deps) { + currentHookNameInDev = "useInsertionEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + mountEffectImpl(4, Insertion, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = "useLayoutEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = "useMemo"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = "useRef"; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = "useState"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useDebugValue: function () { + currentHookNameInDev = "useDebugValue"; + mountHookTypesDev(); + }, + useDeferredValue: function (value, initialValue) { + currentHookNameInDev = "useDeferredValue"; + mountHookTypesDev(); + return mountDeferredValue(value, initialValue); + }, + useTransition: function () { + currentHookNameInDev = "useTransition"; + mountHookTypesDev(); + return mountTransition(); + }, + useSyncExternalStore: function (subscribe, getSnapshot) { + currentHookNameInDev = "useSyncExternalStore"; + mountHookTypesDev(); + return mountSyncExternalStore(subscribe, getSnapshot); + }, + useId: function () { + currentHookNameInDev = "useId"; + mountHookTypesDev(); + return mountId(); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); + } + }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -15598,10 +15626,19 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -15709,24 +15746,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -15742,10 +15761,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -15853,26 +15885,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -15888,10 +15900,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -15999,26 +16024,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16040,11 +16045,20 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); mountHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -16170,25 +16184,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16210,11 +16205,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -16340,27 +16348,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -16382,11 +16369,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -16512,22 +16512,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnRerenderInDEV.useResourceEffect = - function (create, createDeps, update, updateDeps, destroy) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -17185,10 +17169,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-0461c0d8-20250211", + version: "19.1.0-www-modern-a69b80d0-20250211", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-modern-a69b80d0-20250211" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -17222,7 +17206,7 @@ __DEV__ && exports.Shape = Shape; exports.Surface = Surface; exports.Text = Text; - exports.version = "19.1.0-www-modern-0461c0d8-20250211"; + exports.version = "19.1.0-www-modern-a69b80d0-20250211"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactART-prod.classic.js b/compiled/facebook-www/ReactART-prod.classic.js index 7517757cb1..0140ae8359 100644 --- a/compiled/facebook-www/ReactART-prod.classic.js +++ b/compiled/facebook-www/ReactART-prod.classic.js @@ -2746,11 +2746,11 @@ function rerenderActionState(action) { currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } -function pushSimpleEffect(tag, inst, create, deps) { +function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -2805,15 +2805,15 @@ function createEffectInstance() { function updateRef() { return updateWorkInProgressHook().memoizedState; } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { +function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -2832,60 +2832,68 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { deps ))); } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function mountEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + mountEffectImpl(8390656, 8, create, createDeps); + else { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); + } } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); -} -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); -} -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); +function updateEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + updateEffectImpl(2048, 8, create, createDeps); + else { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } function useEffectEventImpl(payload) { currentlyRenderingFiber.flags |= 4; @@ -3212,231 +3220,225 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + var nextSnapshot = getSnapshot(); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + hook.memoizedState = nextSnapshot; + var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), + null + ); + return nextSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix, + globalClientId = globalClientIdCounter++; + identifierPrefix = + ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - var nextSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); - hook.memoizedState = nextSnapshot; - var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), - null - ); - return nextSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix, - globalClientId = globalClientIdCounter++; - identifierPrefix = - ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; - } -}; -enableUseEffectCRUDOverload && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -3490,8 +3492,6 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -7103,7 +7103,7 @@ function commitHookEffectListMount(flags, finishedWork) { function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -7115,59 +7115,33 @@ function commitHookEffectListUnmount( if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) - if ( - (enableUseEffectCRUDOverload - ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0), - enableUseEffectCRUDOverload) - ) { - if ( - 0 === updateQueue.resourceKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + void 0 !== destroy && + (enableUseEffectCRUDOverload + ? null == updateQueue.resourceKind && (inst.destroy = void 0) + : (inst.destroy = void 0), + enableUseEffectCRUDOverload + ? (0 === updateQueue.resourceKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - 1 === updateQueue.next.resourceKind && - (updateQueue.next.update = void 0); - updateQueue.inst.resource = null; - } - if (null == updateQueue.resourceKind) { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy, + updateQueue.inst.resource + ), + 1 === updateQueue.next.resourceKind && + (updateQueue.next.update = void 0), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } - } else { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } + destroy + )); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -7256,6 +7230,14 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else ref.current = null; } +function safelyCallDestroy(current, nearestMountedAncestor, destroy, resource) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } +} function commitProfilerPostCommit( finishedWork, current, @@ -11271,24 +11253,24 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component); -var internals$jscomp$inline_1567 = { +var internals$jscomp$inline_1550 = { bundleType: 0, - version: "19.1.0-www-classic-0461c0d8-20250211", + version: "19.1.0-www-classic-a69b80d0-20250211", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-classic-a69b80d0-20250211" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1568 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1551 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1568.isDisabled && - hook$jscomp$inline_1568.supportsFiber + !hook$jscomp$inline_1551.isDisabled && + hook$jscomp$inline_1551.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1568.inject( - internals$jscomp$inline_1567 + (rendererID = hook$jscomp$inline_1551.inject( + internals$jscomp$inline_1550 )), - (injectedHook = hook$jscomp$inline_1568); + (injectedHook = hook$jscomp$inline_1551); } catch (err) {} } var Path = Mode$1.Path; @@ -11302,4 +11284,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.1.0-www-classic-0461c0d8-20250211"; +exports.version = "19.1.0-www-classic-a69b80d0-20250211"; diff --git a/compiled/facebook-www/ReactART-prod.modern.js b/compiled/facebook-www/ReactART-prod.modern.js index 8f41cee565..b33e5b97bd 100644 --- a/compiled/facebook-www/ReactART-prod.modern.js +++ b/compiled/facebook-www/ReactART-prod.modern.js @@ -2603,11 +2603,11 @@ function rerenderActionState(action) { currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } -function pushSimpleEffect(tag, inst, create, deps) { +function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -2662,15 +2662,15 @@ function createEffectInstance() { function updateRef() { return updateWorkInProgressHook().memoizedState; } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { +function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -2689,60 +2689,68 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { deps ))); } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function mountEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + mountEffectImpl(8390656, 8, create, createDeps); + else { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); + } } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); -} -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); -} -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); +function updateEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + updateEffectImpl(2048, 8, create, createDeps); + else { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } function useEffectEventImpl(payload) { currentlyRenderingFiber.flags |= 4; @@ -3069,231 +3077,225 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + var nextSnapshot = getSnapshot(); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + hook.memoizedState = nextSnapshot; + var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), + null + ); + return nextSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix, + globalClientId = globalClientIdCounter++; + identifierPrefix = + ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - var nextSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); - hook.memoizedState = nextSnapshot; - var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), - null - ); - return nextSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix, - globalClientId = globalClientIdCounter++; - identifierPrefix = - ":" + identifierPrefix + "r" + globalClientId.toString(32) + ":"; - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; - } -}; -enableUseEffectCRUDOverload && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -3347,8 +3349,6 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -6857,7 +6857,7 @@ function commitHookEffectListMount(flags, finishedWork) { function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -6869,59 +6869,33 @@ function commitHookEffectListUnmount( if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) - if ( - (enableUseEffectCRUDOverload - ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0), - enableUseEffectCRUDOverload) - ) { - if ( - 0 === updateQueue.resourceKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + void 0 !== destroy && + (enableUseEffectCRUDOverload + ? null == updateQueue.resourceKind && (inst.destroy = void 0) + : (inst.destroy = void 0), + enableUseEffectCRUDOverload + ? (0 === updateQueue.resourceKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - 1 === updateQueue.next.resourceKind && - (updateQueue.next.update = void 0); - updateQueue.inst.resource = null; - } - if (null == updateQueue.resourceKind) { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy, + updateQueue.inst.resource + ), + 1 === updateQueue.next.resourceKind && + (updateQueue.next.update = void 0), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } - } else { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } + destroy + )); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -7010,6 +6984,14 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else ref.current = null; } +function safelyCallDestroy(current, nearestMountedAncestor, destroy, resource) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } +} function commitProfilerPostCommit( finishedWork, current, @@ -10986,24 +10968,24 @@ var slice = Array.prototype.slice, }; return Text; })(React.Component); -var internals$jscomp$inline_1540 = { +var internals$jscomp$inline_1523 = { bundleType: 0, - version: "19.1.0-www-modern-0461c0d8-20250211", + version: "19.1.0-www-modern-a69b80d0-20250211", rendererPackageName: "react-art", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-modern-a69b80d0-20250211" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_1541 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_1524 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_1541.isDisabled && - hook$jscomp$inline_1541.supportsFiber + !hook$jscomp$inline_1524.isDisabled && + hook$jscomp$inline_1524.supportsFiber ) try { - (rendererID = hook$jscomp$inline_1541.inject( - internals$jscomp$inline_1540 + (rendererID = hook$jscomp$inline_1524.inject( + internals$jscomp$inline_1523 )), - (injectedHook = hook$jscomp$inline_1541); + (injectedHook = hook$jscomp$inline_1524); } catch (err) {} } var Path = Mode$1.Path; @@ -11017,4 +10999,4 @@ exports.RadialGradient = RadialGradient; exports.Shape = TYPES.SHAPE; exports.Surface = Surface; exports.Text = Text; -exports.version = "19.1.0-www-modern-0461c0d8-20250211"; +exports.version = "19.1.0-www-modern-a69b80d0-20250211"; diff --git a/compiled/facebook-www/ReactDOM-dev.classic.js b/compiled/facebook-www/ReactDOM-dev.classic.js index c02286e36f..5fd4f38e03 100644 --- a/compiled/facebook-www/ReactDOM-dev.classic.js +++ b/compiled/facebook-www/ReactDOM-dev.classic.js @@ -5666,8 +5666,9 @@ __DEV__ && ) (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); if ( hook.getSnapshot !== getSnapshot || cachedSnapshot || @@ -6071,11 +6072,11 @@ __DEV__ && currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { + function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -6132,15 +6133,15 @@ __DEV__ && initialValue = { current: initialValue }; return (hook.memoizedState = initialValue); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -6159,11 +6160,47 @@ __DEV__ && deps ))); } - function mountEffect(create, deps) { + function mountEffect(create, createDeps, update, updateDeps, destroy) { (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode - ? mountEffectImpl(276826112, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + ? !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(276826112, Passive, create, createDeps) + : mountResourceEffectImpl( + 276826112, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ) + : !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(8390656, Passive, create, createDeps) + : mountResourceEffectImpl( + 8390656, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); + } + function updateEffect(create, createDeps, update, updateDeps, destroy) { + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? updateEffectImpl(2048, Passive, create, createDeps) + : updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); } function mountResourceEffect( create, @@ -6172,39 +6209,41 @@ __DEV__ && updateDeps, destroy ) { - if ( - (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode - ) { - var hookFlags = Passive, - hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 276826112; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, + ((currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === + NoMode) || + mountResourceEffectImpl( + 8390656, + Passive, create, createDeps, update, - updateDeps + updateDeps, + destroy ); - } else - (hookFlags = Passive), - (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber.flags |= 8390656), - (inst = createEffectInstance()), - (inst.destroy = destroy), - (hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps - )); + } + function mountResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy + ) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= fiberFlags; + fiberFlags = createEffectInstance(); + fiberFlags.destroy = destroy; + hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + fiberFlags, + create, + createDeps, + update, + updateDeps + ); } function updateResourceEffectImpl( fiberFlags, @@ -9627,32 +9666,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2620; - var JSCompiler_object_inline_stack_2621 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2567; + var JSCompiler_object_inline_stack_2568 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2622 = !1; + var JSCompiler_object_inline_componentStack_2569 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2620 = didSuspend) || - (JSCompiler_object_inline_digest_2620 = + (JSCompiler_object_inline_digest_2567 = didSuspend) || + (JSCompiler_object_inline_digest_2567 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2620 && - ((JSCompiler_object_inline_componentStack_2622 = !0), + JSCompiler_object_inline_digest_2567 && + ((JSCompiler_object_inline_componentStack_2569 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2620 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2567 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2622 + JSCompiler_object_inline_componentStack_2569 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2619 = nextHydratableInstance; + var JSCompiler_object_inline_message_2566 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2619)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2566)) { c: { - var instance = JSCompiler_object_inline_message_2619; + var instance = JSCompiler_object_inline_message_2566; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9694,46 +9733,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2619 + JSCompiler_object_inline_message_2566 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2619 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2566 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2619 && - ((JSCompiler_object_inline_message_2619 = - JSCompiler_object_inline_message_2619.dehydrated), - null !== JSCompiler_object_inline_message_2619) + null !== JSCompiler_object_inline_message_2566 && + ((JSCompiler_object_inline_message_2566 = + JSCompiler_object_inline_message_2566.dehydrated), + null !== JSCompiler_object_inline_message_2566) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2619) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2566) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2619 = - JSCompiler_object_inline_stack_2621.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2621.fallback; - if (JSCompiler_object_inline_componentStack_2622) + JSCompiler_object_inline_message_2566 = + JSCompiler_object_inline_stack_2568.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2568.fallback; + if (JSCompiler_object_inline_componentStack_2569) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2621 = + (JSCompiler_object_inline_stack_2568 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2619, + JSCompiler_object_inline_message_2566, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2622 = + (JSCompiler_object_inline_componentStack_2569 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2622.memoizedState = + (JSCompiler_object_inline_componentStack_2569.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2622.childLanes = + (JSCompiler_object_inline_componentStack_2569.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2620, + JSCompiler_object_inline_digest_2567, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9746,9 +9785,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2622.updateQueue), + JSCompiler_object_inline_componentStack_2569.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2622.updateQueue = + ? (JSCompiler_object_inline_componentStack_2569.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9756,46 +9795,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2621 + JSCompiler_object_inline_stack_2568 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2621.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2568.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2621 = + (JSCompiler_object_inline_stack_2568 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2619, + JSCompiler_object_inline_message_2566, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2622 = + (JSCompiler_object_inline_componentStack_2569 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2622.memoizedState = + (JSCompiler_object_inline_componentStack_2569.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2622.childLanes = + (JSCompiler_object_inline_componentStack_2569.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2620, + JSCompiler_object_inline_digest_2567, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2621 + JSCompiler_object_inline_stack_2568 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2619 + JSCompiler_object_inline_message_2566 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2619 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2619) + ((JSCompiler_object_inline_message_2566 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2566) ) { if (didSuspend) workInProgress.flags & 256 @@ -9812,94 +9851,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2622 = - JSCompiler_object_inline_stack_2621.fallback), - (JSCompiler_object_inline_message_2619 = workInProgress.mode), - (JSCompiler_object_inline_stack_2621 = + (JSCompiler_object_inline_componentStack_2569 = + JSCompiler_object_inline_stack_2568.fallback), + (JSCompiler_object_inline_message_2566 = workInProgress.mode), + (JSCompiler_object_inline_stack_2568 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2621.children + children: JSCompiler_object_inline_stack_2568.children }, - JSCompiler_object_inline_message_2619 + JSCompiler_object_inline_message_2566 )), - (JSCompiler_object_inline_componentStack_2622 = + (JSCompiler_object_inline_componentStack_2569 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2622, - JSCompiler_object_inline_message_2619, + JSCompiler_object_inline_componentStack_2569, + JSCompiler_object_inline_message_2566, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2622.flags |= 2), - (JSCompiler_object_inline_stack_2621.return = workInProgress), - (JSCompiler_object_inline_componentStack_2622.return = + (JSCompiler_object_inline_componentStack_2569.flags |= 2), + (JSCompiler_object_inline_stack_2568.return = workInProgress), + (JSCompiler_object_inline_componentStack_2569.return = workInProgress), - (JSCompiler_object_inline_stack_2621.sibling = - JSCompiler_object_inline_componentStack_2622), - (workInProgress.child = JSCompiler_object_inline_stack_2621), + (JSCompiler_object_inline_stack_2568.sibling = + JSCompiler_object_inline_componentStack_2569), + (workInProgress.child = JSCompiler_object_inline_stack_2568), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2621 = workInProgress.child), - (JSCompiler_object_inline_stack_2621.memoizedState = + (JSCompiler_object_inline_stack_2568 = workInProgress.child), + (JSCompiler_object_inline_stack_2568.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2621.childLanes = + (JSCompiler_object_inline_stack_2568.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2620, + JSCompiler_object_inline_digest_2567, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2622)); + JSCompiler_object_inline_componentStack_2569)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2619)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2566)) ) { - JSCompiler_object_inline_digest_2620 = - JSCompiler_object_inline_message_2619.nextSibling && - JSCompiler_object_inline_message_2619.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2620) { - JSCompiler_temp = JSCompiler_object_inline_digest_2620.dgst; - var message = JSCompiler_object_inline_digest_2620.msg; - instance = JSCompiler_object_inline_digest_2620.stck; - var componentStack = JSCompiler_object_inline_digest_2620.cstck; + JSCompiler_object_inline_digest_2567 = + JSCompiler_object_inline_message_2566.nextSibling && + JSCompiler_object_inline_message_2566.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2567) { + JSCompiler_temp = JSCompiler_object_inline_digest_2567.dgst; + var message = JSCompiler_object_inline_digest_2567.msg; + instance = JSCompiler_object_inline_digest_2567.stck; + var componentStack = JSCompiler_object_inline_digest_2567.cstck; } - JSCompiler_object_inline_message_2619 = message; - JSCompiler_object_inline_digest_2620 = JSCompiler_temp; - JSCompiler_object_inline_stack_2621 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2622 = + JSCompiler_object_inline_message_2566 = message; + JSCompiler_object_inline_digest_2567 = JSCompiler_temp; + JSCompiler_object_inline_stack_2568 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2569 = componentStack; - JSCompiler_object_inline_componentStack_2622 = - JSCompiler_object_inline_message_2619 - ? Error(JSCompiler_object_inline_message_2619) + JSCompiler_object_inline_componentStack_2569 = + JSCompiler_object_inline_message_2566 + ? Error(JSCompiler_object_inline_message_2566) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2622.stack = - JSCompiler_object_inline_stack_2621 || ""; - JSCompiler_object_inline_componentStack_2622.digest = - JSCompiler_object_inline_digest_2620; - JSCompiler_object_inline_digest_2620 = + JSCompiler_object_inline_componentStack_2569.stack = + JSCompiler_object_inline_stack_2568 || ""; + JSCompiler_object_inline_componentStack_2569.digest = + JSCompiler_object_inline_digest_2567; + JSCompiler_object_inline_digest_2567 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2621 = { - value: JSCompiler_object_inline_componentStack_2622, + JSCompiler_object_inline_stack_2568 = { + value: JSCompiler_object_inline_componentStack_2569, source: null, - stack: JSCompiler_object_inline_digest_2620 + stack: JSCompiler_object_inline_digest_2567 }; - "string" === typeof JSCompiler_object_inline_digest_2620 && + "string" === typeof JSCompiler_object_inline_digest_2567 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2622, - JSCompiler_object_inline_stack_2621 + JSCompiler_object_inline_componentStack_2569, + JSCompiler_object_inline_stack_2568 ); - queueHydrationError(JSCompiler_object_inline_stack_2621); + queueHydrationError(JSCompiler_object_inline_stack_2568); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9913,44 +9952,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2620 = + (JSCompiler_object_inline_digest_2567 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2620) + didReceiveUpdate || JSCompiler_object_inline_digest_2567) ) { - JSCompiler_object_inline_digest_2620 = workInProgressRoot; + JSCompiler_object_inline_digest_2567 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2620 && - ((JSCompiler_object_inline_stack_2621 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2621 = - 0 !== (JSCompiler_object_inline_stack_2621 & 42) + null !== JSCompiler_object_inline_digest_2567 && + ((JSCompiler_object_inline_stack_2568 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2568 = + 0 !== (JSCompiler_object_inline_stack_2568 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2621 + JSCompiler_object_inline_stack_2568 )), - (JSCompiler_object_inline_stack_2621 = + (JSCompiler_object_inline_stack_2568 = 0 !== - (JSCompiler_object_inline_stack_2621 & - (JSCompiler_object_inline_digest_2620.suspendedLanes | + (JSCompiler_object_inline_stack_2568 & + (JSCompiler_object_inline_digest_2567.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2621), - 0 !== JSCompiler_object_inline_stack_2621 && - JSCompiler_object_inline_stack_2621 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2568), + 0 !== JSCompiler_object_inline_stack_2568 && + JSCompiler_object_inline_stack_2568 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2621), + ((prevState.retryLane = JSCompiler_object_inline_stack_2568), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2621 + JSCompiler_object_inline_stack_2568 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2620, + JSCompiler_object_inline_digest_2567, current, - JSCompiler_object_inline_stack_2621 + JSCompiler_object_inline_stack_2568 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2619.data === + JSCompiler_object_inline_message_2566.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9958,14 +9997,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2619.data === + JSCompiler_object_inline_message_2566.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2619.nextSibling + JSCompiler_object_inline_message_2566.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9983,57 +10022,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2621.children + JSCompiler_object_inline_stack_2568.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2622) + if (JSCompiler_object_inline_componentStack_2569) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2622 = - JSCompiler_object_inline_stack_2621.fallback), - (JSCompiler_object_inline_message_2619 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2569 = + JSCompiler_object_inline_stack_2568.fallback), + (JSCompiler_object_inline_message_2566 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2621 = createWorkInProgress( + (JSCompiler_object_inline_stack_2568 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2621.children + children: JSCompiler_object_inline_stack_2568.children } )), - (JSCompiler_object_inline_stack_2621.subtreeFlags = + (JSCompiler_object_inline_stack_2568.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_componentStack_2622 = + ? (JSCompiler_object_inline_componentStack_2569 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2622 + JSCompiler_object_inline_componentStack_2569 )) - : ((JSCompiler_object_inline_componentStack_2622 = + : ((JSCompiler_object_inline_componentStack_2569 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2622, - JSCompiler_object_inline_message_2619, + JSCompiler_object_inline_componentStack_2569, + JSCompiler_object_inline_message_2566, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2622.flags |= 2)), - (JSCompiler_object_inline_componentStack_2622.return = + (JSCompiler_object_inline_componentStack_2569.flags |= 2)), + (JSCompiler_object_inline_componentStack_2569.return = workInProgress), - (JSCompiler_object_inline_stack_2621.return = workInProgress), - (JSCompiler_object_inline_stack_2621.sibling = - JSCompiler_object_inline_componentStack_2622), - (workInProgress.child = JSCompiler_object_inline_stack_2621), - (JSCompiler_object_inline_stack_2621 = - JSCompiler_object_inline_componentStack_2622), - (JSCompiler_object_inline_componentStack_2622 = workInProgress.child), - (JSCompiler_object_inline_message_2619 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2619 - ? (JSCompiler_object_inline_message_2619 = + (JSCompiler_object_inline_stack_2568.return = workInProgress), + (JSCompiler_object_inline_stack_2568.sibling = + JSCompiler_object_inline_componentStack_2569), + (workInProgress.child = JSCompiler_object_inline_stack_2568), + (JSCompiler_object_inline_stack_2568 = + JSCompiler_object_inline_componentStack_2569), + (JSCompiler_object_inline_componentStack_2569 = workInProgress.child), + (JSCompiler_object_inline_message_2566 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2566 + ? (JSCompiler_object_inline_message_2566 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2619.cachePool), + JSCompiler_object_inline_message_2566.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -10041,34 +10080,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2619 = { + (JSCompiler_object_inline_message_2566 = { baseLanes: - JSCompiler_object_inline_message_2619.baseLanes | renderLanes, + JSCompiler_object_inline_message_2566.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2622.memoizedState = - JSCompiler_object_inline_message_2619), + (JSCompiler_object_inline_componentStack_2569.memoizedState = + JSCompiler_object_inline_message_2566), enableTransitionTracing && - ((JSCompiler_object_inline_message_2619 = enableTransitionTracing + ((JSCompiler_object_inline_message_2566 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2619 && + null !== JSCompiler_object_inline_message_2566 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2622.updateQueue), + JSCompiler_object_inline_componentStack_2569.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2622.updateQueue = { - transitions: JSCompiler_object_inline_message_2619, + ? (JSCompiler_object_inline_componentStack_2569.updateQueue = { + transitions: JSCompiler_object_inline_message_2566, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2622.updateQueue = + ? (JSCompiler_object_inline_componentStack_2569.updateQueue = { - transitions: JSCompiler_object_inline_message_2619, + transitions: JSCompiler_object_inline_message_2566, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -10076,32 +10115,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2619), + JSCompiler_object_inline_message_2566), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2622.childLanes = + (JSCompiler_object_inline_componentStack_2569.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2620, + JSCompiler_object_inline_digest_2567, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2621 + JSCompiler_object_inline_stack_2568 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2621.children + children: JSCompiler_object_inline_stack_2568.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2620 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2620 + ((JSCompiler_object_inline_digest_2567 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2567 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2620.push(current)); + : JSCompiler_object_inline_digest_2567.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -12413,7 +12452,7 @@ __DEV__ && )), null == updateQueue.inst.resource && error$jscomp$0( - "useResourceEffect must provide a callback which returns a resource. If a managed resource is not needed here, use useEffect. Received %s", + "useEffect must provide a callback which returns a resource. If a managed resource is not needed here, do not provide an updater or destroy callback. Received %s", updateQueue.inst.resource ), (lastEffect = updateQueue.inst.destroy)), @@ -12463,10 +12502,7 @@ __DEV__ && ? "useLayoutEffect" : 0 !== (updateQueue.tag & Insertion) ? "useInsertionEffect" - : enableUseEffectCRUDOverload && - null != updateQueue.resourceKind - ? "useResourceEffect" - : "useEffect"; + : "useEffect"; var addendum = void 0; addendum = null === lastEffect @@ -12501,7 +12537,7 @@ __DEV__ && function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -12513,10 +12549,10 @@ __DEV__ && if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) { - enableUseEffectCRUDOverload + void 0 !== destroy && + (enableUseEffectCRUDOverload ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0); + : (inst.destroy = void 0), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -12533,51 +12569,38 @@ __DEV__ && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( finishedWork - )); + )), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0); - if (enableUseEffectCRUDOverload) { - if ( - updateQueue.resourceKind === ResourceEffectIdentityKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = - nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - runWithFiberInDEV( - lastEffect, - callDestroyInDEV, - lastEffect, + (isRunningInsertionEffect = !0), + enableUseEffectCRUDOverload + ? (updateQueue.resourceKind === ResourceEffectIdentityKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy, + updateQueue.inst.resource + ), + updateQueue.next.resourceKind === ResourceEffectUpdateKind + ? (updateQueue.next.update = void 0) + : error$jscomp$0( + "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", + updateQueue.next.resourceKind + ), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - destroy_ - ); - updateQueue.next.resourceKind === ResourceEffectUpdateKind - ? (updateQueue.next.update = void 0) - : error$jscomp$0( - "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", - updateQueue.next.resourceKind - ); - updateQueue.inst.resource = null; - } - null == updateQueue.resourceKind && - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, destroy - ); - } else - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, - destroy - ); + ), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1); + (isRunningInsertionEffect = !1), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -12590,8 +12613,7 @@ __DEV__ && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); - } + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -12817,6 +12839,21 @@ __DEV__ && } else ref.current = null; } + function safelyCallDestroy( + current, + nearestMountedAncestor, + destroy, + resource + ) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + runWithFiberInDEV( + current, + callDestroyInDEV, + current, + nearestMountedAncestor, + destroy + ); + } function commitProfiler( finishedWork, current, @@ -26178,8 +26215,6 @@ __DEV__ && useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -26203,140 +26238,16 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountEffect(create, deps); - }, - useImperativeHandle: function (ref, create, deps) { - currentHookNameInDev = "useImperativeHandle"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountImperativeHandle(ref, create, deps); - }, - useInsertionEffect: function (create, deps) { - currentHookNameInDev = "useInsertionEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - mountEffectImpl(4, Insertion, create, deps); - }, - useLayoutEffect: function (create, deps) { - currentHookNameInDev = "useLayoutEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountLayoutEffect(create, deps); - }, - useMemo: function (create, deps) { - currentHookNameInDev = "useMemo"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountMemo(create, deps); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useReducer: function (reducer, initialArg, init) { - currentHookNameInDev = "useReducer"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountReducer(reducer, initialArg, init); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useRef: function (initialValue) { - currentHookNameInDev = "useRef"; - mountHookTypesDev(); - return mountRef(initialValue); - }, - useState: function (initialState) { - currentHookNameInDev = "useState"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountState(initialState); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useDebugValue: function () { - currentHookNameInDev = "useDebugValue"; - mountHookTypesDev(); - }, - useDeferredValue: function (value, initialValue) { - currentHookNameInDev = "useDeferredValue"; - mountHookTypesDev(); - return mountDeferredValue(value, initialValue); - }, - useTransition: function () { - currentHookNameInDev = "useTransition"; - mountHookTypesDev(); - return mountTransition(); - }, - useSyncExternalStore: function ( - subscribe, - getSnapshot, - getServerSnapshot - ) { - currentHookNameInDev = "useSyncExternalStore"; - mountHookTypesDev(); - return mountSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ); - }, - useId: function () { - currentHookNameInDev = "useId"; - mountHookTypesDev(); - return mountId(); - }, - useFormState: function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }, - useActionState: function (action, initialState) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }, - useOptimistic: function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }, - useHostTransitionStatus: useHostTransitionStatus, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; - mountHookTypesDev(); - return mountRefresh(); - }, - useEffectEvent: function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - } - }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - mountHookTypesDev(); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return ( + checkDepsAreArrayDev(createDeps), mountEffect(create, createDeps) + ); void 0 !== updateDeps && null !== updateDeps && isArrayImpl(updateDeps) && @@ -26352,7 +26263,125 @@ __DEV__ && updateDeps, destroy ); - }); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function (create, deps) { + currentHookNameInDev = "useInsertionEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + mountEffectImpl(4, Insertion, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = "useLayoutEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = "useMemo"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = "useRef"; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = "useState"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useDebugValue: function () { + currentHookNameInDev = "useDebugValue"; + mountHookTypesDev(); + }, + useDeferredValue: function (value, initialValue) { + currentHookNameInDev = "useDeferredValue"; + mountHookTypesDev(); + return mountDeferredValue(value, initialValue); + }, + useTransition: function () { + currentHookNameInDev = "useTransition"; + mountHookTypesDev(); + return mountTransition(); + }, + useSyncExternalStore: function ( + subscribe, + getSnapshot, + getServerSnapshot + ) { + currentHookNameInDev = "useSyncExternalStore"; + mountHookTypesDev(); + return mountSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ); + }, + useId: function () { + currentHookNameInDev = "useId"; + mountHookTypesDev(); + return mountId(); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); + } + }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -26368,10 +26397,19 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26487,24 +26525,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -26520,10 +26540,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26639,26 +26672,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -26674,10 +26687,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26793,26 +26819,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -26834,11 +26840,20 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); mountHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26972,25 +26987,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -27012,11 +27008,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -27150,27 +27159,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -27192,11 +27180,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -27330,22 +27331,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnRerenderInDEV.useResourceEffect = - function (create, createDeps, update, updateDeps, destroy) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -28649,11 +28634,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-classic-0461c0d8-20250211" !== isomorphicReactPackageVersion) + if ("19.1.0-www-classic-a69b80d0-20250211" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-www-classic-0461c0d8-20250211\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-classic-a69b80d0-20250211\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -28696,10 +28681,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-0461c0d8-20250211", + version: "19.1.0-www-classic-a69b80d0-20250211", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-classic-a69b80d0-20250211" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -29297,7 +29282,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-classic-0461c0d8-20250211"; + exports.version = "19.1.0-www-classic-a69b80d0-20250211"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-dev.modern.js b/compiled/facebook-www/ReactDOM-dev.modern.js index 57d46c1a07..eebbc914b5 100644 --- a/compiled/facebook-www/ReactDOM-dev.modern.js +++ b/compiled/facebook-www/ReactDOM-dev.modern.js @@ -5553,8 +5553,9 @@ __DEV__ && ) (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); if ( hook.getSnapshot !== getSnapshot || cachedSnapshot || @@ -5958,11 +5959,11 @@ __DEV__ && currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { + function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -6019,15 +6020,15 @@ __DEV__ && initialValue = { current: initialValue }; return (hook.memoizedState = initialValue); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -6046,11 +6047,47 @@ __DEV__ && deps ))); } - function mountEffect(create, deps) { + function mountEffect(create, createDeps, update, updateDeps, destroy) { (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode - ? mountEffectImpl(276826112, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + ? !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(276826112, Passive, create, createDeps) + : mountResourceEffectImpl( + 276826112, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ) + : !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(8390656, Passive, create, createDeps) + : mountResourceEffectImpl( + 8390656, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); + } + function updateEffect(create, createDeps, update, updateDeps, destroy) { + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? updateEffectImpl(2048, Passive, create, createDeps) + : updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); } function mountResourceEffect( create, @@ -6059,39 +6096,41 @@ __DEV__ && updateDeps, destroy ) { - if ( - (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode - ) { - var hookFlags = Passive, - hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 276826112; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, + ((currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === + NoMode) || + mountResourceEffectImpl( + 8390656, + Passive, create, createDeps, update, - updateDeps + updateDeps, + destroy ); - } else - (hookFlags = Passive), - (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber.flags |= 8390656), - (inst = createEffectInstance()), - (inst.destroy = destroy), - (hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps - )); + } + function mountResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy + ) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= fiberFlags; + fiberFlags = createEffectInstance(); + fiberFlags.destroy = destroy; + hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + fiberFlags, + create, + createDeps, + update, + updateDeps + ); } function updateResourceEffectImpl( fiberFlags, @@ -9439,32 +9478,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2615; - var JSCompiler_object_inline_stack_2616 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2562; + var JSCompiler_object_inline_stack_2563 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2617 = !1; + var JSCompiler_object_inline_componentStack_2564 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2615 = didSuspend) || - (JSCompiler_object_inline_digest_2615 = + (JSCompiler_object_inline_digest_2562 = didSuspend) || + (JSCompiler_object_inline_digest_2562 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2615 && - ((JSCompiler_object_inline_componentStack_2617 = !0), + JSCompiler_object_inline_digest_2562 && + ((JSCompiler_object_inline_componentStack_2564 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2615 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2562 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2617 + JSCompiler_object_inline_componentStack_2564 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2614 = nextHydratableInstance; + var JSCompiler_object_inline_message_2561 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2614)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2561)) { c: { - var instance = JSCompiler_object_inline_message_2614; + var instance = JSCompiler_object_inline_message_2561; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9506,46 +9545,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2614 + JSCompiler_object_inline_message_2561 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2614 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2561 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2614 && - ((JSCompiler_object_inline_message_2614 = - JSCompiler_object_inline_message_2614.dehydrated), - null !== JSCompiler_object_inline_message_2614) + null !== JSCompiler_object_inline_message_2561 && + ((JSCompiler_object_inline_message_2561 = + JSCompiler_object_inline_message_2561.dehydrated), + null !== JSCompiler_object_inline_message_2561) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2614) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2561) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2614 = - JSCompiler_object_inline_stack_2616.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2616.fallback; - if (JSCompiler_object_inline_componentStack_2617) + JSCompiler_object_inline_message_2561 = + JSCompiler_object_inline_stack_2563.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2563.fallback; + if (JSCompiler_object_inline_componentStack_2564) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2616 = + (JSCompiler_object_inline_stack_2563 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2614, + JSCompiler_object_inline_message_2561, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2617 = + (JSCompiler_object_inline_componentStack_2564 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2617.memoizedState = + (JSCompiler_object_inline_componentStack_2564.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2617.childLanes = + (JSCompiler_object_inline_componentStack_2564.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2615, + JSCompiler_object_inline_digest_2562, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9558,9 +9597,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2617.updateQueue), + JSCompiler_object_inline_componentStack_2564.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2617.updateQueue = + ? (JSCompiler_object_inline_componentStack_2564.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9568,46 +9607,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2616 + JSCompiler_object_inline_stack_2563 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2616.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2563.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2616 = + (JSCompiler_object_inline_stack_2563 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2614, + JSCompiler_object_inline_message_2561, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2617 = + (JSCompiler_object_inline_componentStack_2564 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2617.memoizedState = + (JSCompiler_object_inline_componentStack_2564.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2617.childLanes = + (JSCompiler_object_inline_componentStack_2564.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2615, + JSCompiler_object_inline_digest_2562, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2616 + JSCompiler_object_inline_stack_2563 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2614 + JSCompiler_object_inline_message_2561 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2614 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2614) + ((JSCompiler_object_inline_message_2561 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2561) ) { if (didSuspend) workInProgress.flags & 256 @@ -9624,94 +9663,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2617 = - JSCompiler_object_inline_stack_2616.fallback), - (JSCompiler_object_inline_message_2614 = workInProgress.mode), - (JSCompiler_object_inline_stack_2616 = + (JSCompiler_object_inline_componentStack_2564 = + JSCompiler_object_inline_stack_2563.fallback), + (JSCompiler_object_inline_message_2561 = workInProgress.mode), + (JSCompiler_object_inline_stack_2563 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2616.children + children: JSCompiler_object_inline_stack_2563.children }, - JSCompiler_object_inline_message_2614 + JSCompiler_object_inline_message_2561 )), - (JSCompiler_object_inline_componentStack_2617 = + (JSCompiler_object_inline_componentStack_2564 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2617, - JSCompiler_object_inline_message_2614, + JSCompiler_object_inline_componentStack_2564, + JSCompiler_object_inline_message_2561, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2617.flags |= 2), - (JSCompiler_object_inline_stack_2616.return = workInProgress), - (JSCompiler_object_inline_componentStack_2617.return = + (JSCompiler_object_inline_componentStack_2564.flags |= 2), + (JSCompiler_object_inline_stack_2563.return = workInProgress), + (JSCompiler_object_inline_componentStack_2564.return = workInProgress), - (JSCompiler_object_inline_stack_2616.sibling = - JSCompiler_object_inline_componentStack_2617), - (workInProgress.child = JSCompiler_object_inline_stack_2616), + (JSCompiler_object_inline_stack_2563.sibling = + JSCompiler_object_inline_componentStack_2564), + (workInProgress.child = JSCompiler_object_inline_stack_2563), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2616 = workInProgress.child), - (JSCompiler_object_inline_stack_2616.memoizedState = + (JSCompiler_object_inline_stack_2563 = workInProgress.child), + (JSCompiler_object_inline_stack_2563.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2616.childLanes = + (JSCompiler_object_inline_stack_2563.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2615, + JSCompiler_object_inline_digest_2562, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2617)); + JSCompiler_object_inline_componentStack_2564)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2614)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2561)) ) { - JSCompiler_object_inline_digest_2615 = - JSCompiler_object_inline_message_2614.nextSibling && - JSCompiler_object_inline_message_2614.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2615) { - JSCompiler_temp = JSCompiler_object_inline_digest_2615.dgst; - var message = JSCompiler_object_inline_digest_2615.msg; - instance = JSCompiler_object_inline_digest_2615.stck; - var componentStack = JSCompiler_object_inline_digest_2615.cstck; + JSCompiler_object_inline_digest_2562 = + JSCompiler_object_inline_message_2561.nextSibling && + JSCompiler_object_inline_message_2561.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2562) { + JSCompiler_temp = JSCompiler_object_inline_digest_2562.dgst; + var message = JSCompiler_object_inline_digest_2562.msg; + instance = JSCompiler_object_inline_digest_2562.stck; + var componentStack = JSCompiler_object_inline_digest_2562.cstck; } - JSCompiler_object_inline_message_2614 = message; - JSCompiler_object_inline_digest_2615 = JSCompiler_temp; - JSCompiler_object_inline_stack_2616 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2617 = + JSCompiler_object_inline_message_2561 = message; + JSCompiler_object_inline_digest_2562 = JSCompiler_temp; + JSCompiler_object_inline_stack_2563 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2564 = componentStack; - JSCompiler_object_inline_componentStack_2617 = - JSCompiler_object_inline_message_2614 - ? Error(JSCompiler_object_inline_message_2614) + JSCompiler_object_inline_componentStack_2564 = + JSCompiler_object_inline_message_2561 + ? Error(JSCompiler_object_inline_message_2561) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2617.stack = - JSCompiler_object_inline_stack_2616 || ""; - JSCompiler_object_inline_componentStack_2617.digest = - JSCompiler_object_inline_digest_2615; - JSCompiler_object_inline_digest_2615 = + JSCompiler_object_inline_componentStack_2564.stack = + JSCompiler_object_inline_stack_2563 || ""; + JSCompiler_object_inline_componentStack_2564.digest = + JSCompiler_object_inline_digest_2562; + JSCompiler_object_inline_digest_2562 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2616 = { - value: JSCompiler_object_inline_componentStack_2617, + JSCompiler_object_inline_stack_2563 = { + value: JSCompiler_object_inline_componentStack_2564, source: null, - stack: JSCompiler_object_inline_digest_2615 + stack: JSCompiler_object_inline_digest_2562 }; - "string" === typeof JSCompiler_object_inline_digest_2615 && + "string" === typeof JSCompiler_object_inline_digest_2562 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2617, - JSCompiler_object_inline_stack_2616 + JSCompiler_object_inline_componentStack_2564, + JSCompiler_object_inline_stack_2563 ); - queueHydrationError(JSCompiler_object_inline_stack_2616); + queueHydrationError(JSCompiler_object_inline_stack_2563); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9725,44 +9764,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2615 = + (JSCompiler_object_inline_digest_2562 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2615) + didReceiveUpdate || JSCompiler_object_inline_digest_2562) ) { - JSCompiler_object_inline_digest_2615 = workInProgressRoot; + JSCompiler_object_inline_digest_2562 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2615 && - ((JSCompiler_object_inline_stack_2616 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2616 = - 0 !== (JSCompiler_object_inline_stack_2616 & 42) + null !== JSCompiler_object_inline_digest_2562 && + ((JSCompiler_object_inline_stack_2563 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2563 = + 0 !== (JSCompiler_object_inline_stack_2563 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2616 + JSCompiler_object_inline_stack_2563 )), - (JSCompiler_object_inline_stack_2616 = + (JSCompiler_object_inline_stack_2563 = 0 !== - (JSCompiler_object_inline_stack_2616 & - (JSCompiler_object_inline_digest_2615.suspendedLanes | + (JSCompiler_object_inline_stack_2563 & + (JSCompiler_object_inline_digest_2562.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2616), - 0 !== JSCompiler_object_inline_stack_2616 && - JSCompiler_object_inline_stack_2616 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2563), + 0 !== JSCompiler_object_inline_stack_2563 && + JSCompiler_object_inline_stack_2563 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2616), + ((prevState.retryLane = JSCompiler_object_inline_stack_2563), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2616 + JSCompiler_object_inline_stack_2563 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2615, + JSCompiler_object_inline_digest_2562, current, - JSCompiler_object_inline_stack_2616 + JSCompiler_object_inline_stack_2563 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2614.data === + JSCompiler_object_inline_message_2561.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9770,14 +9809,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2614.data === + JSCompiler_object_inline_message_2561.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2614.nextSibling + JSCompiler_object_inline_message_2561.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9795,57 +9834,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2616.children + JSCompiler_object_inline_stack_2563.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2617) + if (JSCompiler_object_inline_componentStack_2564) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2617 = - JSCompiler_object_inline_stack_2616.fallback), - (JSCompiler_object_inline_message_2614 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2564 = + JSCompiler_object_inline_stack_2563.fallback), + (JSCompiler_object_inline_message_2561 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2616 = createWorkInProgress( + (JSCompiler_object_inline_stack_2563 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2616.children + children: JSCompiler_object_inline_stack_2563.children } )), - (JSCompiler_object_inline_stack_2616.subtreeFlags = + (JSCompiler_object_inline_stack_2563.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_componentStack_2617 = + ? (JSCompiler_object_inline_componentStack_2564 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2617 + JSCompiler_object_inline_componentStack_2564 )) - : ((JSCompiler_object_inline_componentStack_2617 = + : ((JSCompiler_object_inline_componentStack_2564 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2617, - JSCompiler_object_inline_message_2614, + JSCompiler_object_inline_componentStack_2564, + JSCompiler_object_inline_message_2561, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2617.flags |= 2)), - (JSCompiler_object_inline_componentStack_2617.return = + (JSCompiler_object_inline_componentStack_2564.flags |= 2)), + (JSCompiler_object_inline_componentStack_2564.return = workInProgress), - (JSCompiler_object_inline_stack_2616.return = workInProgress), - (JSCompiler_object_inline_stack_2616.sibling = - JSCompiler_object_inline_componentStack_2617), - (workInProgress.child = JSCompiler_object_inline_stack_2616), - (JSCompiler_object_inline_stack_2616 = - JSCompiler_object_inline_componentStack_2617), - (JSCompiler_object_inline_componentStack_2617 = workInProgress.child), - (JSCompiler_object_inline_message_2614 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2614 - ? (JSCompiler_object_inline_message_2614 = + (JSCompiler_object_inline_stack_2563.return = workInProgress), + (JSCompiler_object_inline_stack_2563.sibling = + JSCompiler_object_inline_componentStack_2564), + (workInProgress.child = JSCompiler_object_inline_stack_2563), + (JSCompiler_object_inline_stack_2563 = + JSCompiler_object_inline_componentStack_2564), + (JSCompiler_object_inline_componentStack_2564 = workInProgress.child), + (JSCompiler_object_inline_message_2561 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2561 + ? (JSCompiler_object_inline_message_2561 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2614.cachePool), + JSCompiler_object_inline_message_2561.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9853,34 +9892,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2614 = { + (JSCompiler_object_inline_message_2561 = { baseLanes: - JSCompiler_object_inline_message_2614.baseLanes | renderLanes, + JSCompiler_object_inline_message_2561.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2617.memoizedState = - JSCompiler_object_inline_message_2614), + (JSCompiler_object_inline_componentStack_2564.memoizedState = + JSCompiler_object_inline_message_2561), enableTransitionTracing && - ((JSCompiler_object_inline_message_2614 = enableTransitionTracing + ((JSCompiler_object_inline_message_2561 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2614 && + null !== JSCompiler_object_inline_message_2561 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2617.updateQueue), + JSCompiler_object_inline_componentStack_2564.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2617.updateQueue = { - transitions: JSCompiler_object_inline_message_2614, + ? (JSCompiler_object_inline_componentStack_2564.updateQueue = { + transitions: JSCompiler_object_inline_message_2561, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2617.updateQueue = + ? (JSCompiler_object_inline_componentStack_2564.updateQueue = { - transitions: JSCompiler_object_inline_message_2614, + transitions: JSCompiler_object_inline_message_2561, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9888,32 +9927,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2614), + JSCompiler_object_inline_message_2561), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2617.childLanes = + (JSCompiler_object_inline_componentStack_2564.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2615, + JSCompiler_object_inline_digest_2562, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2616 + JSCompiler_object_inline_stack_2563 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2616.children + children: JSCompiler_object_inline_stack_2563.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2615 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2615 + ((JSCompiler_object_inline_digest_2562 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2562 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2615.push(current)); + : JSCompiler_object_inline_digest_2562.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -12212,7 +12251,7 @@ __DEV__ && )), null == updateQueue.inst.resource && error$jscomp$0( - "useResourceEffect must provide a callback which returns a resource. If a managed resource is not needed here, use useEffect. Received %s", + "useEffect must provide a callback which returns a resource. If a managed resource is not needed here, do not provide an updater or destroy callback. Received %s", updateQueue.inst.resource ), (lastEffect = updateQueue.inst.destroy)), @@ -12262,10 +12301,7 @@ __DEV__ && ? "useLayoutEffect" : 0 !== (updateQueue.tag & Insertion) ? "useInsertionEffect" - : enableUseEffectCRUDOverload && - null != updateQueue.resourceKind - ? "useResourceEffect" - : "useEffect"; + : "useEffect"; var addendum = void 0; addendum = null === lastEffect @@ -12300,7 +12336,7 @@ __DEV__ && function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -12312,10 +12348,10 @@ __DEV__ && if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) { - enableUseEffectCRUDOverload + void 0 !== destroy && + (enableUseEffectCRUDOverload ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0); + : (inst.destroy = void 0), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -12332,51 +12368,38 @@ __DEV__ && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( finishedWork - )); + )), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0); - if (enableUseEffectCRUDOverload) { - if ( - updateQueue.resourceKind === ResourceEffectIdentityKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = - nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - runWithFiberInDEV( - lastEffect, - callDestroyInDEV, - lastEffect, + (isRunningInsertionEffect = !0), + enableUseEffectCRUDOverload + ? (updateQueue.resourceKind === ResourceEffectIdentityKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy, + updateQueue.inst.resource + ), + updateQueue.next.resourceKind === ResourceEffectUpdateKind + ? (updateQueue.next.update = void 0) + : error$jscomp$0( + "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", + updateQueue.next.resourceKind + ), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - destroy_ - ); - updateQueue.next.resourceKind === ResourceEffectUpdateKind - ? (updateQueue.next.update = void 0) - : error$jscomp$0( - "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", - updateQueue.next.resourceKind - ); - updateQueue.inst.resource = null; - } - null == updateQueue.resourceKind && - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, destroy - ); - } else - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, - destroy - ); + ), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1); + (isRunningInsertionEffect = !1), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -12389,8 +12412,7 @@ __DEV__ && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); - } + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -12616,6 +12638,21 @@ __DEV__ && } else ref.current = null; } + function safelyCallDestroy( + current, + nearestMountedAncestor, + destroy, + resource + ) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + runWithFiberInDEV( + current, + callDestroyInDEV, + current, + nearestMountedAncestor, + destroy + ); + } function commitProfiler( finishedWork, current, @@ -25966,8 +26003,6 @@ __DEV__ && useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -25991,140 +26026,16 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountEffect(create, deps); - }, - useImperativeHandle: function (ref, create, deps) { - currentHookNameInDev = "useImperativeHandle"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountImperativeHandle(ref, create, deps); - }, - useInsertionEffect: function (create, deps) { - currentHookNameInDev = "useInsertionEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - mountEffectImpl(4, Insertion, create, deps); - }, - useLayoutEffect: function (create, deps) { - currentHookNameInDev = "useLayoutEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountLayoutEffect(create, deps); - }, - useMemo: function (create, deps) { - currentHookNameInDev = "useMemo"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountMemo(create, deps); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useReducer: function (reducer, initialArg, init) { - currentHookNameInDev = "useReducer"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountReducer(reducer, initialArg, init); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useRef: function (initialValue) { - currentHookNameInDev = "useRef"; - mountHookTypesDev(); - return mountRef(initialValue); - }, - useState: function (initialState) { - currentHookNameInDev = "useState"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountState(initialState); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useDebugValue: function () { - currentHookNameInDev = "useDebugValue"; - mountHookTypesDev(); - }, - useDeferredValue: function (value, initialValue) { - currentHookNameInDev = "useDeferredValue"; - mountHookTypesDev(); - return mountDeferredValue(value, initialValue); - }, - useTransition: function () { - currentHookNameInDev = "useTransition"; - mountHookTypesDev(); - return mountTransition(); - }, - useSyncExternalStore: function ( - subscribe, - getSnapshot, - getServerSnapshot - ) { - currentHookNameInDev = "useSyncExternalStore"; - mountHookTypesDev(); - return mountSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ); - }, - useId: function () { - currentHookNameInDev = "useId"; - mountHookTypesDev(); - return mountId(); - }, - useFormState: function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }, - useActionState: function (action, initialState) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }, - useOptimistic: function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }, - useHostTransitionStatus: useHostTransitionStatus, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; - mountHookTypesDev(); - return mountRefresh(); - }, - useEffectEvent: function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - } - }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - mountHookTypesDev(); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return ( + checkDepsAreArrayDev(createDeps), mountEffect(create, createDeps) + ); void 0 !== updateDeps && null !== updateDeps && isArrayImpl(updateDeps) && @@ -26140,7 +26051,125 @@ __DEV__ && updateDeps, destroy ); - }); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function (create, deps) { + currentHookNameInDev = "useInsertionEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + mountEffectImpl(4, Insertion, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = "useLayoutEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = "useMemo"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = "useRef"; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = "useState"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useDebugValue: function () { + currentHookNameInDev = "useDebugValue"; + mountHookTypesDev(); + }, + useDeferredValue: function (value, initialValue) { + currentHookNameInDev = "useDeferredValue"; + mountHookTypesDev(); + return mountDeferredValue(value, initialValue); + }, + useTransition: function () { + currentHookNameInDev = "useTransition"; + mountHookTypesDev(); + return mountTransition(); + }, + useSyncExternalStore: function ( + subscribe, + getSnapshot, + getServerSnapshot + ) { + currentHookNameInDev = "useSyncExternalStore"; + mountHookTypesDev(); + return mountSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ); + }, + useId: function () { + currentHookNameInDev = "useId"; + mountHookTypesDev(); + return mountId(); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); + } + }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -26156,10 +26185,19 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26275,24 +26313,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -26308,10 +26328,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26427,26 +26460,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -26462,10 +26475,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26581,26 +26607,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -26622,11 +26628,20 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); mountHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26760,25 +26775,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -26800,11 +26796,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26938,27 +26947,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -26980,11 +26968,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -27118,22 +27119,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnRerenderInDEV.useResourceEffect = - function (create, createDeps, update, updateDeps, destroy) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -28435,11 +28420,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-modern-0461c0d8-20250211" !== isomorphicReactPackageVersion) + if ("19.1.0-www-modern-a69b80d0-20250211" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-www-modern-0461c0d8-20250211\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-modern-a69b80d0-20250211\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -28482,10 +28467,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-0461c0d8-20250211", + version: "19.1.0-www-modern-a69b80d0-20250211", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-modern-a69b80d0-20250211" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -29083,7 +29068,7 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-modern-0461c0d8-20250211"; + exports.version = "19.1.0-www-modern-a69b80d0-20250211"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 3ab38d3419..d5217ae4d6 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -3663,11 +3663,11 @@ function rerenderActionState(action) { currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } -function pushSimpleEffect(tag, inst, create, deps) { +function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -3722,15 +3722,15 @@ function createEffectInstance() { function updateRef() { return updateWorkInProgressHook().memoizedState; } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { +function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -3749,60 +3749,68 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { deps ))); } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function mountEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + mountEffectImpl(8390656, 8, create, createDeps); + else { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); + } } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); -} -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); -} -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); +function updateEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + updateEffectImpl(2048, 8, create, createDeps); + else { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } function useEffectEventImpl(payload) { currentlyRenderingFiber.flags |= 4; @@ -4184,250 +4192,245 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = getTreeId(); + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = getTreeId(); - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; - } -}; -enableUseEffectCRUDOverload && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4481,8 +4484,6 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -8517,7 +8518,7 @@ function commitHookEffectListMount(flags, finishedWork) { function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -8529,59 +8530,33 @@ function commitHookEffectListUnmount( if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) - if ( - (enableUseEffectCRUDOverload - ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0), - enableUseEffectCRUDOverload) - ) { - if ( - 0 === updateQueue.resourceKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + void 0 !== destroy && + (enableUseEffectCRUDOverload + ? null == updateQueue.resourceKind && (inst.destroy = void 0) + : (inst.destroy = void 0), + enableUseEffectCRUDOverload + ? (0 === updateQueue.resourceKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - 1 === updateQueue.next.resourceKind && - (updateQueue.next.update = void 0); - updateQueue.inst.resource = null; - } - if (null == updateQueue.resourceKind) { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy, + updateQueue.inst.resource + ), + 1 === updateQueue.next.resourceKind && + (updateQueue.next.update = void 0), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } - } else { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } + destroy + )); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -8670,6 +8645,14 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else ref.current = null; } +function safelyCallDestroy(current, nearestMountedAncestor, destroy, resource) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } +} function commitProfilerPostCommit( finishedWork, current, @@ -14304,14 +14287,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$357; if (canUseDOM) { - var isSupported$jscomp$inline_1652 = "oninput" in document; - if (!isSupported$jscomp$inline_1652) { - var element$jscomp$inline_1653 = document.createElement("div"); - element$jscomp$inline_1653.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1652 = - "function" === typeof element$jscomp$inline_1653.oninput; + var isSupported$jscomp$inline_1635 = "oninput" in document; + if (!isSupported$jscomp$inline_1635) { + var element$jscomp$inline_1636 = document.createElement("div"); + element$jscomp$inline_1636.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1635 = + "function" === typeof element$jscomp$inline_1636.oninput; } - JSCompiler_inline_result$jscomp$357 = isSupported$jscomp$inline_1652; + JSCompiler_inline_result$jscomp$357 = isSupported$jscomp$inline_1635; } else JSCompiler_inline_result$jscomp$357 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$357 && @@ -14634,20 +14617,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1693 = 0; - i$jscomp$inline_1693 < simpleEventPluginEvents.length; - i$jscomp$inline_1693++ + var i$jscomp$inline_1676 = 0; + i$jscomp$inline_1676 < simpleEventPluginEvents.length; + i$jscomp$inline_1676++ ) { - var eventName$jscomp$inline_1694 = - simpleEventPluginEvents[i$jscomp$inline_1693], - domEventName$jscomp$inline_1695 = - eventName$jscomp$inline_1694.toLowerCase(), - capitalizedEvent$jscomp$inline_1696 = - eventName$jscomp$inline_1694[0].toUpperCase() + - eventName$jscomp$inline_1694.slice(1); + var eventName$jscomp$inline_1677 = + simpleEventPluginEvents[i$jscomp$inline_1676], + domEventName$jscomp$inline_1678 = + eventName$jscomp$inline_1677.toLowerCase(), + capitalizedEvent$jscomp$inline_1679 = + eventName$jscomp$inline_1677[0].toUpperCase() + + eventName$jscomp$inline_1677.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1695, - "on" + capitalizedEvent$jscomp$inline_1696 + domEventName$jscomp$inline_1678, + "on" + capitalizedEvent$jscomp$inline_1679 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -18438,16 +18421,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1871 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1854 = React.version; if ( - "19.1.0-www-classic-0461c0d8-20250211" !== - isomorphicReactPackageVersion$jscomp$inline_1871 + "19.1.0-www-classic-a69b80d0-20250211" !== + isomorphicReactPackageVersion$jscomp$inline_1854 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1871, - "19.1.0-www-classic-0461c0d8-20250211" + isomorphicReactPackageVersion$jscomp$inline_1854, + "19.1.0-www-classic-a69b80d0-20250211" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -18463,24 +18446,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2431 = { +var internals$jscomp$inline_2414 = { bundleType: 0, - version: "19.1.0-www-classic-0461c0d8-20250211", + version: "19.1.0-www-classic-a69b80d0-20250211", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-classic-a69b80d0-20250211" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2432 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2415 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2432.isDisabled && - hook$jscomp$inline_2432.supportsFiber + !hook$jscomp$inline_2415.isDisabled && + hook$jscomp$inline_2415.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2432.inject( - internals$jscomp$inline_2431 + (rendererID = hook$jscomp$inline_2415.inject( + internals$jscomp$inline_2414 )), - (injectedHook = hook$jscomp$inline_2432); + (injectedHook = hook$jscomp$inline_2415); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -18832,4 +18815,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-classic-0461c0d8-20250211"; +exports.version = "19.1.0-www-classic-a69b80d0-20250211"; diff --git a/compiled/facebook-www/ReactDOM-prod.modern.js b/compiled/facebook-www/ReactDOM-prod.modern.js index 9e92ae1a72..ba6f34a450 100644 --- a/compiled/facebook-www/ReactDOM-prod.modern.js +++ b/compiled/facebook-www/ReactDOM-prod.modern.js @@ -3509,11 +3509,11 @@ function rerenderActionState(action) { currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } -function pushSimpleEffect(tag, inst, create, deps) { +function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -3568,15 +3568,15 @@ function createEffectInstance() { function updateRef() { return updateWorkInProgressHook().memoizedState; } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { +function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -3595,60 +3595,68 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { deps ))); } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function mountEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + mountEffectImpl(8390656, 8, create, createDeps); + else { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); + } } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); -} -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); -} -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); +function updateEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + updateEffectImpl(2048, 8, create, createDeps); + else { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } function useEffectEventImpl(payload) { currentlyRenderingFiber.flags |= 4; @@ -4030,250 +4038,245 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = getTreeId(); + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = getTreeId(); - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; - } -}; -enableUseEffectCRUDOverload && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4327,8 +4330,6 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -8263,7 +8264,7 @@ function commitHookEffectListMount(flags, finishedWork) { function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -8275,59 +8276,33 @@ function commitHookEffectListUnmount( if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) - if ( - (enableUseEffectCRUDOverload - ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0), - enableUseEffectCRUDOverload) - ) { - if ( - 0 === updateQueue.resourceKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + void 0 !== destroy && + (enableUseEffectCRUDOverload + ? null == updateQueue.resourceKind && (inst.destroy = void 0) + : (inst.destroy = void 0), + enableUseEffectCRUDOverload + ? (0 === updateQueue.resourceKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - 1 === updateQueue.next.resourceKind && - (updateQueue.next.update = void 0); - updateQueue.inst.resource = null; - } - if (null == updateQueue.resourceKind) { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy, + updateQueue.inst.resource + ), + 1 === updateQueue.next.resourceKind && + (updateQueue.next.update = void 0), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } - } else { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } + destroy + )); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -8416,6 +8391,14 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else ref.current = null; } +function safelyCallDestroy(current, nearestMountedAncestor, destroy, resource) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } +} function commitProfilerPostCommit( finishedWork, current, @@ -14040,14 +14023,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$360; if (canUseDOM) { - var isSupported$jscomp$inline_1642 = "oninput" in document; - if (!isSupported$jscomp$inline_1642) { - var element$jscomp$inline_1643 = document.createElement("div"); - element$jscomp$inline_1643.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1642 = - "function" === typeof element$jscomp$inline_1643.oninput; + var isSupported$jscomp$inline_1625 = "oninput" in document; + if (!isSupported$jscomp$inline_1625) { + var element$jscomp$inline_1626 = document.createElement("div"); + element$jscomp$inline_1626.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1625 = + "function" === typeof element$jscomp$inline_1626.oninput; } - JSCompiler_inline_result$jscomp$360 = isSupported$jscomp$inline_1642; + JSCompiler_inline_result$jscomp$360 = isSupported$jscomp$inline_1625; } else JSCompiler_inline_result$jscomp$360 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$360 && @@ -14370,20 +14353,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1683 = 0; - i$jscomp$inline_1683 < simpleEventPluginEvents.length; - i$jscomp$inline_1683++ + var i$jscomp$inline_1666 = 0; + i$jscomp$inline_1666 < simpleEventPluginEvents.length; + i$jscomp$inline_1666++ ) { - var eventName$jscomp$inline_1684 = - simpleEventPluginEvents[i$jscomp$inline_1683], - domEventName$jscomp$inline_1685 = - eventName$jscomp$inline_1684.toLowerCase(), - capitalizedEvent$jscomp$inline_1686 = - eventName$jscomp$inline_1684[0].toUpperCase() + - eventName$jscomp$inline_1684.slice(1); + var eventName$jscomp$inline_1667 = + simpleEventPluginEvents[i$jscomp$inline_1666], + domEventName$jscomp$inline_1668 = + eventName$jscomp$inline_1667.toLowerCase(), + capitalizedEvent$jscomp$inline_1669 = + eventName$jscomp$inline_1667[0].toUpperCase() + + eventName$jscomp$inline_1667.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1685, - "on" + capitalizedEvent$jscomp$inline_1686 + domEventName$jscomp$inline_1668, + "on" + capitalizedEvent$jscomp$inline_1669 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -18169,16 +18152,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1861 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1844 = React.version; if ( - "19.1.0-www-modern-0461c0d8-20250211" !== - isomorphicReactPackageVersion$jscomp$inline_1861 + "19.1.0-www-modern-a69b80d0-20250211" !== + isomorphicReactPackageVersion$jscomp$inline_1844 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1861, - "19.1.0-www-modern-0461c0d8-20250211" + isomorphicReactPackageVersion$jscomp$inline_1844, + "19.1.0-www-modern-a69b80d0-20250211" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -18194,24 +18177,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2413 = { +var internals$jscomp$inline_2396 = { bundleType: 0, - version: "19.1.0-www-modern-0461c0d8-20250211", + version: "19.1.0-www-modern-a69b80d0-20250211", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-modern-a69b80d0-20250211" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2414 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2397 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2414.isDisabled && - hook$jscomp$inline_2414.supportsFiber + !hook$jscomp$inline_2397.isDisabled && + hook$jscomp$inline_2397.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2414.inject( - internals$jscomp$inline_2413 + (rendererID = hook$jscomp$inline_2397.inject( + internals$jscomp$inline_2396 )), - (injectedHook = hook$jscomp$inline_2414); + (injectedHook = hook$jscomp$inline_2397); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -18563,4 +18546,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-modern-0461c0d8-20250211"; +exports.version = "19.1.0-www-modern-a69b80d0-20250211"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 8861321357..6f974c679a 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -3831,11 +3831,11 @@ function rerenderActionState(action) { currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } -function pushSimpleEffect(tag, inst, create, deps) { +function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -3890,15 +3890,15 @@ function createEffectInstance() { function updateRef() { return updateWorkInProgressHook().memoizedState; } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { +function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -3917,60 +3917,68 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { deps ))); } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function mountEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + mountEffectImpl(8390656, 8, create, createDeps); + else { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); + } } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); -} -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); -} -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); +function updateEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + updateEffectImpl(2048, 8, create, createDeps); + else { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } function useEffectEventImpl(payload) { currentlyRenderingFiber.flags |= 4; @@ -4355,250 +4363,245 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = getTreeId(); + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = getTreeId(); - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; - } -}; -enableUseEffectCRUDOverload && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4652,8 +4655,6 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -8845,7 +8846,7 @@ function commitHookEffectListMount(flags, finishedWork) { function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -8857,10 +8858,10 @@ function commitHookEffectListUnmount( if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) { - enableUseEffectCRUDOverload + void 0 !== destroy && + (enableUseEffectCRUDOverload ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0); + : (inst.destroy = void 0), enableSchedulingProfiler && (0 !== (flags & 8) ? enableSchedulingProfiler && @@ -8877,54 +8878,30 @@ function commitHookEffectListUnmount( typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( finishedWork - )); - if (enableUseEffectCRUDOverload) { - if ( - 0 === updateQueue.resourceKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + )), + enableUseEffectCRUDOverload + ? (0 === updateQueue.resourceKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - 1 === updateQueue.next.resourceKind && - (updateQueue.next.update = void 0); - updateQueue.inst.resource = null; - } - if (null == updateQueue.resourceKind) { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy, + updateQueue.inst.resource + ), + 1 === updateQueue.next.resourceKind && + (updateQueue.next.update = void 0), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } - } else { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } + destroy + ), enableSchedulingProfiler && (0 !== (flags & 8) ? enableSchedulingProfiler && @@ -8937,8 +8914,7 @@ function commitHookEffectListUnmount( null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); - } + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -9080,6 +9056,14 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else ref.current = null; } +function safelyCallDestroy(current, nearestMountedAncestor, destroy, resource) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } +} function commitProfilerUpdate( finishedWork, current, @@ -14995,14 +14979,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$374; if (canUseDOM) { - var isSupported$jscomp$inline_1749 = "oninput" in document; - if (!isSupported$jscomp$inline_1749) { - var element$jscomp$inline_1750 = document.createElement("div"); - element$jscomp$inline_1750.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1749 = - "function" === typeof element$jscomp$inline_1750.oninput; + var isSupported$jscomp$inline_1732 = "oninput" in document; + if (!isSupported$jscomp$inline_1732) { + var element$jscomp$inline_1733 = document.createElement("div"); + element$jscomp$inline_1733.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1732 = + "function" === typeof element$jscomp$inline_1733.oninput; } - JSCompiler_inline_result$jscomp$374 = isSupported$jscomp$inline_1749; + JSCompiler_inline_result$jscomp$374 = isSupported$jscomp$inline_1732; } else JSCompiler_inline_result$jscomp$374 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$374 && @@ -15325,20 +15309,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1790 = 0; - i$jscomp$inline_1790 < simpleEventPluginEvents.length; - i$jscomp$inline_1790++ + var i$jscomp$inline_1773 = 0; + i$jscomp$inline_1773 < simpleEventPluginEvents.length; + i$jscomp$inline_1773++ ) { - var eventName$jscomp$inline_1791 = - simpleEventPluginEvents[i$jscomp$inline_1790], - domEventName$jscomp$inline_1792 = - eventName$jscomp$inline_1791.toLowerCase(), - capitalizedEvent$jscomp$inline_1793 = - eventName$jscomp$inline_1791[0].toUpperCase() + - eventName$jscomp$inline_1791.slice(1); + var eventName$jscomp$inline_1774 = + simpleEventPluginEvents[i$jscomp$inline_1773], + domEventName$jscomp$inline_1775 = + eventName$jscomp$inline_1774.toLowerCase(), + capitalizedEvent$jscomp$inline_1776 = + eventName$jscomp$inline_1774[0].toUpperCase() + + eventName$jscomp$inline_1774.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1792, - "on" + capitalizedEvent$jscomp$inline_1793 + domEventName$jscomp$inline_1775, + "on" + capitalizedEvent$jscomp$inline_1776 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -19129,16 +19113,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1968 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1951 = React.version; if ( - "19.1.0-www-classic-0461c0d8-20250211" !== - isomorphicReactPackageVersion$jscomp$inline_1968 + "19.1.0-www-classic-a69b80d0-20250211" !== + isomorphicReactPackageVersion$jscomp$inline_1951 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1968, - "19.1.0-www-classic-0461c0d8-20250211" + isomorphicReactPackageVersion$jscomp$inline_1951, + "19.1.0-www-classic-a69b80d0-20250211" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -19154,27 +19138,27 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1970 = { +var internals$jscomp$inline_1953 = { bundleType: 0, - version: "19.1.0-www-classic-0461c0d8-20250211", + version: "19.1.0-www-classic-a69b80d0-20250211", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-classic-a69b80d0-20250211" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1970.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1970.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1953.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1953.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2490 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2473 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2490.isDisabled && - hook$jscomp$inline_2490.supportsFiber + !hook$jscomp$inline_2473.isDisabled && + hook$jscomp$inline_2473.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2490.inject( - internals$jscomp$inline_1970 + (rendererID = hook$jscomp$inline_2473.inject( + internals$jscomp$inline_1953 )), - (injectedHook = hook$jscomp$inline_2490); + (injectedHook = hook$jscomp$inline_2473); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -19526,7 +19510,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-classic-0461c0d8-20250211"; +exports.version = "19.1.0-www-classic-a69b80d0-20250211"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOM-profiling.modern.js b/compiled/facebook-www/ReactDOM-profiling.modern.js index b6f31112e6..04df296eda 100644 --- a/compiled/facebook-www/ReactDOM-profiling.modern.js +++ b/compiled/facebook-www/ReactDOM-profiling.modern.js @@ -3677,11 +3677,11 @@ function rerenderActionState(action) { currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } -function pushSimpleEffect(tag, inst, create, deps) { +function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -3736,15 +3736,15 @@ function createEffectInstance() { function updateRef() { return updateWorkInProgressHook().memoizedState; } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { +function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -3763,60 +3763,68 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { deps ))); } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function mountEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + mountEffectImpl(8390656, 8, create, createDeps); + else { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); + } } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); -} -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); -} -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); +function updateEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + updateEffectImpl(2048, 8, create, createDeps); + else { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } function useEffectEventImpl(payload) { currentlyRenderingFiber.flags |= 4; @@ -4201,250 +4209,245 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = getTreeId(); + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = getTreeId(); - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; - } -}; -enableUseEffectCRUDOverload && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4498,8 +4501,6 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -8590,7 +8591,7 @@ function commitHookEffectListMount(flags, finishedWork) { function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -8602,10 +8603,10 @@ function commitHookEffectListUnmount( if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) { - enableUseEffectCRUDOverload + void 0 !== destroy && + (enableUseEffectCRUDOverload ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0); + : (inst.destroy = void 0), enableSchedulingProfiler && (0 !== (flags & 8) ? enableSchedulingProfiler && @@ -8622,54 +8623,30 @@ function commitHookEffectListUnmount( typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( finishedWork - )); - if (enableUseEffectCRUDOverload) { - if ( - 0 === updateQueue.resourceKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + )), + enableUseEffectCRUDOverload + ? (0 === updateQueue.resourceKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - 1 === updateQueue.next.resourceKind && - (updateQueue.next.update = void 0); - updateQueue.inst.resource = null; - } - if (null == updateQueue.resourceKind) { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy, + updateQueue.inst.resource + ), + 1 === updateQueue.next.resourceKind && + (updateQueue.next.update = void 0), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } - } else { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } + destroy + ), enableSchedulingProfiler && (0 !== (flags & 8) ? enableSchedulingProfiler && @@ -8682,8 +8659,7 @@ function commitHookEffectListUnmount( null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); - } + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -8825,6 +8801,14 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else ref.current = null; } +function safelyCallDestroy(current, nearestMountedAncestor, destroy, resource) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } +} function commitProfilerUpdate( finishedWork, current, @@ -14730,14 +14714,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$377; if (canUseDOM) { - var isSupported$jscomp$inline_1739 = "oninput" in document; - if (!isSupported$jscomp$inline_1739) { - var element$jscomp$inline_1740 = document.createElement("div"); - element$jscomp$inline_1740.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1739 = - "function" === typeof element$jscomp$inline_1740.oninput; + var isSupported$jscomp$inline_1722 = "oninput" in document; + if (!isSupported$jscomp$inline_1722) { + var element$jscomp$inline_1723 = document.createElement("div"); + element$jscomp$inline_1723.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1722 = + "function" === typeof element$jscomp$inline_1723.oninput; } - JSCompiler_inline_result$jscomp$377 = isSupported$jscomp$inline_1739; + JSCompiler_inline_result$jscomp$377 = isSupported$jscomp$inline_1722; } else JSCompiler_inline_result$jscomp$377 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$377 && @@ -15060,20 +15044,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1780 = 0; - i$jscomp$inline_1780 < simpleEventPluginEvents.length; - i$jscomp$inline_1780++ + var i$jscomp$inline_1763 = 0; + i$jscomp$inline_1763 < simpleEventPluginEvents.length; + i$jscomp$inline_1763++ ) { - var eventName$jscomp$inline_1781 = - simpleEventPluginEvents[i$jscomp$inline_1780], - domEventName$jscomp$inline_1782 = - eventName$jscomp$inline_1781.toLowerCase(), - capitalizedEvent$jscomp$inline_1783 = - eventName$jscomp$inline_1781[0].toUpperCase() + - eventName$jscomp$inline_1781.slice(1); + var eventName$jscomp$inline_1764 = + simpleEventPluginEvents[i$jscomp$inline_1763], + domEventName$jscomp$inline_1765 = + eventName$jscomp$inline_1764.toLowerCase(), + capitalizedEvent$jscomp$inline_1766 = + eventName$jscomp$inline_1764[0].toUpperCase() + + eventName$jscomp$inline_1764.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1782, - "on" + capitalizedEvent$jscomp$inline_1783 + domEventName$jscomp$inline_1765, + "on" + capitalizedEvent$jscomp$inline_1766 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -18859,16 +18843,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1958 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1941 = React.version; if ( - "19.1.0-www-modern-0461c0d8-20250211" !== - isomorphicReactPackageVersion$jscomp$inline_1958 + "19.1.0-www-modern-a69b80d0-20250211" !== + isomorphicReactPackageVersion$jscomp$inline_1941 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1958, - "19.1.0-www-modern-0461c0d8-20250211" + isomorphicReactPackageVersion$jscomp$inline_1941, + "19.1.0-www-modern-a69b80d0-20250211" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -18884,27 +18868,27 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_1960 = { +var internals$jscomp$inline_1943 = { bundleType: 0, - version: "19.1.0-www-modern-0461c0d8-20250211", + version: "19.1.0-www-modern-a69b80d0-20250211", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-modern-a69b80d0-20250211" }; enableSchedulingProfiler && - ((internals$jscomp$inline_1960.getLaneLabelMap = getLaneLabelMap), - (internals$jscomp$inline_1960.injectProfilingHooks = injectProfilingHooks)); + ((internals$jscomp$inline_1943.getLaneLabelMap = getLaneLabelMap), + (internals$jscomp$inline_1943.injectProfilingHooks = injectProfilingHooks)); if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2472 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2455 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2472.isDisabled && - hook$jscomp$inline_2472.supportsFiber + !hook$jscomp$inline_2455.isDisabled && + hook$jscomp$inline_2455.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2472.inject( - internals$jscomp$inline_1960 + (rendererID = hook$jscomp$inline_2455.inject( + internals$jscomp$inline_1943 )), - (injectedHook = hook$jscomp$inline_2472); + (injectedHook = hook$jscomp$inline_2455); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -19256,7 +19240,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-modern-0461c0d8-20250211"; +exports.version = "19.1.0-www-modern-a69b80d0-20250211"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/compiled/facebook-www/ReactDOMServer-dev.classic.js b/compiled/facebook-www/ReactDOMServer-dev.classic.js index 57ca0640cd..dfcdba05a9 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.classic.js +++ b/compiled/facebook-www/ReactDOMServer-dev.classic.js @@ -8006,8 +8006,6 @@ __DEV__ && dynamicFeatureFlags.disableLegacyContextForFunctionComponents, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableUseEffectCRUDOverload = - dynamicFeatureFlags.enableUseEffectCRUDOverload, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, enableViewTransition = dynamicFeatureFlags.enableViewTransition, @@ -9398,9 +9396,8 @@ __DEV__ && useEffectEvent: function () { return throwOnUseEffectEventCall; } - }; - enableUseEffectCRUDOverload && (HooksDispatcher.useResourceEffect = noop$1); - var currentResumableState = null, + }, + currentResumableState = null, currentTaskInDEV = null, DefaultAsyncDispatcher = { getCacheForType: function () { @@ -9479,5 +9476,5 @@ __DEV__ && 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.1.0-www-classic-0461c0d8-20250211"; + exports.version = "19.1.0-www-classic-a69b80d0-20250211"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 5436e88f0d..f8aa258376 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -7834,8 +7834,6 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableUseEffectCRUDOverload = - dynamicFeatureFlags.enableUseEffectCRUDOverload, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, enableViewTransition = dynamicFeatureFlags.enableViewTransition, @@ -9224,9 +9222,8 @@ __DEV__ && useEffectEvent: function () { return throwOnUseEffectEventCall; } - }; - enableUseEffectCRUDOverload && (HooksDispatcher.useResourceEffect = noop$1); - var currentResumableState = null, + }, + currentResumableState = null, currentTaskInDEV = null, DefaultAsyncDispatcher = { getCacheForType: function () { @@ -9305,5 +9302,5 @@ __DEV__ && 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.1.0-www-modern-0461c0d8-20250211"; + exports.version = "19.1.0-www-modern-a69b80d0-20250211"; })(); diff --git a/compiled/facebook-www/ReactDOMServer-prod.classic.js b/compiled/facebook-www/ReactDOMServer-prod.classic.js index 2f54b29a26..1eee0adf7e 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.classic.js +++ b/compiled/facebook-www/ReactDOMServer-prod.classic.js @@ -59,7 +59,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableLegacyContextForFunctionComponents, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableUseEffectCRUDOverload = dynamicFeatureFlags.enableUseEffectCRUDOverload, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, enableViewTransition = dynamicFeatureFlags.enableViewTransition, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), @@ -3350,97 +3349,98 @@ function unsupportedRefresh() { } function noop$1() {} var HooksDispatcher = { - readContext: function (context) { - return context._currentValue2; - }, - use: function (usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return unwrapThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return usable._currentValue2; + readContext: function (context) { + return context._currentValue2; + }, + use: function (usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return unwrapThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) + return usable._currentValue2; + } + throw Error(formatProdErrorMessage(438, String(usable))); + }, + useContext: function (context) { + resolveCurrentlyRenderingComponent(); + return context._currentValue2; + }, + useMemo: useMemo, + useReducer: useReducer, + useRef: function (initialValue) { + currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); + workInProgressHook = createWorkInProgressHook(); + var previousRef = workInProgressHook.memoizedState; + return null === previousRef + ? ((initialValue = { current: initialValue }), + (workInProgressHook.memoizedState = initialValue)) + : previousRef; + }, + useState: function (initialState) { + return useReducer(basicStateReducer, initialState); + }, + useInsertionEffect: noop$1, + useLayoutEffect: noop$1, + useCallback: function (callback, deps) { + return useMemo(function () { + return callback; + }, deps); + }, + useImperativeHandle: noop$1, + useEffect: noop$1, + useDebugValue: noop$1, + useDeferredValue: function (value, initialValue) { + resolveCurrentlyRenderingComponent(); + return void 0 !== initialValue ? initialValue : value; + }, + useTransition: function () { + resolveCurrentlyRenderingComponent(); + return [!1, unsupportedStartTransition]; + }, + useId: function () { + var JSCompiler_inline_result = currentlyRenderingTask.treeContext; + var overflow = JSCompiler_inline_result.overflow; + JSCompiler_inline_result = JSCompiler_inline_result.id; + JSCompiler_inline_result = + ( + JSCompiler_inline_result & + ~(1 << (32 - clz32(JSCompiler_inline_result) - 1)) + ).toString(32) + overflow; + var resumableState = currentResumableState; + if (null === resumableState) throw Error(formatProdErrorMessage(404)); + overflow = localIdCounter++; + JSCompiler_inline_result = + ":" + resumableState.idPrefix + "R" + JSCompiler_inline_result; + 0 < overflow && (JSCompiler_inline_result += "H" + overflow.toString(32)); + return JSCompiler_inline_result + ":"; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + return getServerSnapshot(); + }, + useOptimistic: function (passthrough) { + resolveCurrentlyRenderingComponent(); + return [passthrough, unsupportedSetOptimisticState]; + }, + useActionState: useActionState, + useFormState: useActionState, + useHostTransitionStatus: function () { + resolveCurrentlyRenderingComponent(); + return sharedNotPendingObject; + }, + useMemoCache: function (size) { + for (var data = Array(size), i = 0; i < size; i++) + data[i] = REACT_MEMO_CACHE_SENTINEL; + return data; + }, + useCacheRefresh: function () { + return unsupportedRefresh; + }, + useEffectEvent: function () { + return throwOnUseEffectEventCall; } - throw Error(formatProdErrorMessage(438, String(usable))); }, - useContext: function (context) { - resolveCurrentlyRenderingComponent(); - return context._currentValue2; - }, - useMemo: useMemo, - useReducer: useReducer, - useRef: function (initialValue) { - currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); - workInProgressHook = createWorkInProgressHook(); - var previousRef = workInProgressHook.memoizedState; - return null === previousRef - ? ((initialValue = { current: initialValue }), - (workInProgressHook.memoizedState = initialValue)) - : previousRef; - }, - useState: function (initialState) { - return useReducer(basicStateReducer, initialState); - }, - useInsertionEffect: noop$1, - useLayoutEffect: noop$1, - useCallback: function (callback, deps) { - return useMemo(function () { - return callback; - }, deps); - }, - useImperativeHandle: noop$1, - useEffect: noop$1, - useDebugValue: noop$1, - useDeferredValue: function (value, initialValue) { - resolveCurrentlyRenderingComponent(); - return void 0 !== initialValue ? initialValue : value; - }, - useTransition: function () { - resolveCurrentlyRenderingComponent(); - return [!1, unsupportedStartTransition]; - }, - useId: function () { - var JSCompiler_inline_result = currentlyRenderingTask.treeContext; - var overflow = JSCompiler_inline_result.overflow; - JSCompiler_inline_result = JSCompiler_inline_result.id; - JSCompiler_inline_result = - ( - JSCompiler_inline_result & - ~(1 << (32 - clz32(JSCompiler_inline_result) - 1)) - ).toString(32) + overflow; - var resumableState = currentResumableState; - if (null === resumableState) throw Error(formatProdErrorMessage(404)); - overflow = localIdCounter++; - JSCompiler_inline_result = - ":" + resumableState.idPrefix + "R" + JSCompiler_inline_result; - 0 < overflow && (JSCompiler_inline_result += "H" + overflow.toString(32)); - return JSCompiler_inline_result + ":"; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); - return getServerSnapshot(); - }, - useOptimistic: function (passthrough) { - resolveCurrentlyRenderingComponent(); - return [passthrough, unsupportedSetOptimisticState]; - }, - useActionState: useActionState, - useFormState: useActionState, - useHostTransitionStatus: function () { - resolveCurrentlyRenderingComponent(); - return sharedNotPendingObject; - }, - useMemoCache: function (size) { - for (var data = Array(size), i = 0; i < size; i++) - data[i] = REACT_MEMO_CACHE_SENTINEL; - return data; - }, - useCacheRefresh: function () { - return unsupportedRefresh; - }, - useEffectEvent: function () { - return throwOnUseEffectEventCall; - } -}; -enableUseEffectCRUDOverload && (HooksDispatcher.useResourceEffect = noop$1); -var currentResumableState = null, + currentResumableState = null, DefaultAsyncDispatcher = { getCacheForType: function () { throw Error(formatProdErrorMessage(248)); @@ -6194,4 +6194,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.1.0-www-classic-0461c0d8-20250211"; +exports.version = "19.1.0-www-classic-a69b80d0-20250211"; diff --git a/compiled/facebook-www/ReactDOMServer-prod.modern.js b/compiled/facebook-www/ReactDOMServer-prod.modern.js index 2e94ec4528..a48f78c779 100644 --- a/compiled/facebook-www/ReactDOMServer-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServer-prod.modern.js @@ -57,7 +57,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"), dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableUseEffectCRUDOverload = dynamicFeatureFlags.enableUseEffectCRUDOverload, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, enableViewTransition = dynamicFeatureFlags.enableViewTransition, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), @@ -3340,97 +3339,98 @@ function unsupportedRefresh() { } function noop$1() {} var HooksDispatcher = { - readContext: function (context) { - return context._currentValue2; - }, - use: function (usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return unwrapThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return usable._currentValue2; + readContext: function (context) { + return context._currentValue2; + }, + use: function (usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return unwrapThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) + return usable._currentValue2; + } + throw Error(formatProdErrorMessage(438, String(usable))); + }, + useContext: function (context) { + resolveCurrentlyRenderingComponent(); + return context._currentValue2; + }, + useMemo: useMemo, + useReducer: useReducer, + useRef: function (initialValue) { + currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); + workInProgressHook = createWorkInProgressHook(); + var previousRef = workInProgressHook.memoizedState; + return null === previousRef + ? ((initialValue = { current: initialValue }), + (workInProgressHook.memoizedState = initialValue)) + : previousRef; + }, + useState: function (initialState) { + return useReducer(basicStateReducer, initialState); + }, + useInsertionEffect: noop$1, + useLayoutEffect: noop$1, + useCallback: function (callback, deps) { + return useMemo(function () { + return callback; + }, deps); + }, + useImperativeHandle: noop$1, + useEffect: noop$1, + useDebugValue: noop$1, + useDeferredValue: function (value, initialValue) { + resolveCurrentlyRenderingComponent(); + return void 0 !== initialValue ? initialValue : value; + }, + useTransition: function () { + resolveCurrentlyRenderingComponent(); + return [!1, unsupportedStartTransition]; + }, + useId: function () { + var JSCompiler_inline_result = currentlyRenderingTask.treeContext; + var overflow = JSCompiler_inline_result.overflow; + JSCompiler_inline_result = JSCompiler_inline_result.id; + JSCompiler_inline_result = + ( + JSCompiler_inline_result & + ~(1 << (32 - clz32(JSCompiler_inline_result) - 1)) + ).toString(32) + overflow; + var resumableState = currentResumableState; + if (null === resumableState) throw Error(formatProdErrorMessage(404)); + overflow = localIdCounter++; + JSCompiler_inline_result = + ":" + resumableState.idPrefix + "R" + JSCompiler_inline_result; + 0 < overflow && (JSCompiler_inline_result += "H" + overflow.toString(32)); + return JSCompiler_inline_result + ":"; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + return getServerSnapshot(); + }, + useOptimistic: function (passthrough) { + resolveCurrentlyRenderingComponent(); + return [passthrough, unsupportedSetOptimisticState]; + }, + useActionState: useActionState, + useFormState: useActionState, + useHostTransitionStatus: function () { + resolveCurrentlyRenderingComponent(); + return sharedNotPendingObject; + }, + useMemoCache: function (size) { + for (var data = Array(size), i = 0; i < size; i++) + data[i] = REACT_MEMO_CACHE_SENTINEL; + return data; + }, + useCacheRefresh: function () { + return unsupportedRefresh; + }, + useEffectEvent: function () { + return throwOnUseEffectEventCall; } - throw Error(formatProdErrorMessage(438, String(usable))); }, - useContext: function (context) { - resolveCurrentlyRenderingComponent(); - return context._currentValue2; - }, - useMemo: useMemo, - useReducer: useReducer, - useRef: function (initialValue) { - currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); - workInProgressHook = createWorkInProgressHook(); - var previousRef = workInProgressHook.memoizedState; - return null === previousRef - ? ((initialValue = { current: initialValue }), - (workInProgressHook.memoizedState = initialValue)) - : previousRef; - }, - useState: function (initialState) { - return useReducer(basicStateReducer, initialState); - }, - useInsertionEffect: noop$1, - useLayoutEffect: noop$1, - useCallback: function (callback, deps) { - return useMemo(function () { - return callback; - }, deps); - }, - useImperativeHandle: noop$1, - useEffect: noop$1, - useDebugValue: noop$1, - useDeferredValue: function (value, initialValue) { - resolveCurrentlyRenderingComponent(); - return void 0 !== initialValue ? initialValue : value; - }, - useTransition: function () { - resolveCurrentlyRenderingComponent(); - return [!1, unsupportedStartTransition]; - }, - useId: function () { - var JSCompiler_inline_result = currentlyRenderingTask.treeContext; - var overflow = JSCompiler_inline_result.overflow; - JSCompiler_inline_result = JSCompiler_inline_result.id; - JSCompiler_inline_result = - ( - JSCompiler_inline_result & - ~(1 << (32 - clz32(JSCompiler_inline_result) - 1)) - ).toString(32) + overflow; - var resumableState = currentResumableState; - if (null === resumableState) throw Error(formatProdErrorMessage(404)); - overflow = localIdCounter++; - JSCompiler_inline_result = - ":" + resumableState.idPrefix + "R" + JSCompiler_inline_result; - 0 < overflow && (JSCompiler_inline_result += "H" + overflow.toString(32)); - return JSCompiler_inline_result + ":"; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); - return getServerSnapshot(); - }, - useOptimistic: function (passthrough) { - resolveCurrentlyRenderingComponent(); - return [passthrough, unsupportedSetOptimisticState]; - }, - useActionState: useActionState, - useFormState: useActionState, - useHostTransitionStatus: function () { - resolveCurrentlyRenderingComponent(); - return sharedNotPendingObject; - }, - useMemoCache: function (size) { - for (var data = Array(size), i = 0; i < size; i++) - data[i] = REACT_MEMO_CACHE_SENTINEL; - return data; - }, - useCacheRefresh: function () { - return unsupportedRefresh; - }, - useEffectEvent: function () { - return throwOnUseEffectEventCall; - } -}; -enableUseEffectCRUDOverload && (HooksDispatcher.useResourceEffect = noop$1); -var currentResumableState = null, + currentResumableState = null, DefaultAsyncDispatcher = { getCacheForType: function () { throw Error(formatProdErrorMessage(248)); @@ -6106,4 +6106,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.1.0-www-modern-0461c0d8-20250211"; +exports.version = "19.1.0-www-modern-a69b80d0-20250211"; diff --git a/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js b/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js index 7cf740b5c4..c596a5e1ad 100644 --- a/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js @@ -7231,8 +7231,6 @@ __DEV__ && dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableUseEffectCRUDOverload = - dynamicFeatureFlags.enableUseEffectCRUDOverload, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, enableOwnerStacks = dynamicFeatureFlags.enableOwnerStacks, enableViewTransition = dynamicFeatureFlags.enableViewTransition, @@ -8525,9 +8523,8 @@ __DEV__ && useEffectEvent: function () { return throwOnUseEffectEventCall; } - }; - enableUseEffectCRUDOverload && (HooksDispatcher.useResourceEffect = noop$1); - var currentResumableState = null, + }, + currentResumableState = null, currentTaskInDEV = null, DefaultAsyncDispatcher = { getCacheForType: function () { diff --git a/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js b/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js index bb5e5e7521..247eb22306 100644 --- a/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js +++ b/compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js @@ -42,7 +42,6 @@ var React = require("react"), dynamicFeatureFlags.disableDefaultPropsExceptForClasses, enableRenderableContext = dynamicFeatureFlags.enableRenderableContext, enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing, - enableUseEffectCRUDOverload = dynamicFeatureFlags.enableUseEffectCRUDOverload, renameElementSymbol = dynamicFeatureFlags.renameElementSymbol, enableViewTransition = dynamicFeatureFlags.enableViewTransition, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), @@ -3221,103 +3220,102 @@ function unsupportedRefresh() { } function noop$1() {} var HooksDispatcher = { - readContext: function (context) { - return context._currentValue; - }, - use: function (usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return unwrapThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return usable._currentValue; + readContext: function (context) { + return context._currentValue; + }, + use: function (usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return unwrapThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return usable._currentValue; + } + throw Error("An unsupported type was passed to use(): " + String(usable)); + }, + useContext: function (context) { + resolveCurrentlyRenderingComponent(); + return context._currentValue; + }, + useMemo: useMemo, + useReducer: useReducer, + useRef: function (initialValue) { + currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); + workInProgressHook = createWorkInProgressHook(); + var previousRef = workInProgressHook.memoizedState; + return null === previousRef + ? ((initialValue = { current: initialValue }), + (workInProgressHook.memoizedState = initialValue)) + : previousRef; + }, + useState: function (initialState) { + return useReducer(basicStateReducer, initialState); + }, + useInsertionEffect: noop$1, + useLayoutEffect: noop$1, + useCallback: function (callback, deps) { + return useMemo(function () { + return callback; + }, deps); + }, + useImperativeHandle: noop$1, + useEffect: noop$1, + useDebugValue: noop$1, + useDeferredValue: function (value, initialValue) { + resolveCurrentlyRenderingComponent(); + return void 0 !== initialValue ? initialValue : value; + }, + useTransition: function () { + resolveCurrentlyRenderingComponent(); + return [!1, unsupportedStartTransition]; + }, + useId: function () { + var JSCompiler_inline_result = currentlyRenderingTask.treeContext; + var overflow = JSCompiler_inline_result.overflow; + JSCompiler_inline_result = JSCompiler_inline_result.id; + JSCompiler_inline_result = + ( + JSCompiler_inline_result & + ~(1 << (32 - clz32(JSCompiler_inline_result) - 1)) + ).toString(32) + overflow; + var resumableState = currentResumableState; + if (null === resumableState) + throw Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component." + ); + overflow = localIdCounter++; + JSCompiler_inline_result = + ":" + resumableState.idPrefix + "R" + JSCompiler_inline_result; + 0 < overflow && (JSCompiler_inline_result += "H" + overflow.toString(32)); + return JSCompiler_inline_result + ":"; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." + ); + return getServerSnapshot(); + }, + useOptimistic: function (passthrough) { + resolveCurrentlyRenderingComponent(); + return [passthrough, unsupportedSetOptimisticState]; + }, + useActionState: useActionState, + useFormState: useActionState, + useHostTransitionStatus: function () { + resolveCurrentlyRenderingComponent(); + return sharedNotPendingObject; + }, + useMemoCache: function (size) { + for (var data = Array(size), i = 0; i < size; i++) + data[i] = REACT_MEMO_CACHE_SENTINEL; + return data; + }, + useCacheRefresh: function () { + return unsupportedRefresh; + }, + useEffectEvent: function () { + return throwOnUseEffectEventCall; } - throw Error("An unsupported type was passed to use(): " + String(usable)); }, - useContext: function (context) { - resolveCurrentlyRenderingComponent(); - return context._currentValue; - }, - useMemo: useMemo, - useReducer: useReducer, - useRef: function (initialValue) { - currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); - workInProgressHook = createWorkInProgressHook(); - var previousRef = workInProgressHook.memoizedState; - return null === previousRef - ? ((initialValue = { current: initialValue }), - (workInProgressHook.memoizedState = initialValue)) - : previousRef; - }, - useState: function (initialState) { - return useReducer(basicStateReducer, initialState); - }, - useInsertionEffect: noop$1, - useLayoutEffect: noop$1, - useCallback: function (callback, deps) { - return useMemo(function () { - return callback; - }, deps); - }, - useImperativeHandle: noop$1, - useEffect: noop$1, - useDebugValue: noop$1, - useDeferredValue: function (value, initialValue) { - resolveCurrentlyRenderingComponent(); - return void 0 !== initialValue ? initialValue : value; - }, - useTransition: function () { - resolveCurrentlyRenderingComponent(); - return [!1, unsupportedStartTransition]; - }, - useId: function () { - var JSCompiler_inline_result = currentlyRenderingTask.treeContext; - var overflow = JSCompiler_inline_result.overflow; - JSCompiler_inline_result = JSCompiler_inline_result.id; - JSCompiler_inline_result = - ( - JSCompiler_inline_result & - ~(1 << (32 - clz32(JSCompiler_inline_result) - 1)) - ).toString(32) + overflow; - var resumableState = currentResumableState; - if (null === resumableState) - throw Error( - "Invalid hook call. Hooks can only be called inside of the body of a function component." - ); - overflow = localIdCounter++; - JSCompiler_inline_result = - ":" + resumableState.idPrefix + "R" + JSCompiler_inline_result; - 0 < overflow && (JSCompiler_inline_result += "H" + overflow.toString(32)); - return JSCompiler_inline_result + ":"; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - return getServerSnapshot(); - }, - useOptimistic: function (passthrough) { - resolveCurrentlyRenderingComponent(); - return [passthrough, unsupportedSetOptimisticState]; - }, - useActionState: useActionState, - useFormState: useActionState, - useHostTransitionStatus: function () { - resolveCurrentlyRenderingComponent(); - return sharedNotPendingObject; - }, - useMemoCache: function (size) { - for (var data = Array(size), i = 0; i < size; i++) - data[i] = REACT_MEMO_CACHE_SENTINEL; - return data; - }, - useCacheRefresh: function () { - return unsupportedRefresh; - }, - useEffectEvent: function () { - return throwOnUseEffectEventCall; - } -}; -enableUseEffectCRUDOverload && (HooksDispatcher.useResourceEffect = noop$1); -var currentResumableState = null, + currentResumableState = null, DefaultAsyncDispatcher = { getCacheForType: function () { throw Error("Not implemented."); diff --git a/compiled/facebook-www/ReactDOMTesting-dev.classic.js b/compiled/facebook-www/ReactDOMTesting-dev.classic.js index 05a261ee28..78d8e7f51c 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.classic.js @@ -5707,8 +5707,9 @@ __DEV__ && ) (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); if ( hook.getSnapshot !== getSnapshot || cachedSnapshot || @@ -6112,11 +6113,11 @@ __DEV__ && currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { + function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -6173,15 +6174,15 @@ __DEV__ && initialValue = { current: initialValue }; return (hook.memoizedState = initialValue); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -6200,11 +6201,47 @@ __DEV__ && deps ))); } - function mountEffect(create, deps) { + function mountEffect(create, createDeps, update, updateDeps, destroy) { (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode - ? mountEffectImpl(276826112, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + ? !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(276826112, Passive, create, createDeps) + : mountResourceEffectImpl( + 276826112, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ) + : !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(8390656, Passive, create, createDeps) + : mountResourceEffectImpl( + 8390656, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); + } + function updateEffect(create, createDeps, update, updateDeps, destroy) { + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? updateEffectImpl(2048, Passive, create, createDeps) + : updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); } function mountResourceEffect( create, @@ -6213,39 +6250,41 @@ __DEV__ && updateDeps, destroy ) { - if ( - (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode - ) { - var hookFlags = Passive, - hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 276826112; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, + ((currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === + NoMode) || + mountResourceEffectImpl( + 8390656, + Passive, create, createDeps, update, - updateDeps + updateDeps, + destroy ); - } else - (hookFlags = Passive), - (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber.flags |= 8390656), - (inst = createEffectInstance()), - (inst.destroy = destroy), - (hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps - )); + } + function mountResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy + ) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= fiberFlags; + fiberFlags = createEffectInstance(); + fiberFlags.destroy = destroy; + hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + fiberFlags, + create, + createDeps, + update, + updateDeps + ); } function updateResourceEffectImpl( fiberFlags, @@ -9668,32 +9707,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2654; - var JSCompiler_object_inline_stack_2655 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2601; + var JSCompiler_object_inline_stack_2602 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2656 = !1; + var JSCompiler_object_inline_componentStack_2603 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2654 = didSuspend) || - (JSCompiler_object_inline_digest_2654 = + (JSCompiler_object_inline_digest_2601 = didSuspend) || + (JSCompiler_object_inline_digest_2601 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2654 && - ((JSCompiler_object_inline_componentStack_2656 = !0), + JSCompiler_object_inline_digest_2601 && + ((JSCompiler_object_inline_componentStack_2603 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2654 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2601 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2656 + JSCompiler_object_inline_componentStack_2603 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2653 = nextHydratableInstance; + var JSCompiler_object_inline_message_2600 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2653)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2600)) { c: { - var instance = JSCompiler_object_inline_message_2653; + var instance = JSCompiler_object_inline_message_2600; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9735,46 +9774,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2653 + JSCompiler_object_inline_message_2600 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2653 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2600 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2653 && - ((JSCompiler_object_inline_message_2653 = - JSCompiler_object_inline_message_2653.dehydrated), - null !== JSCompiler_object_inline_message_2653) + null !== JSCompiler_object_inline_message_2600 && + ((JSCompiler_object_inline_message_2600 = + JSCompiler_object_inline_message_2600.dehydrated), + null !== JSCompiler_object_inline_message_2600) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2653) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2600) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2653 = - JSCompiler_object_inline_stack_2655.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2655.fallback; - if (JSCompiler_object_inline_componentStack_2656) + JSCompiler_object_inline_message_2600 = + JSCompiler_object_inline_stack_2602.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2602.fallback; + if (JSCompiler_object_inline_componentStack_2603) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2655 = + (JSCompiler_object_inline_stack_2602 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2653, + JSCompiler_object_inline_message_2600, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2656 = + (JSCompiler_object_inline_componentStack_2603 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2656.memoizedState = + (JSCompiler_object_inline_componentStack_2603.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2656.childLanes = + (JSCompiler_object_inline_componentStack_2603.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2654, + JSCompiler_object_inline_digest_2601, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9787,9 +9826,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2656.updateQueue), + JSCompiler_object_inline_componentStack_2603.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2656.updateQueue = + ? (JSCompiler_object_inline_componentStack_2603.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9797,46 +9836,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2655 + JSCompiler_object_inline_stack_2602 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2655.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2602.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2655 = + (JSCompiler_object_inline_stack_2602 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2653, + JSCompiler_object_inline_message_2600, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2656 = + (JSCompiler_object_inline_componentStack_2603 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2656.memoizedState = + (JSCompiler_object_inline_componentStack_2603.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2656.childLanes = + (JSCompiler_object_inline_componentStack_2603.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2654, + JSCompiler_object_inline_digest_2601, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2655 + JSCompiler_object_inline_stack_2602 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2653 + JSCompiler_object_inline_message_2600 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2653 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2653) + ((JSCompiler_object_inline_message_2600 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2600) ) { if (didSuspend) workInProgress.flags & 256 @@ -9853,94 +9892,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2656 = - JSCompiler_object_inline_stack_2655.fallback), - (JSCompiler_object_inline_message_2653 = workInProgress.mode), - (JSCompiler_object_inline_stack_2655 = + (JSCompiler_object_inline_componentStack_2603 = + JSCompiler_object_inline_stack_2602.fallback), + (JSCompiler_object_inline_message_2600 = workInProgress.mode), + (JSCompiler_object_inline_stack_2602 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2655.children + children: JSCompiler_object_inline_stack_2602.children }, - JSCompiler_object_inline_message_2653 + JSCompiler_object_inline_message_2600 )), - (JSCompiler_object_inline_componentStack_2656 = + (JSCompiler_object_inline_componentStack_2603 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2656, - JSCompiler_object_inline_message_2653, + JSCompiler_object_inline_componentStack_2603, + JSCompiler_object_inline_message_2600, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2656.flags |= 2), - (JSCompiler_object_inline_stack_2655.return = workInProgress), - (JSCompiler_object_inline_componentStack_2656.return = + (JSCompiler_object_inline_componentStack_2603.flags |= 2), + (JSCompiler_object_inline_stack_2602.return = workInProgress), + (JSCompiler_object_inline_componentStack_2603.return = workInProgress), - (JSCompiler_object_inline_stack_2655.sibling = - JSCompiler_object_inline_componentStack_2656), - (workInProgress.child = JSCompiler_object_inline_stack_2655), + (JSCompiler_object_inline_stack_2602.sibling = + JSCompiler_object_inline_componentStack_2603), + (workInProgress.child = JSCompiler_object_inline_stack_2602), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2655 = workInProgress.child), - (JSCompiler_object_inline_stack_2655.memoizedState = + (JSCompiler_object_inline_stack_2602 = workInProgress.child), + (JSCompiler_object_inline_stack_2602.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2655.childLanes = + (JSCompiler_object_inline_stack_2602.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2654, + JSCompiler_object_inline_digest_2601, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2656)); + JSCompiler_object_inline_componentStack_2603)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2653)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2600)) ) { - JSCompiler_object_inline_digest_2654 = - JSCompiler_object_inline_message_2653.nextSibling && - JSCompiler_object_inline_message_2653.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2654) { - JSCompiler_temp = JSCompiler_object_inline_digest_2654.dgst; - var message = JSCompiler_object_inline_digest_2654.msg; - instance = JSCompiler_object_inline_digest_2654.stck; - var componentStack = JSCompiler_object_inline_digest_2654.cstck; + JSCompiler_object_inline_digest_2601 = + JSCompiler_object_inline_message_2600.nextSibling && + JSCompiler_object_inline_message_2600.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2601) { + JSCompiler_temp = JSCompiler_object_inline_digest_2601.dgst; + var message = JSCompiler_object_inline_digest_2601.msg; + instance = JSCompiler_object_inline_digest_2601.stck; + var componentStack = JSCompiler_object_inline_digest_2601.cstck; } - JSCompiler_object_inline_message_2653 = message; - JSCompiler_object_inline_digest_2654 = JSCompiler_temp; - JSCompiler_object_inline_stack_2655 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2656 = + JSCompiler_object_inline_message_2600 = message; + JSCompiler_object_inline_digest_2601 = JSCompiler_temp; + JSCompiler_object_inline_stack_2602 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2603 = componentStack; - JSCompiler_object_inline_componentStack_2656 = - JSCompiler_object_inline_message_2653 - ? Error(JSCompiler_object_inline_message_2653) + JSCompiler_object_inline_componentStack_2603 = + JSCompiler_object_inline_message_2600 + ? Error(JSCompiler_object_inline_message_2600) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2656.stack = - JSCompiler_object_inline_stack_2655 || ""; - JSCompiler_object_inline_componentStack_2656.digest = - JSCompiler_object_inline_digest_2654; - JSCompiler_object_inline_digest_2654 = + JSCompiler_object_inline_componentStack_2603.stack = + JSCompiler_object_inline_stack_2602 || ""; + JSCompiler_object_inline_componentStack_2603.digest = + JSCompiler_object_inline_digest_2601; + JSCompiler_object_inline_digest_2601 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2655 = { - value: JSCompiler_object_inline_componentStack_2656, + JSCompiler_object_inline_stack_2602 = { + value: JSCompiler_object_inline_componentStack_2603, source: null, - stack: JSCompiler_object_inline_digest_2654 + stack: JSCompiler_object_inline_digest_2601 }; - "string" === typeof JSCompiler_object_inline_digest_2654 && + "string" === typeof JSCompiler_object_inline_digest_2601 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2656, - JSCompiler_object_inline_stack_2655 + JSCompiler_object_inline_componentStack_2603, + JSCompiler_object_inline_stack_2602 ); - queueHydrationError(JSCompiler_object_inline_stack_2655); + queueHydrationError(JSCompiler_object_inline_stack_2602); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9954,44 +9993,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2654 = + (JSCompiler_object_inline_digest_2601 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2654) + didReceiveUpdate || JSCompiler_object_inline_digest_2601) ) { - JSCompiler_object_inline_digest_2654 = workInProgressRoot; + JSCompiler_object_inline_digest_2601 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2654 && - ((JSCompiler_object_inline_stack_2655 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2655 = - 0 !== (JSCompiler_object_inline_stack_2655 & 42) + null !== JSCompiler_object_inline_digest_2601 && + ((JSCompiler_object_inline_stack_2602 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2602 = + 0 !== (JSCompiler_object_inline_stack_2602 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2655 + JSCompiler_object_inline_stack_2602 )), - (JSCompiler_object_inline_stack_2655 = + (JSCompiler_object_inline_stack_2602 = 0 !== - (JSCompiler_object_inline_stack_2655 & - (JSCompiler_object_inline_digest_2654.suspendedLanes | + (JSCompiler_object_inline_stack_2602 & + (JSCompiler_object_inline_digest_2601.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2655), - 0 !== JSCompiler_object_inline_stack_2655 && - JSCompiler_object_inline_stack_2655 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2602), + 0 !== JSCompiler_object_inline_stack_2602 && + JSCompiler_object_inline_stack_2602 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2655), + ((prevState.retryLane = JSCompiler_object_inline_stack_2602), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2655 + JSCompiler_object_inline_stack_2602 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2654, + JSCompiler_object_inline_digest_2601, current, - JSCompiler_object_inline_stack_2655 + JSCompiler_object_inline_stack_2602 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2653.data === + JSCompiler_object_inline_message_2600.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9999,14 +10038,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2653.data === + JSCompiler_object_inline_message_2600.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2653.nextSibling + JSCompiler_object_inline_message_2600.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -10024,57 +10063,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2655.children + JSCompiler_object_inline_stack_2602.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2656) + if (JSCompiler_object_inline_componentStack_2603) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2656 = - JSCompiler_object_inline_stack_2655.fallback), - (JSCompiler_object_inline_message_2653 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2603 = + JSCompiler_object_inline_stack_2602.fallback), + (JSCompiler_object_inline_message_2600 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2655 = createWorkInProgress( + (JSCompiler_object_inline_stack_2602 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2655.children + children: JSCompiler_object_inline_stack_2602.children } )), - (JSCompiler_object_inline_stack_2655.subtreeFlags = + (JSCompiler_object_inline_stack_2602.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_componentStack_2656 = + ? (JSCompiler_object_inline_componentStack_2603 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2656 + JSCompiler_object_inline_componentStack_2603 )) - : ((JSCompiler_object_inline_componentStack_2656 = + : ((JSCompiler_object_inline_componentStack_2603 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2656, - JSCompiler_object_inline_message_2653, + JSCompiler_object_inline_componentStack_2603, + JSCompiler_object_inline_message_2600, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2656.flags |= 2)), - (JSCompiler_object_inline_componentStack_2656.return = + (JSCompiler_object_inline_componentStack_2603.flags |= 2)), + (JSCompiler_object_inline_componentStack_2603.return = workInProgress), - (JSCompiler_object_inline_stack_2655.return = workInProgress), - (JSCompiler_object_inline_stack_2655.sibling = - JSCompiler_object_inline_componentStack_2656), - (workInProgress.child = JSCompiler_object_inline_stack_2655), - (JSCompiler_object_inline_stack_2655 = - JSCompiler_object_inline_componentStack_2656), - (JSCompiler_object_inline_componentStack_2656 = workInProgress.child), - (JSCompiler_object_inline_message_2653 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2653 - ? (JSCompiler_object_inline_message_2653 = + (JSCompiler_object_inline_stack_2602.return = workInProgress), + (JSCompiler_object_inline_stack_2602.sibling = + JSCompiler_object_inline_componentStack_2603), + (workInProgress.child = JSCompiler_object_inline_stack_2602), + (JSCompiler_object_inline_stack_2602 = + JSCompiler_object_inline_componentStack_2603), + (JSCompiler_object_inline_componentStack_2603 = workInProgress.child), + (JSCompiler_object_inline_message_2600 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2600 + ? (JSCompiler_object_inline_message_2600 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2653.cachePool), + JSCompiler_object_inline_message_2600.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -10082,34 +10121,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2653 = { + (JSCompiler_object_inline_message_2600 = { baseLanes: - JSCompiler_object_inline_message_2653.baseLanes | renderLanes, + JSCompiler_object_inline_message_2600.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2656.memoizedState = - JSCompiler_object_inline_message_2653), + (JSCompiler_object_inline_componentStack_2603.memoizedState = + JSCompiler_object_inline_message_2600), enableTransitionTracing && - ((JSCompiler_object_inline_message_2653 = enableTransitionTracing + ((JSCompiler_object_inline_message_2600 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2653 && + null !== JSCompiler_object_inline_message_2600 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2656.updateQueue), + JSCompiler_object_inline_componentStack_2603.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2656.updateQueue = { - transitions: JSCompiler_object_inline_message_2653, + ? (JSCompiler_object_inline_componentStack_2603.updateQueue = { + transitions: JSCompiler_object_inline_message_2600, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2656.updateQueue = + ? (JSCompiler_object_inline_componentStack_2603.updateQueue = { - transitions: JSCompiler_object_inline_message_2653, + transitions: JSCompiler_object_inline_message_2600, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -10117,32 +10156,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2653), + JSCompiler_object_inline_message_2600), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2656.childLanes = + (JSCompiler_object_inline_componentStack_2603.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2654, + JSCompiler_object_inline_digest_2601, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2655 + JSCompiler_object_inline_stack_2602 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2655.children + children: JSCompiler_object_inline_stack_2602.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2654 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2654 + ((JSCompiler_object_inline_digest_2601 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2601 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2654.push(current)); + : JSCompiler_object_inline_digest_2601.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -12454,7 +12493,7 @@ __DEV__ && )), null == updateQueue.inst.resource && error$jscomp$0( - "useResourceEffect must provide a callback which returns a resource. If a managed resource is not needed here, use useEffect. Received %s", + "useEffect must provide a callback which returns a resource. If a managed resource is not needed here, do not provide an updater or destroy callback. Received %s", updateQueue.inst.resource ), (lastEffect = updateQueue.inst.destroy)), @@ -12504,10 +12543,7 @@ __DEV__ && ? "useLayoutEffect" : 0 !== (updateQueue.tag & Insertion) ? "useInsertionEffect" - : enableUseEffectCRUDOverload && - null != updateQueue.resourceKind - ? "useResourceEffect" - : "useEffect"; + : "useEffect"; var addendum = void 0; addendum = null === lastEffect @@ -12542,7 +12578,7 @@ __DEV__ && function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -12554,10 +12590,10 @@ __DEV__ && if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) { - enableUseEffectCRUDOverload + void 0 !== destroy && + (enableUseEffectCRUDOverload ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0); + : (inst.destroy = void 0), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -12574,51 +12610,38 @@ __DEV__ && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( finishedWork - )); + )), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0); - if (enableUseEffectCRUDOverload) { - if ( - updateQueue.resourceKind === ResourceEffectIdentityKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = - nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - runWithFiberInDEV( - lastEffect, - callDestroyInDEV, - lastEffect, + (isRunningInsertionEffect = !0), + enableUseEffectCRUDOverload + ? (updateQueue.resourceKind === ResourceEffectIdentityKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy, + updateQueue.inst.resource + ), + updateQueue.next.resourceKind === ResourceEffectUpdateKind + ? (updateQueue.next.update = void 0) + : error$jscomp$0( + "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", + updateQueue.next.resourceKind + ), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - destroy_ - ); - updateQueue.next.resourceKind === ResourceEffectUpdateKind - ? (updateQueue.next.update = void 0) - : error$jscomp$0( - "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", - updateQueue.next.resourceKind - ); - updateQueue.inst.resource = null; - } - null == updateQueue.resourceKind && - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, destroy - ); - } else - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, - destroy - ); + ), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1); + (isRunningInsertionEffect = !1), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -12631,8 +12654,7 @@ __DEV__ && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); - } + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -12858,6 +12880,21 @@ __DEV__ && } else ref.current = null; } + function safelyCallDestroy( + current, + nearestMountedAncestor, + destroy, + resource + ) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + runWithFiberInDEV( + current, + callDestroyInDEV, + current, + nearestMountedAncestor, + destroy + ); + } function commitProfiler( finishedWork, current, @@ -26507,8 +26544,6 @@ __DEV__ && useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -26532,140 +26567,16 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountEffect(create, deps); - }, - useImperativeHandle: function (ref, create, deps) { - currentHookNameInDev = "useImperativeHandle"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountImperativeHandle(ref, create, deps); - }, - useInsertionEffect: function (create, deps) { - currentHookNameInDev = "useInsertionEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - mountEffectImpl(4, Insertion, create, deps); - }, - useLayoutEffect: function (create, deps) { - currentHookNameInDev = "useLayoutEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountLayoutEffect(create, deps); - }, - useMemo: function (create, deps) { - currentHookNameInDev = "useMemo"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountMemo(create, deps); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useReducer: function (reducer, initialArg, init) { - currentHookNameInDev = "useReducer"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountReducer(reducer, initialArg, init); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useRef: function (initialValue) { - currentHookNameInDev = "useRef"; - mountHookTypesDev(); - return mountRef(initialValue); - }, - useState: function (initialState) { - currentHookNameInDev = "useState"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountState(initialState); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useDebugValue: function () { - currentHookNameInDev = "useDebugValue"; - mountHookTypesDev(); - }, - useDeferredValue: function (value, initialValue) { - currentHookNameInDev = "useDeferredValue"; - mountHookTypesDev(); - return mountDeferredValue(value, initialValue); - }, - useTransition: function () { - currentHookNameInDev = "useTransition"; - mountHookTypesDev(); - return mountTransition(); - }, - useSyncExternalStore: function ( - subscribe, - getSnapshot, - getServerSnapshot - ) { - currentHookNameInDev = "useSyncExternalStore"; - mountHookTypesDev(); - return mountSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ); - }, - useId: function () { - currentHookNameInDev = "useId"; - mountHookTypesDev(); - return mountId(); - }, - useFormState: function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }, - useActionState: function (action, initialState) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }, - useOptimistic: function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }, - useHostTransitionStatus: useHostTransitionStatus, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; - mountHookTypesDev(); - return mountRefresh(); - }, - useEffectEvent: function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - } - }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - mountHookTypesDev(); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return ( + checkDepsAreArrayDev(createDeps), mountEffect(create, createDeps) + ); void 0 !== updateDeps && null !== updateDeps && isArrayImpl(updateDeps) && @@ -26681,7 +26592,125 @@ __DEV__ && updateDeps, destroy ); - }); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function (create, deps) { + currentHookNameInDev = "useInsertionEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + mountEffectImpl(4, Insertion, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = "useLayoutEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = "useMemo"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = "useRef"; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = "useState"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useDebugValue: function () { + currentHookNameInDev = "useDebugValue"; + mountHookTypesDev(); + }, + useDeferredValue: function (value, initialValue) { + currentHookNameInDev = "useDeferredValue"; + mountHookTypesDev(); + return mountDeferredValue(value, initialValue); + }, + useTransition: function () { + currentHookNameInDev = "useTransition"; + mountHookTypesDev(); + return mountTransition(); + }, + useSyncExternalStore: function ( + subscribe, + getSnapshot, + getServerSnapshot + ) { + currentHookNameInDev = "useSyncExternalStore"; + mountHookTypesDev(); + return mountSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ); + }, + useId: function () { + currentHookNameInDev = "useId"; + mountHookTypesDev(); + return mountId(); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); + } + }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -26697,10 +26726,19 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26816,24 +26854,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -26849,10 +26869,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26968,26 +27001,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -27003,10 +27016,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -27122,26 +27148,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -27163,11 +27169,20 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); mountHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -27301,25 +27316,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -27341,11 +27337,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -27479,27 +27488,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -27521,11 +27509,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -27659,22 +27660,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnRerenderInDEV.useResourceEffect = - function (create, createDeps, update, updateDeps, destroy) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -28983,11 +28968,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-classic-0461c0d8-20250211" !== isomorphicReactPackageVersion) + if ("19.1.0-www-classic-a69b80d0-20250211" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-www-classic-0461c0d8-20250211\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-classic-a69b80d0-20250211\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -29030,10 +29015,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-0461c0d8-20250211", + version: "19.1.0-www-classic-a69b80d0-20250211", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-classic-a69b80d0-20250211" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -29797,5 +29782,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-classic-0461c0d8-20250211"; + exports.version = "19.1.0-www-classic-a69b80d0-20250211"; })(); diff --git a/compiled/facebook-www/ReactDOMTesting-dev.modern.js b/compiled/facebook-www/ReactDOMTesting-dev.modern.js index 59b7e4d3d5..5043fb0df6 100644 --- a/compiled/facebook-www/ReactDOMTesting-dev.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-dev.modern.js @@ -5594,8 +5594,9 @@ __DEV__ && ) (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); if ( hook.getSnapshot !== getSnapshot || cachedSnapshot || @@ -5999,11 +6000,11 @@ __DEV__ && currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { + function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -6060,15 +6061,15 @@ __DEV__ && initialValue = { current: initialValue }; return (hook.memoizedState = initialValue); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -6087,11 +6088,47 @@ __DEV__ && deps ))); } - function mountEffect(create, deps) { + function mountEffect(create, createDeps, update, updateDeps, destroy) { (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode - ? mountEffectImpl(276826112, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + ? !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(276826112, Passive, create, createDeps) + : mountResourceEffectImpl( + 276826112, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ) + : !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(8390656, Passive, create, createDeps) + : mountResourceEffectImpl( + 8390656, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); + } + function updateEffect(create, createDeps, update, updateDeps, destroy) { + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? updateEffectImpl(2048, Passive, create, createDeps) + : updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); } function mountResourceEffect( create, @@ -6100,39 +6137,41 @@ __DEV__ && updateDeps, destroy ) { - if ( - (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode - ) { - var hookFlags = Passive, - hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 276826112; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, + ((currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === + NoMode) || + mountResourceEffectImpl( + 8390656, + Passive, create, createDeps, update, - updateDeps + updateDeps, + destroy ); - } else - (hookFlags = Passive), - (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber.flags |= 8390656), - (inst = createEffectInstance()), - (inst.destroy = destroy), - (hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps - )); + } + function mountResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy + ) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= fiberFlags; + fiberFlags = createEffectInstance(); + fiberFlags.destroy = destroy; + hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + fiberFlags, + create, + createDeps, + update, + updateDeps + ); } function updateResourceEffectImpl( fiberFlags, @@ -9480,32 +9519,32 @@ __DEV__ && return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2649; - var JSCompiler_object_inline_stack_2650 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2596; + var JSCompiler_object_inline_stack_2597 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2651 = !1; + var JSCompiler_object_inline_componentStack_2598 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2649 = didSuspend) || - (JSCompiler_object_inline_digest_2649 = + (JSCompiler_object_inline_digest_2596 = didSuspend) || + (JSCompiler_object_inline_digest_2596 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2649 && - ((JSCompiler_object_inline_componentStack_2651 = !0), + JSCompiler_object_inline_digest_2596 && + ((JSCompiler_object_inline_componentStack_2598 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2649 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2596 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2651 + JSCompiler_object_inline_componentStack_2598 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2648 = nextHydratableInstance; + var JSCompiler_object_inline_message_2595 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2648)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2595)) { c: { - var instance = JSCompiler_object_inline_message_2648; + var instance = JSCompiler_object_inline_message_2595; for ( JSCompiler_temp = rootOrSingletonContext; instance.nodeType !== COMMENT_NODE; @@ -9547,46 +9586,46 @@ __DEV__ && JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2648 + JSCompiler_object_inline_message_2595 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2648 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2595 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2648 && - ((JSCompiler_object_inline_message_2648 = - JSCompiler_object_inline_message_2648.dehydrated), - null !== JSCompiler_object_inline_message_2648) + null !== JSCompiler_object_inline_message_2595 && + ((JSCompiler_object_inline_message_2595 = + JSCompiler_object_inline_message_2595.dehydrated), + null !== JSCompiler_object_inline_message_2595) ) return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2648) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2595) ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2648 = - JSCompiler_object_inline_stack_2650.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2650.fallback; - if (JSCompiler_object_inline_componentStack_2651) + JSCompiler_object_inline_message_2595 = + JSCompiler_object_inline_stack_2597.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2597.fallback; + if (JSCompiler_object_inline_componentStack_2598) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2650 = + (JSCompiler_object_inline_stack_2597 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2648, + JSCompiler_object_inline_message_2595, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2651 = + (JSCompiler_object_inline_componentStack_2598 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2651.memoizedState = + (JSCompiler_object_inline_componentStack_2598.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2651.childLanes = + (JSCompiler_object_inline_componentStack_2598.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2649, + JSCompiler_object_inline_digest_2596, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), @@ -9599,9 +9638,9 @@ __DEV__ && ? markerInstanceStack.current : null), (renderLanes = - JSCompiler_object_inline_componentStack_2651.updateQueue), + JSCompiler_object_inline_componentStack_2598.updateQueue), null === renderLanes - ? (JSCompiler_object_inline_componentStack_2651.updateQueue = + ? (JSCompiler_object_inline_componentStack_2598.updateQueue = { transitions: workInProgress, markerInstances: current, @@ -9609,46 +9648,46 @@ __DEV__ && }) : ((renderLanes.transitions = workInProgress), (renderLanes.markerInstances = current)))), - JSCompiler_object_inline_stack_2650 + JSCompiler_object_inline_stack_2597 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2650.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2597.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2650 = + (JSCompiler_object_inline_stack_2597 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_message_2648, + JSCompiler_object_inline_message_2595, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_componentStack_2651 = + (JSCompiler_object_inline_componentStack_2598 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2651.memoizedState = + (JSCompiler_object_inline_componentStack_2598.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2651.childLanes = + (JSCompiler_object_inline_componentStack_2598.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2649, + JSCompiler_object_inline_digest_2596, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2650 + JSCompiler_object_inline_stack_2597 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2648 + JSCompiler_object_inline_message_2595 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2648 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2648) + ((JSCompiler_object_inline_message_2595 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2595) ) { if (didSuspend) workInProgress.flags & 256 @@ -9665,94 +9704,94 @@ __DEV__ && (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2651 = - JSCompiler_object_inline_stack_2650.fallback), - (JSCompiler_object_inline_message_2648 = workInProgress.mode), - (JSCompiler_object_inline_stack_2650 = + (JSCompiler_object_inline_componentStack_2598 = + JSCompiler_object_inline_stack_2597.fallback), + (JSCompiler_object_inline_message_2595 = workInProgress.mode), + (JSCompiler_object_inline_stack_2597 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2650.children + children: JSCompiler_object_inline_stack_2597.children }, - JSCompiler_object_inline_message_2648 + JSCompiler_object_inline_message_2595 )), - (JSCompiler_object_inline_componentStack_2651 = + (JSCompiler_object_inline_componentStack_2598 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2651, - JSCompiler_object_inline_message_2648, + JSCompiler_object_inline_componentStack_2598, + JSCompiler_object_inline_message_2595, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2651.flags |= 2), - (JSCompiler_object_inline_stack_2650.return = workInProgress), - (JSCompiler_object_inline_componentStack_2651.return = + (JSCompiler_object_inline_componentStack_2598.flags |= 2), + (JSCompiler_object_inline_stack_2597.return = workInProgress), + (JSCompiler_object_inline_componentStack_2598.return = workInProgress), - (JSCompiler_object_inline_stack_2650.sibling = - JSCompiler_object_inline_componentStack_2651), - (workInProgress.child = JSCompiler_object_inline_stack_2650), + (JSCompiler_object_inline_stack_2597.sibling = + JSCompiler_object_inline_componentStack_2598), + (workInProgress.child = JSCompiler_object_inline_stack_2597), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2650 = workInProgress.child), - (JSCompiler_object_inline_stack_2650.memoizedState = + (JSCompiler_object_inline_stack_2597 = workInProgress.child), + (JSCompiler_object_inline_stack_2597.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2650.childLanes = + (JSCompiler_object_inline_stack_2597.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2649, + JSCompiler_object_inline_digest_2596, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2651)); + JSCompiler_object_inline_componentStack_2598)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && error$jscomp$0( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - isSuspenseInstanceFallback(JSCompiler_object_inline_message_2648)) + isSuspenseInstanceFallback(JSCompiler_object_inline_message_2595)) ) { - JSCompiler_object_inline_digest_2649 = - JSCompiler_object_inline_message_2648.nextSibling && - JSCompiler_object_inline_message_2648.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2649) { - JSCompiler_temp = JSCompiler_object_inline_digest_2649.dgst; - var message = JSCompiler_object_inline_digest_2649.msg; - instance = JSCompiler_object_inline_digest_2649.stck; - var componentStack = JSCompiler_object_inline_digest_2649.cstck; + JSCompiler_object_inline_digest_2596 = + JSCompiler_object_inline_message_2595.nextSibling && + JSCompiler_object_inline_message_2595.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2596) { + JSCompiler_temp = JSCompiler_object_inline_digest_2596.dgst; + var message = JSCompiler_object_inline_digest_2596.msg; + instance = JSCompiler_object_inline_digest_2596.stck; + var componentStack = JSCompiler_object_inline_digest_2596.cstck; } - JSCompiler_object_inline_message_2648 = message; - JSCompiler_object_inline_digest_2649 = JSCompiler_temp; - JSCompiler_object_inline_stack_2650 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2651 = + JSCompiler_object_inline_message_2595 = message; + JSCompiler_object_inline_digest_2596 = JSCompiler_temp; + JSCompiler_object_inline_stack_2597 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2598 = componentStack; - JSCompiler_object_inline_componentStack_2651 = - JSCompiler_object_inline_message_2648 - ? Error(JSCompiler_object_inline_message_2648) + JSCompiler_object_inline_componentStack_2598 = + JSCompiler_object_inline_message_2595 + ? Error(JSCompiler_object_inline_message_2595) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_componentStack_2651.stack = - JSCompiler_object_inline_stack_2650 || ""; - JSCompiler_object_inline_componentStack_2651.digest = - JSCompiler_object_inline_digest_2649; - JSCompiler_object_inline_digest_2649 = + JSCompiler_object_inline_componentStack_2598.stack = + JSCompiler_object_inline_stack_2597 || ""; + JSCompiler_object_inline_componentStack_2598.digest = + JSCompiler_object_inline_digest_2596; + JSCompiler_object_inline_digest_2596 = void 0 === JSCompiler_temp ? null : JSCompiler_temp; - JSCompiler_object_inline_stack_2650 = { - value: JSCompiler_object_inline_componentStack_2651, + JSCompiler_object_inline_stack_2597 = { + value: JSCompiler_object_inline_componentStack_2598, source: null, - stack: JSCompiler_object_inline_digest_2649 + stack: JSCompiler_object_inline_digest_2596 }; - "string" === typeof JSCompiler_object_inline_digest_2649 && + "string" === typeof JSCompiler_object_inline_digest_2596 && CapturedStacks.set( - JSCompiler_object_inline_componentStack_2651, - JSCompiler_object_inline_stack_2650 + JSCompiler_object_inline_componentStack_2598, + JSCompiler_object_inline_stack_2597 ); - queueHydrationError(JSCompiler_object_inline_stack_2650); + queueHydrationError(JSCompiler_object_inline_stack_2597); workInProgress = retrySuspenseComponentWithoutHydrating( current, workInProgress, @@ -9766,44 +9805,44 @@ __DEV__ && renderLanes, !1 ), - (JSCompiler_object_inline_digest_2649 = + (JSCompiler_object_inline_digest_2596 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2649) + didReceiveUpdate || JSCompiler_object_inline_digest_2596) ) { - JSCompiler_object_inline_digest_2649 = workInProgressRoot; + JSCompiler_object_inline_digest_2596 = workInProgressRoot; if ( - null !== JSCompiler_object_inline_digest_2649 && - ((JSCompiler_object_inline_stack_2650 = renderLanes & -renderLanes), - (JSCompiler_object_inline_stack_2650 = - 0 !== (JSCompiler_object_inline_stack_2650 & 42) + null !== JSCompiler_object_inline_digest_2596 && + ((JSCompiler_object_inline_stack_2597 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2597 = + 0 !== (JSCompiler_object_inline_stack_2597 & 42) ? 1 : getBumpedLaneForHydrationByLane( - JSCompiler_object_inline_stack_2650 + JSCompiler_object_inline_stack_2597 )), - (JSCompiler_object_inline_stack_2650 = + (JSCompiler_object_inline_stack_2597 = 0 !== - (JSCompiler_object_inline_stack_2650 & - (JSCompiler_object_inline_digest_2649.suspendedLanes | + (JSCompiler_object_inline_stack_2597 & + (JSCompiler_object_inline_digest_2596.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2650), - 0 !== JSCompiler_object_inline_stack_2650 && - JSCompiler_object_inline_stack_2650 !== prevState.retryLane) + : JSCompiler_object_inline_stack_2597), + 0 !== JSCompiler_object_inline_stack_2597 && + JSCompiler_object_inline_stack_2597 !== prevState.retryLane) ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2650), + ((prevState.retryLane = JSCompiler_object_inline_stack_2597), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2650 + JSCompiler_object_inline_stack_2597 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2649, + JSCompiler_object_inline_digest_2596, current, - JSCompiler_object_inline_stack_2650 + JSCompiler_object_inline_stack_2597 ), SelectiveHydrationException) ); - JSCompiler_object_inline_message_2648.data === + JSCompiler_object_inline_message_2595.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9811,14 +9850,14 @@ __DEV__ && renderLanes ); } else - JSCompiler_object_inline_message_2648.data === + JSCompiler_object_inline_message_2595.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 192), (workInProgress.child = current.child), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2648.nextSibling + JSCompiler_object_inline_message_2595.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9836,57 +9875,57 @@ __DEV__ && (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2650.children + JSCompiler_object_inline_stack_2597.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2651) + if (JSCompiler_object_inline_componentStack_2598) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2651 = - JSCompiler_object_inline_stack_2650.fallback), - (JSCompiler_object_inline_message_2648 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2598 = + JSCompiler_object_inline_stack_2597.fallback), + (JSCompiler_object_inline_message_2595 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2650 = createWorkInProgress( + (JSCompiler_object_inline_stack_2597 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2650.children + children: JSCompiler_object_inline_stack_2597.children } )), - (JSCompiler_object_inline_stack_2650.subtreeFlags = + (JSCompiler_object_inline_stack_2597.subtreeFlags = JSCompiler_temp.subtreeFlags & 65011712), null !== instance - ? (JSCompiler_object_inline_componentStack_2651 = + ? (JSCompiler_object_inline_componentStack_2598 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2651 + JSCompiler_object_inline_componentStack_2598 )) - : ((JSCompiler_object_inline_componentStack_2651 = + : ((JSCompiler_object_inline_componentStack_2598 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2651, - JSCompiler_object_inline_message_2648, + JSCompiler_object_inline_componentStack_2598, + JSCompiler_object_inline_message_2595, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2651.flags |= 2)), - (JSCompiler_object_inline_componentStack_2651.return = + (JSCompiler_object_inline_componentStack_2598.flags |= 2)), + (JSCompiler_object_inline_componentStack_2598.return = workInProgress), - (JSCompiler_object_inline_stack_2650.return = workInProgress), - (JSCompiler_object_inline_stack_2650.sibling = - JSCompiler_object_inline_componentStack_2651), - (workInProgress.child = JSCompiler_object_inline_stack_2650), - (JSCompiler_object_inline_stack_2650 = - JSCompiler_object_inline_componentStack_2651), - (JSCompiler_object_inline_componentStack_2651 = workInProgress.child), - (JSCompiler_object_inline_message_2648 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2648 - ? (JSCompiler_object_inline_message_2648 = + (JSCompiler_object_inline_stack_2597.return = workInProgress), + (JSCompiler_object_inline_stack_2597.sibling = + JSCompiler_object_inline_componentStack_2598), + (workInProgress.child = JSCompiler_object_inline_stack_2597), + (JSCompiler_object_inline_stack_2597 = + JSCompiler_object_inline_componentStack_2598), + (JSCompiler_object_inline_componentStack_2598 = workInProgress.child), + (JSCompiler_object_inline_message_2595 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2595 + ? (JSCompiler_object_inline_message_2595 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2648.cachePool), + JSCompiler_object_inline_message_2595.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9894,34 +9933,34 @@ __DEV__ && ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2648 = { + (JSCompiler_object_inline_message_2595 = { baseLanes: - JSCompiler_object_inline_message_2648.baseLanes | renderLanes, + JSCompiler_object_inline_message_2595.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2651.memoizedState = - JSCompiler_object_inline_message_2648), + (JSCompiler_object_inline_componentStack_2598.memoizedState = + JSCompiler_object_inline_message_2595), enableTransitionTracing && - ((JSCompiler_object_inline_message_2648 = enableTransitionTracing + ((JSCompiler_object_inline_message_2595 = enableTransitionTracing ? transitionStack.current : null), - null !== JSCompiler_object_inline_message_2648 && + null !== JSCompiler_object_inline_message_2595 && ((JSCompiler_temp = enableTransitionTracing ? markerInstanceStack.current : null), (instance = - JSCompiler_object_inline_componentStack_2651.updateQueue), + JSCompiler_object_inline_componentStack_2598.updateQueue), (componentStack = current.updateQueue), null === instance - ? (JSCompiler_object_inline_componentStack_2651.updateQueue = { - transitions: JSCompiler_object_inline_message_2648, + ? (JSCompiler_object_inline_componentStack_2598.updateQueue = { + transitions: JSCompiler_object_inline_message_2595, markerInstances: JSCompiler_temp, retryQueue: null }) : instance === componentStack - ? (JSCompiler_object_inline_componentStack_2651.updateQueue = + ? (JSCompiler_object_inline_componentStack_2598.updateQueue = { - transitions: JSCompiler_object_inline_message_2648, + transitions: JSCompiler_object_inline_message_2595, markerInstances: JSCompiler_temp, retryQueue: null !== componentStack @@ -9929,32 +9968,32 @@ __DEV__ && : null }) : ((instance.transitions = - JSCompiler_object_inline_message_2648), + JSCompiler_object_inline_message_2595), (instance.markerInstances = JSCompiler_temp)))), - (JSCompiler_object_inline_componentStack_2651.childLanes = + (JSCompiler_object_inline_componentStack_2598.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2649, + JSCompiler_object_inline_digest_2596, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2650 + JSCompiler_object_inline_stack_2597 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2650.children + children: JSCompiler_object_inline_stack_2597.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2649 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2649 + ((JSCompiler_object_inline_digest_2596 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2596 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2649.push(current)); + : JSCompiler_object_inline_digest_2596.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -12253,7 +12292,7 @@ __DEV__ && )), null == updateQueue.inst.resource && error$jscomp$0( - "useResourceEffect must provide a callback which returns a resource. If a managed resource is not needed here, use useEffect. Received %s", + "useEffect must provide a callback which returns a resource. If a managed resource is not needed here, do not provide an updater or destroy callback. Received %s", updateQueue.inst.resource ), (lastEffect = updateQueue.inst.destroy)), @@ -12303,10 +12342,7 @@ __DEV__ && ? "useLayoutEffect" : 0 !== (updateQueue.tag & Insertion) ? "useInsertionEffect" - : enableUseEffectCRUDOverload && - null != updateQueue.resourceKind - ? "useResourceEffect" - : "useEffect"; + : "useEffect"; var addendum = void 0; addendum = null === lastEffect @@ -12341,7 +12377,7 @@ __DEV__ && function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -12353,10 +12389,10 @@ __DEV__ && if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) { - enableUseEffectCRUDOverload + void 0 !== destroy && + (enableUseEffectCRUDOverload ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0); + : (inst.destroy = void 0), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -12373,51 +12409,38 @@ __DEV__ && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( finishedWork - )); + )), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0); - if (enableUseEffectCRUDOverload) { - if ( - updateQueue.resourceKind === ResourceEffectIdentityKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = - nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - runWithFiberInDEV( - lastEffect, - callDestroyInDEV, - lastEffect, + (isRunningInsertionEffect = !0), + enableUseEffectCRUDOverload + ? (updateQueue.resourceKind === ResourceEffectIdentityKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy, + updateQueue.inst.resource + ), + updateQueue.next.resourceKind === ResourceEffectUpdateKind + ? (updateQueue.next.update = void 0) + : error$jscomp$0( + "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", + updateQueue.next.resourceKind + ), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - destroy_ - ); - updateQueue.next.resourceKind === ResourceEffectUpdateKind - ? (updateQueue.next.update = void 0) - : error$jscomp$0( - "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", - updateQueue.next.resourceKind - ); - updateQueue.inst.resource = null; - } - null == updateQueue.resourceKind && - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, destroy - ); - } else - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, - destroy - ); + ), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1); + (isRunningInsertionEffect = !1), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -12430,8 +12453,7 @@ __DEV__ && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); - } + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -12657,6 +12679,21 @@ __DEV__ && } else ref.current = null; } + function safelyCallDestroy( + current, + nearestMountedAncestor, + destroy, + resource + ) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + runWithFiberInDEV( + current, + callDestroyInDEV, + current, + nearestMountedAncestor, + destroy + ); + } function commitProfiler( finishedWork, current, @@ -26295,8 +26332,6 @@ __DEV__ && useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -26320,140 +26355,16 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountEffect(create, deps); - }, - useImperativeHandle: function (ref, create, deps) { - currentHookNameInDev = "useImperativeHandle"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountImperativeHandle(ref, create, deps); - }, - useInsertionEffect: function (create, deps) { - currentHookNameInDev = "useInsertionEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - mountEffectImpl(4, Insertion, create, deps); - }, - useLayoutEffect: function (create, deps) { - currentHookNameInDev = "useLayoutEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountLayoutEffect(create, deps); - }, - useMemo: function (create, deps) { - currentHookNameInDev = "useMemo"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountMemo(create, deps); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useReducer: function (reducer, initialArg, init) { - currentHookNameInDev = "useReducer"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountReducer(reducer, initialArg, init); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useRef: function (initialValue) { - currentHookNameInDev = "useRef"; - mountHookTypesDev(); - return mountRef(initialValue); - }, - useState: function (initialState) { - currentHookNameInDev = "useState"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountState(initialState); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useDebugValue: function () { - currentHookNameInDev = "useDebugValue"; - mountHookTypesDev(); - }, - useDeferredValue: function (value, initialValue) { - currentHookNameInDev = "useDeferredValue"; - mountHookTypesDev(); - return mountDeferredValue(value, initialValue); - }, - useTransition: function () { - currentHookNameInDev = "useTransition"; - mountHookTypesDev(); - return mountTransition(); - }, - useSyncExternalStore: function ( - subscribe, - getSnapshot, - getServerSnapshot - ) { - currentHookNameInDev = "useSyncExternalStore"; - mountHookTypesDev(); - return mountSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ); - }, - useId: function () { - currentHookNameInDev = "useId"; - mountHookTypesDev(); - return mountId(); - }, - useFormState: function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }, - useActionState: function (action, initialState) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }, - useOptimistic: function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }, - useHostTransitionStatus: useHostTransitionStatus, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; - mountHookTypesDev(); - return mountRefresh(); - }, - useEffectEvent: function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - } - }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - mountHookTypesDev(); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return ( + checkDepsAreArrayDev(createDeps), mountEffect(create, createDeps) + ); void 0 !== updateDeps && null !== updateDeps && isArrayImpl(updateDeps) && @@ -26469,7 +26380,125 @@ __DEV__ && updateDeps, destroy ); - }); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function (create, deps) { + currentHookNameInDev = "useInsertionEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + mountEffectImpl(4, Insertion, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = "useLayoutEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = "useMemo"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = "useRef"; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = "useState"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useDebugValue: function () { + currentHookNameInDev = "useDebugValue"; + mountHookTypesDev(); + }, + useDeferredValue: function (value, initialValue) { + currentHookNameInDev = "useDeferredValue"; + mountHookTypesDev(); + return mountDeferredValue(value, initialValue); + }, + useTransition: function () { + currentHookNameInDev = "useTransition"; + mountHookTypesDev(); + return mountTransition(); + }, + useSyncExternalStore: function ( + subscribe, + getSnapshot, + getServerSnapshot + ) { + currentHookNameInDev = "useSyncExternalStore"; + mountHookTypesDev(); + return mountSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ); + }, + useId: function () { + currentHookNameInDev = "useId"; + mountHookTypesDev(); + return mountId(); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); + } + }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -26485,10 +26514,19 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26604,24 +26642,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -26637,10 +26657,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26756,26 +26789,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -26791,10 +26804,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -26910,26 +26936,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -26951,11 +26957,20 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); mountHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -27089,25 +27104,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -27129,11 +27125,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -27267,27 +27276,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -27309,11 +27297,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -27447,22 +27448,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnRerenderInDEV.useResourceEffect = - function (create, createDeps, update, updateDeps, destroy) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -28769,11 +28754,11 @@ __DEV__ && return_targetInst = null; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.1.0-www-modern-0461c0d8-20250211" !== isomorphicReactPackageVersion) + if ("19.1.0-www-modern-a69b80d0-20250211" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.1.0-www-modern-0461c0d8-20250211\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-www-modern-a69b80d0-20250211\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -28816,10 +28801,10 @@ __DEV__ && !(function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-0461c0d8-20250211", + version: "19.1.0-www-modern-a69b80d0-20250211", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-modern-a69b80d0-20250211" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -29583,5 +29568,5 @@ __DEV__ && exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.1.0-www-modern-0461c0d8-20250211"; + exports.version = "19.1.0-www-modern-a69b80d0-20250211"; })(); diff --git a/compiled/facebook-www/ReactDOMTesting-prod.classic.js b/compiled/facebook-www/ReactDOMTesting-prod.classic.js index ca450b8867..d175049cf2 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.classic.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.classic.js @@ -3749,11 +3749,11 @@ function rerenderActionState(action) { currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } -function pushSimpleEffect(tag, inst, create, deps) { +function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -3808,15 +3808,15 @@ function createEffectInstance() { function updateRef() { return updateWorkInProgressHook().memoizedState; } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { +function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -3835,60 +3835,68 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { deps ))); } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function mountEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + mountEffectImpl(8390656, 8, create, createDeps); + else { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); + } } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); -} -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); -} -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); +function updateEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + updateEffectImpl(2048, 8, create, createDeps); + else { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } function useEffectEventImpl(payload) { currentlyRenderingFiber.flags |= 4; @@ -4270,250 +4278,245 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = getTreeId(); + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = getTreeId(); - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; - } -}; -enableUseEffectCRUDOverload && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4567,8 +4570,6 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -8603,7 +8604,7 @@ function commitHookEffectListMount(flags, finishedWork) { function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -8615,59 +8616,33 @@ function commitHookEffectListUnmount( if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) - if ( - (enableUseEffectCRUDOverload - ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0), - enableUseEffectCRUDOverload) - ) { - if ( - 0 === updateQueue.resourceKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + void 0 !== destroy && + (enableUseEffectCRUDOverload + ? null == updateQueue.resourceKind && (inst.destroy = void 0) + : (inst.destroy = void 0), + enableUseEffectCRUDOverload + ? (0 === updateQueue.resourceKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - 1 === updateQueue.next.resourceKind && - (updateQueue.next.update = void 0); - updateQueue.inst.resource = null; - } - if (null == updateQueue.resourceKind) { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy, + updateQueue.inst.resource + ), + 1 === updateQueue.next.resourceKind && + (updateQueue.next.update = void 0), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } - } else { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } + destroy + )); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -8756,6 +8731,14 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else ref.current = null; } +function safelyCallDestroy(current, nearestMountedAncestor, destroy, resource) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } +} function commitProfilerPostCommit( finishedWork, current, @@ -14576,14 +14559,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$359; if (canUseDOM) { - var isSupported$jscomp$inline_1681 = "oninput" in document; - if (!isSupported$jscomp$inline_1681) { - var element$jscomp$inline_1682 = document.createElement("div"); - element$jscomp$inline_1682.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1681 = - "function" === typeof element$jscomp$inline_1682.oninput; + var isSupported$jscomp$inline_1664 = "oninput" in document; + if (!isSupported$jscomp$inline_1664) { + var element$jscomp$inline_1665 = document.createElement("div"); + element$jscomp$inline_1665.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1664 = + "function" === typeof element$jscomp$inline_1665.oninput; } - JSCompiler_inline_result$jscomp$359 = isSupported$jscomp$inline_1681; + JSCompiler_inline_result$jscomp$359 = isSupported$jscomp$inline_1664; } else JSCompiler_inline_result$jscomp$359 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$359 && @@ -14906,20 +14889,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1722 = 0; - i$jscomp$inline_1722 < simpleEventPluginEvents.length; - i$jscomp$inline_1722++ + var i$jscomp$inline_1705 = 0; + i$jscomp$inline_1705 < simpleEventPluginEvents.length; + i$jscomp$inline_1705++ ) { - var eventName$jscomp$inline_1723 = - simpleEventPluginEvents[i$jscomp$inline_1722], - domEventName$jscomp$inline_1724 = - eventName$jscomp$inline_1723.toLowerCase(), - capitalizedEvent$jscomp$inline_1725 = - eventName$jscomp$inline_1723[0].toUpperCase() + - eventName$jscomp$inline_1723.slice(1); + var eventName$jscomp$inline_1706 = + simpleEventPluginEvents[i$jscomp$inline_1705], + domEventName$jscomp$inline_1707 = + eventName$jscomp$inline_1706.toLowerCase(), + capitalizedEvent$jscomp$inline_1708 = + eventName$jscomp$inline_1706[0].toUpperCase() + + eventName$jscomp$inline_1706.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1724, - "on" + capitalizedEvent$jscomp$inline_1725 + domEventName$jscomp$inline_1707, + "on" + capitalizedEvent$jscomp$inline_1708 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -18767,16 +18750,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1900 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1883 = React.version; if ( - "19.1.0-www-classic-0461c0d8-20250211" !== - isomorphicReactPackageVersion$jscomp$inline_1900 + "19.1.0-www-classic-a69b80d0-20250211" !== + isomorphicReactPackageVersion$jscomp$inline_1883 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1900, - "19.1.0-www-classic-0461c0d8-20250211" + isomorphicReactPackageVersion$jscomp$inline_1883, + "19.1.0-www-classic-a69b80d0-20250211" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -18792,24 +18775,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2465 = { +var internals$jscomp$inline_2448 = { bundleType: 0, - version: "19.1.0-www-classic-0461c0d8-20250211", + version: "19.1.0-www-classic-a69b80d0-20250211", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-classic-a69b80d0-20250211" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2466 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2449 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2466.isDisabled && - hook$jscomp$inline_2466.supportsFiber + !hook$jscomp$inline_2449.isDisabled && + hook$jscomp$inline_2449.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2466.inject( - internals$jscomp$inline_2465 + (rendererID = hook$jscomp$inline_2449.inject( + internals$jscomp$inline_2448 )), - (injectedHook = hook$jscomp$inline_2466); + (injectedHook = hook$jscomp$inline_2449); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -19312,4 +19295,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-classic-0461c0d8-20250211"; +exports.version = "19.1.0-www-classic-a69b80d0-20250211"; diff --git a/compiled/facebook-www/ReactDOMTesting-prod.modern.js b/compiled/facebook-www/ReactDOMTesting-prod.modern.js index 9a4aae1161..195f47f80c 100644 --- a/compiled/facebook-www/ReactDOMTesting-prod.modern.js +++ b/compiled/facebook-www/ReactDOMTesting-prod.modern.js @@ -3595,11 +3595,11 @@ function rerenderActionState(action) { currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } -function pushSimpleEffect(tag, inst, create, deps) { +function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -3654,15 +3654,15 @@ function createEffectInstance() { function updateRef() { return updateWorkInProgressHook().memoizedState; } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { +function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -3681,60 +3681,68 @@ function updateEffectImpl(fiberFlags, hookFlags, create, deps) { deps ))); } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function mountEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + mountEffectImpl(8390656, 8, create, createDeps); + else { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); + } } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); -} -function mountResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); -} -function updateResourceEffect(create, createDeps, update, updateDeps, destroy) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); +function updateEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + updateEffectImpl(2048, 8, create, createDeps); + else { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } function useEffectEventImpl(payload) { currentlyRenderingFiber.flags |= 4; @@ -4116,250 +4124,245 @@ var ContextOnlyDispatcher = { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = getTreeId(); + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = getTreeId(); - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; - } -}; -enableUseEffectCRUDOverload && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh -}; + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -4413,8 +4416,6 @@ var HooksDispatcherOnRerender = { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; -enableUseEffectCRUDOverload && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); var thenableState = null, thenableIndexCounter = 0; function unwrapThenable(thenable) { @@ -8349,7 +8350,7 @@ function commitHookEffectListMount(flags, finishedWork) { function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -8361,59 +8362,33 @@ function commitHookEffectListUnmount( if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) - if ( - (enableUseEffectCRUDOverload - ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0), - enableUseEffectCRUDOverload) - ) { - if ( - 0 === updateQueue.resourceKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + void 0 !== destroy && + (enableUseEffectCRUDOverload + ? null == updateQueue.resourceKind && (inst.destroy = void 0) + : (inst.destroy = void 0), + enableUseEffectCRUDOverload + ? (0 === updateQueue.resourceKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - 1 === updateQueue.next.resourceKind && - (updateQueue.next.update = void 0); - updateQueue.inst.resource = null; - } - if (null == updateQueue.resourceKind) { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy, + updateQueue.inst.resource + ), + 1 === updateQueue.next.resourceKind && + (updateQueue.next.update = void 0), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } - } else { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } + destroy + )); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -8502,6 +8477,14 @@ function safelyDetachRef(current, nearestMountedAncestor) { } else ref.current = null; } +function safelyCallDestroy(current, nearestMountedAncestor, destroy, resource) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } +} function commitProfilerPostCommit( finishedWork, current, @@ -14312,14 +14295,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$362; if (canUseDOM) { - var isSupported$jscomp$inline_1671 = "oninput" in document; - if (!isSupported$jscomp$inline_1671) { - var element$jscomp$inline_1672 = document.createElement("div"); - element$jscomp$inline_1672.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_1671 = - "function" === typeof element$jscomp$inline_1672.oninput; + var isSupported$jscomp$inline_1654 = "oninput" in document; + if (!isSupported$jscomp$inline_1654) { + var element$jscomp$inline_1655 = document.createElement("div"); + element$jscomp$inline_1655.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_1654 = + "function" === typeof element$jscomp$inline_1655.oninput; } - JSCompiler_inline_result$jscomp$362 = isSupported$jscomp$inline_1671; + JSCompiler_inline_result$jscomp$362 = isSupported$jscomp$inline_1654; } else JSCompiler_inline_result$jscomp$362 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$362 && @@ -14642,20 +14625,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1712 = 0; - i$jscomp$inline_1712 < simpleEventPluginEvents.length; - i$jscomp$inline_1712++ + var i$jscomp$inline_1695 = 0; + i$jscomp$inline_1695 < simpleEventPluginEvents.length; + i$jscomp$inline_1695++ ) { - var eventName$jscomp$inline_1713 = - simpleEventPluginEvents[i$jscomp$inline_1712], - domEventName$jscomp$inline_1714 = - eventName$jscomp$inline_1713.toLowerCase(), - capitalizedEvent$jscomp$inline_1715 = - eventName$jscomp$inline_1713[0].toUpperCase() + - eventName$jscomp$inline_1713.slice(1); + var eventName$jscomp$inline_1696 = + simpleEventPluginEvents[i$jscomp$inline_1695], + domEventName$jscomp$inline_1697 = + eventName$jscomp$inline_1696.toLowerCase(), + capitalizedEvent$jscomp$inline_1698 = + eventName$jscomp$inline_1696[0].toUpperCase() + + eventName$jscomp$inline_1696.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1714, - "on" + capitalizedEvent$jscomp$inline_1715 + domEventName$jscomp$inline_1697, + "on" + capitalizedEvent$jscomp$inline_1698 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -18498,16 +18481,16 @@ function getCrossOriginStringAs(as, input) { if ("string" === typeof input) return "use-credentials" === input ? input : ""; } -var isomorphicReactPackageVersion$jscomp$inline_1890 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1873 = React.version; if ( - "19.1.0-www-modern-0461c0d8-20250211" !== - isomorphicReactPackageVersion$jscomp$inline_1890 + "19.1.0-www-modern-a69b80d0-20250211" !== + isomorphicReactPackageVersion$jscomp$inline_1873 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1890, - "19.1.0-www-modern-0461c0d8-20250211" + isomorphicReactPackageVersion$jscomp$inline_1873, + "19.1.0-www-modern-a69b80d0-20250211" ) ); Internals.findDOMNode = function (componentOrElement) { @@ -18523,24 +18506,24 @@ Internals.Events = [ return fn(a); } ]; -var internals$jscomp$inline_2447 = { +var internals$jscomp$inline_2430 = { bundleType: 0, - version: "19.1.0-www-modern-0461c0d8-20250211", + version: "19.1.0-www-modern-a69b80d0-20250211", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-modern-a69b80d0-20250211" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2448 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2431 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2448.isDisabled && - hook$jscomp$inline_2448.supportsFiber + !hook$jscomp$inline_2431.isDisabled && + hook$jscomp$inline_2431.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2448.inject( - internals$jscomp$inline_2447 + (rendererID = hook$jscomp$inline_2431.inject( + internals$jscomp$inline_2430 )), - (injectedHook = hook$jscomp$inline_2448); + (injectedHook = hook$jscomp$inline_2431); } catch (err) {} } function ReactDOMRoot(internalRoot) { @@ -19043,4 +19026,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.1.0-www-modern-0461c0d8-20250211"; +exports.version = "19.1.0-www-modern-a69b80d0-20250211"; diff --git a/compiled/facebook-www/ReactReconciler-dev.classic.js b/compiled/facebook-www/ReactReconciler-dev.classic.js index 804b746803..e4e75ab205 100644 --- a/compiled/facebook-www/ReactReconciler-dev.classic.js +++ b/compiled/facebook-www/ReactReconciler-dev.classic.js @@ -4038,8 +4038,9 @@ __DEV__ && ) (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); if ( hook.getSnapshot !== getSnapshot || cachedSnapshot || @@ -4420,11 +4421,11 @@ __DEV__ && currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { + function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -4481,15 +4482,15 @@ __DEV__ && initialValue = { current: initialValue }; return (hook.memoizedState = initialValue); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -4508,11 +4509,47 @@ __DEV__ && deps ))); } - function mountEffect(create, deps) { + function mountEffect(create, createDeps, update, updateDeps, destroy) { (currentlyRenderingFiber.mode & 16) !== NoMode && (currentlyRenderingFiber.mode & 64) === NoMode - ? mountEffectImpl(276826112, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + ? !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(276826112, Passive, create, createDeps) + : mountResourceEffectImpl( + 276826112, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ) + : !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(8390656, Passive, create, createDeps) + : mountResourceEffectImpl( + 8390656, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); + } + function updateEffect(create, createDeps, update, updateDeps, destroy) { + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? updateEffectImpl(2048, Passive, create, createDeps) + : updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); } function mountResourceEffect( create, @@ -4521,39 +4558,40 @@ __DEV__ && updateDeps, destroy ) { - if ( - (currentlyRenderingFiber.mode & 16) !== NoMode && - (currentlyRenderingFiber.mode & 64) === NoMode - ) { - var hookFlags = Passive, - hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 276826112; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, + ((currentlyRenderingFiber.mode & 16) !== NoMode && + (currentlyRenderingFiber.mode & 64) === NoMode) || + mountResourceEffectImpl( + 8390656, + Passive, create, createDeps, update, - updateDeps + updateDeps, + destroy ); - } else - (hookFlags = Passive), - (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber.flags |= 8390656), - (inst = createEffectInstance()), - (inst.destroy = destroy), - (hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps - )); + } + function mountResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy + ) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= fiberFlags; + fiberFlags = createEffectInstance(); + fiberFlags.destroy = destroy; + hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + fiberFlags, + create, + createDeps, + update, + updateDeps + ); } function updateResourceEffectImpl( fiberFlags, @@ -10723,7 +10761,7 @@ __DEV__ && )), null == updateQueue.inst.resource && error$jscomp$0( - "useResourceEffect must provide a callback which returns a resource. If a managed resource is not needed here, use useEffect. Received %s", + "useEffect must provide a callback which returns a resource. If a managed resource is not needed here, do not provide an updater or destroy callback. Received %s", updateQueue.inst.resource ), (lastEffect = updateQueue.inst.destroy)), @@ -10773,10 +10811,7 @@ __DEV__ && ? "useLayoutEffect" : 0 !== (updateQueue.tag & Insertion) ? "useInsertionEffect" - : enableUseEffectCRUDOverload && - null != updateQueue.resourceKind - ? "useResourceEffect" - : "useEffect"; + : "useEffect"; var addendum = void 0; addendum = null === lastEffect @@ -10811,7 +10846,7 @@ __DEV__ && function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -10823,10 +10858,10 @@ __DEV__ && if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) { - enableUseEffectCRUDOverload + void 0 !== destroy && + (enableUseEffectCRUDOverload ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0); + : (inst.destroy = void 0), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -10843,51 +10878,38 @@ __DEV__ && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( finishedWork - )); + )), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0); - if (enableUseEffectCRUDOverload) { - if ( - updateQueue.resourceKind === ResourceEffectIdentityKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = - nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - runWithFiberInDEV( - lastEffect, - callDestroyInDEV, - lastEffect, + (isRunningInsertionEffect = !0), + enableUseEffectCRUDOverload + ? (updateQueue.resourceKind === ResourceEffectIdentityKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy, + updateQueue.inst.resource + ), + updateQueue.next.resourceKind === ResourceEffectUpdateKind + ? (updateQueue.next.update = void 0) + : error$jscomp$0( + "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", + updateQueue.next.resourceKind + ), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - destroy_ - ); - updateQueue.next.resourceKind === ResourceEffectUpdateKind - ? (updateQueue.next.update = void 0) - : error$jscomp$0( - "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", - updateQueue.next.resourceKind - ); - updateQueue.inst.resource = null; - } - null == updateQueue.resourceKind && - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, destroy - ); - } else - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, - destroy - ); + ), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1); + (isRunningInsertionEffect = !1), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -10900,8 +10922,7 @@ __DEV__ && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); - } + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -11127,6 +11148,21 @@ __DEV__ && } else ref.current = null; } + function safelyCallDestroy( + current, + nearestMountedAncestor, + destroy, + resource + ) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + runWithFiberInDEV( + current, + callDestroyInDEV, + current, + nearestMountedAncestor, + destroy + ); + } function commitProfiler( finishedWork, current, @@ -17861,8 +17897,6 @@ __DEV__ && useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -17886,140 +17920,16 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountEffect(create, deps); - }, - useImperativeHandle: function (ref, create, deps) { - currentHookNameInDev = "useImperativeHandle"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountImperativeHandle(ref, create, deps); - }, - useInsertionEffect: function (create, deps) { - currentHookNameInDev = "useInsertionEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - mountEffectImpl(4, Insertion, create, deps); - }, - useLayoutEffect: function (create, deps) { - currentHookNameInDev = "useLayoutEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountLayoutEffect(create, deps); - }, - useMemo: function (create, deps) { - currentHookNameInDev = "useMemo"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountMemo(create, deps); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useReducer: function (reducer, initialArg, init) { - currentHookNameInDev = "useReducer"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountReducer(reducer, initialArg, init); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useRef: function (initialValue) { - currentHookNameInDev = "useRef"; - mountHookTypesDev(); - return mountRef(initialValue); - }, - useState: function (initialState) { - currentHookNameInDev = "useState"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountState(initialState); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useDebugValue: function () { - currentHookNameInDev = "useDebugValue"; - mountHookTypesDev(); - }, - useDeferredValue: function (value, initialValue) { - currentHookNameInDev = "useDeferredValue"; - mountHookTypesDev(); - return mountDeferredValue(value, initialValue); - }, - useTransition: function () { - currentHookNameInDev = "useTransition"; - mountHookTypesDev(); - return mountTransition(); - }, - useSyncExternalStore: function ( - subscribe, - getSnapshot, - getServerSnapshot - ) { - currentHookNameInDev = "useSyncExternalStore"; - mountHookTypesDev(); - return mountSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ); - }, - useId: function () { - currentHookNameInDev = "useId"; - mountHookTypesDev(); - return mountId(); - }, - useFormState: function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }, - useActionState: function (action, initialState) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }, - useOptimistic: function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }, - useHostTransitionStatus: useHostTransitionStatus, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; - mountHookTypesDev(); - return mountRefresh(); - }, - useEffectEvent: function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - } - }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - mountHookTypesDev(); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return ( + checkDepsAreArrayDev(createDeps), mountEffect(create, createDeps) + ); void 0 !== updateDeps && null !== updateDeps && isArrayImpl(updateDeps) && @@ -18035,7 +17945,125 @@ __DEV__ && updateDeps, destroy ); - }); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function (create, deps) { + currentHookNameInDev = "useInsertionEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + mountEffectImpl(4, Insertion, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = "useLayoutEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = "useMemo"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = "useRef"; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = "useState"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useDebugValue: function () { + currentHookNameInDev = "useDebugValue"; + mountHookTypesDev(); + }, + useDeferredValue: function (value, initialValue) { + currentHookNameInDev = "useDeferredValue"; + mountHookTypesDev(); + return mountDeferredValue(value, initialValue); + }, + useTransition: function () { + currentHookNameInDev = "useTransition"; + mountHookTypesDev(); + return mountTransition(); + }, + useSyncExternalStore: function ( + subscribe, + getSnapshot, + getServerSnapshot + ) { + currentHookNameInDev = "useSyncExternalStore"; + mountHookTypesDev(); + return mountSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ); + }, + useId: function () { + currentHookNameInDev = "useId"; + mountHookTypesDev(); + return mountId(); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); + } + }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -18051,10 +18079,19 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -18170,24 +18207,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -18203,10 +18222,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -18322,26 +18354,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -18357,10 +18369,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -18476,26 +18501,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -18517,11 +18522,20 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); mountHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -18655,25 +18669,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -18695,11 +18690,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -18833,27 +18841,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -18875,11 +18862,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -19013,22 +19013,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnRerenderInDEV.useResourceEffect = - function (create, createDeps, update, updateDeps, destroy) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -20043,7 +20027,7 @@ __DEV__ && version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-classic-a69b80d0-20250211" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-dev.modern.js b/compiled/facebook-www/ReactReconciler-dev.modern.js index fe6365be1e..313867581b 100644 --- a/compiled/facebook-www/ReactReconciler-dev.modern.js +++ b/compiled/facebook-www/ReactReconciler-dev.modern.js @@ -3944,8 +3944,9 @@ __DEV__ && ) (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); if ( hook.getSnapshot !== getSnapshot || cachedSnapshot || @@ -4326,11 +4327,11 @@ __DEV__ && currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { + function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -4387,15 +4388,15 @@ __DEV__ && initialValue = { current: initialValue }; return (hook.memoizedState = initialValue); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -4414,11 +4415,47 @@ __DEV__ && deps ))); } - function mountEffect(create, deps) { + function mountEffect(create, createDeps, update, updateDeps, destroy) { (currentlyRenderingFiber.mode & 16) !== NoMode && (currentlyRenderingFiber.mode & 64) === NoMode - ? mountEffectImpl(276826112, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + ? !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(276826112, Passive, create, createDeps) + : mountResourceEffectImpl( + 276826112, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ) + : !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffectImpl(8390656, Passive, create, createDeps) + : mountResourceEffectImpl( + 8390656, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); + } + function updateEffect(create, createDeps, update, updateDeps, destroy) { + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? updateEffectImpl(2048, Passive, create, createDeps) + : updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); } function mountResourceEffect( create, @@ -4427,39 +4464,40 @@ __DEV__ && updateDeps, destroy ) { - if ( - (currentlyRenderingFiber.mode & 16) !== NoMode && - (currentlyRenderingFiber.mode & 64) === NoMode - ) { - var hookFlags = Passive, - hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 276826112; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, + ((currentlyRenderingFiber.mode & 16) !== NoMode && + (currentlyRenderingFiber.mode & 64) === NoMode) || + mountResourceEffectImpl( + 8390656, + Passive, create, createDeps, update, - updateDeps + updateDeps, + destroy ); - } else - (hookFlags = Passive), - (hook = mountWorkInProgressHook()), - (currentlyRenderingFiber.flags |= 8390656), - (inst = createEffectInstance()), - (inst.destroy = destroy), - (hook.memoizedState = pushResourceEffect( - HasEffect | hookFlags, - hookFlags, - inst, - create, - createDeps, - update, - updateDeps - )); + } + function mountResourceEffectImpl( + fiberFlags, + hookFlags, + create, + createDeps, + update, + updateDeps, + destroy + ) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= fiberFlags; + fiberFlags = createEffectInstance(); + fiberFlags.destroy = destroy; + hook.memoizedState = pushResourceEffect( + HasEffect | hookFlags, + hookFlags, + fiberFlags, + create, + createDeps, + update, + updateDeps + ); } function updateResourceEffectImpl( fiberFlags, @@ -10541,7 +10579,7 @@ __DEV__ && )), null == updateQueue.inst.resource && error$jscomp$0( - "useResourceEffect must provide a callback which returns a resource. If a managed resource is not needed here, use useEffect. Received %s", + "useEffect must provide a callback which returns a resource. If a managed resource is not needed here, do not provide an updater or destroy callback. Received %s", updateQueue.inst.resource ), (lastEffect = updateQueue.inst.destroy)), @@ -10591,10 +10629,7 @@ __DEV__ && ? "useLayoutEffect" : 0 !== (updateQueue.tag & Insertion) ? "useInsertionEffect" - : enableUseEffectCRUDOverload && - null != updateQueue.resourceKind - ? "useResourceEffect" - : "useEffect"; + : "useEffect"; var addendum = void 0; addendum = null === lastEffect @@ -10629,7 +10664,7 @@ __DEV__ && function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -10641,10 +10676,10 @@ __DEV__ && if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) { - enableUseEffectCRUDOverload + void 0 !== destroy && + (enableUseEffectCRUDOverload ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0); + : (inst.destroy = void 0), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -10661,51 +10696,38 @@ __DEV__ && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted && injectedProfilingHooks.markComponentLayoutEffectUnmountStarted( finishedWork - )); + )), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !0); - if (enableUseEffectCRUDOverload) { - if ( - updateQueue.resourceKind === ResourceEffectIdentityKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = - nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - runWithFiberInDEV( - lastEffect, - callDestroyInDEV, - lastEffect, + (isRunningInsertionEffect = !0), + enableUseEffectCRUDOverload + ? (updateQueue.resourceKind === ResourceEffectIdentityKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy, + updateQueue.inst.resource + ), + updateQueue.next.resourceKind === ResourceEffectUpdateKind + ? (updateQueue.next.update = void 0) + : error$jscomp$0( + "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", + updateQueue.next.resourceKind + ), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, + nearestMountedAncestor, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - destroy_ - ); - updateQueue.next.resourceKind === ResourceEffectUpdateKind - ? (updateQueue.next.update = void 0) - : error$jscomp$0( - "Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.", - updateQueue.next.resourceKind - ); - updateQueue.inst.resource = null; - } - null == updateQueue.resourceKind && - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, destroy - ); - } else - runWithFiberInDEV( - finishedWork, - callDestroyInDEV, - finishedWork, - nearestMountedAncestor$jscomp$0, - destroy - ); + ), (flags & Insertion) !== NoFlags && - (isRunningInsertionEffect = !1); + (isRunningInsertionEffect = !1), enableSchedulingProfiler && ((flags & Passive) !== NoFlags ? enableSchedulingProfiler && @@ -10718,8 +10740,7 @@ __DEV__ && null !== injectedProfilingHooks && "function" === typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped && - injectedProfilingHooks.markComponentLayoutEffectUnmountStopped()); - } + injectedProfilingHooks.markComponentLayoutEffectUnmountStopped())); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -10945,6 +10966,21 @@ __DEV__ && } else ref.current = null; } + function safelyCallDestroy( + current, + nearestMountedAncestor, + destroy, + resource + ) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + runWithFiberInDEV( + current, + callDestroyInDEV, + current, + nearestMountedAncestor, + destroy + ); + } function commitProfiler( finishedWork, current, @@ -17643,8 +17679,6 @@ __DEV__ && useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -17668,140 +17702,16 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountEffect(create, deps); - }, - useImperativeHandle: function (ref, create, deps) { - currentHookNameInDev = "useImperativeHandle"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountImperativeHandle(ref, create, deps); - }, - useInsertionEffect: function (create, deps) { - currentHookNameInDev = "useInsertionEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - mountEffectImpl(4, Insertion, create, deps); - }, - useLayoutEffect: function (create, deps) { - currentHookNameInDev = "useLayoutEffect"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountLayoutEffect(create, deps); - }, - useMemo: function (create, deps) { - currentHookNameInDev = "useMemo"; - mountHookTypesDev(); - checkDepsAreArrayDev(deps); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountMemo(create, deps); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useReducer: function (reducer, initialArg, init) { - currentHookNameInDev = "useReducer"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountReducer(reducer, initialArg, init); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useRef: function (initialValue) { - currentHookNameInDev = "useRef"; - mountHookTypesDev(); - return mountRef(initialValue); - }, - useState: function (initialState) { - currentHookNameInDev = "useState"; - mountHookTypesDev(); - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; - try { - return mountState(initialState); - } finally { - ReactSharedInternals.H = prevDispatcher; - } - }, - useDebugValue: function () { - currentHookNameInDev = "useDebugValue"; - mountHookTypesDev(); - }, - useDeferredValue: function (value, initialValue) { - currentHookNameInDev = "useDeferredValue"; - mountHookTypesDev(); - return mountDeferredValue(value, initialValue); - }, - useTransition: function () { - currentHookNameInDev = "useTransition"; - mountHookTypesDev(); - return mountTransition(); - }, - useSyncExternalStore: function ( - subscribe, - getSnapshot, - getServerSnapshot - ) { - currentHookNameInDev = "useSyncExternalStore"; - mountHookTypesDev(); - return mountSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ); - }, - useId: function () { - currentHookNameInDev = "useId"; - mountHookTypesDev(); - return mountId(); - }, - useFormState: function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }, - useActionState: function (action, initialState) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }, - useOptimistic: function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }, - useHostTransitionStatus: useHostTransitionStatus, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; - mountHookTypesDev(); - return mountRefresh(); - }, - useEffectEvent: function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - } - }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - mountHookTypesDev(); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return ( + checkDepsAreArrayDev(createDeps), mountEffect(create, createDeps) + ); void 0 !== updateDeps && null !== updateDeps && isArrayImpl(updateDeps) && @@ -17817,7 +17727,125 @@ __DEV__ && updateDeps, destroy ); - }); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = "useImperativeHandle"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useInsertionEffect: function (create, deps) { + currentHookNameInDev = "useInsertionEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + mountEffectImpl(4, Insertion, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = "useLayoutEffect"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = "useMemo"; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountMemo(create, deps); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = "useReducer"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = "useRef"; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = "useState"; + mountHookTypesDev(); + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnMountInDEV; + try { + return mountState(initialState); + } finally { + ReactSharedInternals.H = prevDispatcher; + } + }, + useDebugValue: function () { + currentHookNameInDev = "useDebugValue"; + mountHookTypesDev(); + }, + useDeferredValue: function (value, initialValue) { + currentHookNameInDev = "useDeferredValue"; + mountHookTypesDev(); + return mountDeferredValue(value, initialValue); + }, + useTransition: function () { + currentHookNameInDev = "useTransition"; + mountHookTypesDev(); + return mountTransition(); + }, + useSyncExternalStore: function ( + subscribe, + getSnapshot, + getServerSnapshot + ) { + currentHookNameInDev = "useSyncExternalStore"; + mountHookTypesDev(); + return mountSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ); + }, + useId: function () { + currentHookNameInDev = "useId"; + mountHookTypesDev(); + return mountId(); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); + } + }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -17833,10 +17861,19 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -17952,24 +17989,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMountWithHookTypesInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -17985,10 +18004,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -18104,26 +18136,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -18139,10 +18151,23 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -18258,26 +18283,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnRerenderInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -18299,11 +18304,20 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); mountHookTypesDev(); - return mountEffect(create, deps); + return !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ? mountEffect(create, createDeps) + : mountResourceEffect( + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -18437,25 +18451,6 @@ __DEV__ && return mountEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnMountInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -18477,11 +18472,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -18615,27 +18623,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnUpdateInDEV.useResourceEffect = function ( - create, - createDeps, - update, - updateDeps, - destroy - ) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -18657,11 +18644,24 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps, update, updateDeps, destroy) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + return updateEffect(create, createDeps); + updateResourceEffectImpl( + 2048, + Passive, + create, + createDeps, + update, + updateDeps, + destroy + ); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -18795,22 +18795,6 @@ __DEV__ && return updateEvent(callback); } }; - enableUseEffectCRUDOverload && - (InvalidNestedHooksDispatcherOnRerenderInDEV.useResourceEffect = - function (create, createDeps, update, updateDeps, destroy) { - currentHookNameInDev = "useResourceEffect"; - warnInvalidHookAccess(); - updateHookTypesDev(); - updateResourceEffectImpl( - 2048, - Passive, - create, - createDeps, - update, - updateDeps, - destroy - ); - }); var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -19824,7 +19808,7 @@ __DEV__ && version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-modern-a69b80d0-20250211" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-prod.classic.js b/compiled/facebook-www/ReactReconciler-prod.classic.js index 3fee999343..8817b5e0fd 100644 --- a/compiled/facebook-www/ReactReconciler-prod.classic.js +++ b/compiled/facebook-www/ReactReconciler-prod.classic.js @@ -2766,11 +2766,11 @@ module.exports = function ($$$config) { currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { + function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -2825,15 +2825,15 @@ module.exports = function ($$$config) { function updateRef() { return updateWorkInProgressHook().memoizedState; } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -2852,72 +2852,68 @@ module.exports = function ($$$config) { deps ))); } - function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); + function mountEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + mountEffectImpl(8390656, 8, create, createDeps); + else { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); + } } - function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); - } - function mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); - } - function updateResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + function updateEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + updateEffectImpl(2048, 8, create, createDeps); + else { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } function useEffectEventImpl(payload) { currentlyRenderingFiber.flags |= 4; @@ -7490,7 +7486,7 @@ module.exports = function ($$$config) { function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -7502,59 +7498,33 @@ module.exports = function ($$$config) { if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) - if ( - (enableUseEffectCRUDOverload - ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0), - enableUseEffectCRUDOverload) - ) { - if ( - 0 === updateQueue.resourceKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + void 0 !== destroy && + (enableUseEffectCRUDOverload + ? null == updateQueue.resourceKind && (inst.destroy = void 0) + : (inst.destroy = void 0), + enableUseEffectCRUDOverload + ? (0 === updateQueue.resourceKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - 1 === updateQueue.next.resourceKind && - (updateQueue.next.update = void 0); - updateQueue.inst.resource = null; - } - if (null == updateQueue.resourceKind) { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy, + updateQueue.inst.resource + ), + 1 === updateQueue.next.resourceKind && + (updateQueue.next.update = void 0), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } - } else { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } + destroy + )); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -7643,6 +7613,19 @@ module.exports = function ($$$config) { } else ref.current = null; } + function safelyCallDestroy( + current, + nearestMountedAncestor, + destroy, + resource + ) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } function commitProfilerPostCommit( finishedWork, current, @@ -12941,251 +12924,253 @@ module.exports = function ($$$config) { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) - throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind( + null, + currentlyRenderingFiber, + queue + ); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function ( + subscribe, + getSnapshot, + getServerSnapshot + ) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = getTreeId(); + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = getTreeId(); - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; - } - }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); - var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh - }; + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; - enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -13239,8 +13224,6 @@ module.exports = function ($$$config) { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; - enableUseEffectCRUDOverload && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); var thenableState = null, thenableIndexCounter = 0, reconcileChildFibers = createChildReconciler(!0), @@ -13762,7 +13745,7 @@ module.exports = function ($$$config) { version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-classic-a69b80d0-20250211" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactReconciler-prod.modern.js b/compiled/facebook-www/ReactReconciler-prod.modern.js index d9fc54ee43..835e5bc62c 100644 --- a/compiled/facebook-www/ReactReconciler-prod.modern.js +++ b/compiled/facebook-www/ReactReconciler-prod.modern.js @@ -2627,11 +2627,11 @@ module.exports = function ($$$config) { currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { + function pushSimpleEffect(tag, inst, create, createDeps) { return pushEffectImpl({ tag: tag, create: create, - deps: deps, + deps: createDeps, inst: inst, next: null }); @@ -2686,15 +2686,15 @@ module.exports = function ($$$config) { function updateRef() { return updateWorkInProgressHook().memoizedState; } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( 1 | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -2713,72 +2713,68 @@ module.exports = function ($$$config) { deps ))); } - function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); + function mountEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + mountEffectImpl(8390656, 8, create, createDeps); + else { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber.flags |= 8390656; + var inst = createEffectInstance(); + inst.destroy = destroy; + hook.memoizedState = pushResourceEffect( + 9, + 8, + inst, + create, + createDeps, + update, + updateDeps + ); + } } - function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); - } - function mountResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ) { - var hook = mountWorkInProgressHook(); - currentlyRenderingFiber.flags |= 8390656; - var inst = createEffectInstance(); - inst.destroy = destroy; - hook.memoizedState = pushResourceEffect( - 9, - 8, - inst, - create, - createDeps, - update, - updateDeps - ); - } - function updateResourceEffect( - create, - createDeps, - update, - updateDeps, - destroy - ) { - var hook = updateWorkInProgressHook(), - inst = hook.memoizedState.inst; - inst.destroy = destroy; - createDeps = void 0 === createDeps ? null : createDeps; - updateDeps = void 0 === updateDeps ? null : updateDeps; - if (null !== currentHook) { - destroy = currentHook.memoizedState; - if (null !== createDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isCreateDepsSame = - null != destroy.identity.deps ? destroy.identity.deps : null; - else throw Error(formatProdErrorMessage(543)); - isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); - } - if (null !== updateDeps) { - if (null != destroy.resourceKind && 1 === destroy.resourceKind) - var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; - else throw Error(formatProdErrorMessage(543)); - isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + function updateEffect(create, createDeps, update, updateDeps, destroy) { + if ( + !enableUseEffectCRUDOverload || + ("function" !== typeof update && "function" !== typeof destroy) + ) + updateEffectImpl(2048, 8, create, createDeps); + else { + var hook = updateWorkInProgressHook(), + inst = hook.memoizedState.inst; + inst.destroy = destroy; + createDeps = void 0 === createDeps ? null : createDeps; + updateDeps = void 0 === updateDeps ? null : updateDeps; + if (null !== currentHook) { + destroy = currentHook.memoizedState; + if (null !== createDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isCreateDepsSame = + null != destroy.identity.deps ? destroy.identity.deps : null; + else throw Error(formatProdErrorMessage(543)); + isCreateDepsSame = areHookInputsEqual(createDeps, isCreateDepsSame); + } + if (null !== updateDeps) { + if (null != destroy.resourceKind && 1 === destroy.resourceKind) + var isUpdateDepsSame = null != destroy.deps ? destroy.deps : null; + else throw Error(formatProdErrorMessage(543)); + isUpdateDepsSame = areHookInputsEqual(updateDeps, isUpdateDepsSame); + } } + (isCreateDepsSame && isUpdateDepsSame) || + (currentlyRenderingFiber.flags |= 2048); + hook.memoizedState = pushResourceEffect( + isCreateDepsSame ? 8 : 9, + isUpdateDepsSame ? 8 : 9, + inst, + create, + createDeps, + update, + updateDeps + ); } - (isCreateDepsSame && isUpdateDepsSame) || - (currentlyRenderingFiber.flags |= 2048); - hook.memoizedState = pushResourceEffect( - isCreateDepsSame ? 8 : 9, - isUpdateDepsSame ? 8 : 9, - inst, - create, - createDeps, - update, - updateDeps - ); } function useEffectEventImpl(payload) { currentlyRenderingFiber.flags |= 4; @@ -7247,7 +7243,7 @@ module.exports = function ($$$config) { function commitHookEffectListUnmount( flags, finishedWork, - nearestMountedAncestor$jscomp$0 + nearestMountedAncestor ) { try { var updateQueue = finishedWork.updateQueue, @@ -7259,59 +7255,33 @@ module.exports = function ($$$config) { if ((updateQueue.tag & flags) === flags) { var inst = updateQueue.inst, destroy = inst.destroy; - if (void 0 !== destroy) - if ( - (enableUseEffectCRUDOverload - ? null == updateQueue.resourceKind && (inst.destroy = void 0) - : (inst.destroy = void 0), - enableUseEffectCRUDOverload) - ) { - if ( - 0 === updateQueue.resourceKind && - null != updateQueue.inst.resource - ) { - lastEffect = finishedWork; - var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, - destroy_ = destroy.bind(null, updateQueue.inst.resource); - try { - destroy_(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + void 0 !== destroy && + (enableUseEffectCRUDOverload + ? null == updateQueue.resourceKind && (inst.destroy = void 0) + : (inst.destroy = void 0), + enableUseEffectCRUDOverload + ? (0 === updateQueue.resourceKind && + null != updateQueue.inst.resource && + (safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - 1 === updateQueue.next.resourceKind && - (updateQueue.next.update = void 0); - updateQueue.inst.resource = null; - } - if (null == updateQueue.resourceKind) { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy, + updateQueue.inst.resource + ), + 1 === updateQueue.next.resourceKind && + (updateQueue.next.update = void 0), + (updateQueue.inst.resource = null)), + null == updateQueue.resourceKind && + safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } - } else { - lastEffect = finishedWork; - nearestMountedAncestor = nearestMountedAncestor$jscomp$0; - try { - destroy(); - } catch (error) { - captureCommitPhaseError( - lastEffect, + destroy + )) + : safelyCallDestroy( + finishedWork, nearestMountedAncestor, - error - ); - } - } + destroy + )); } updateQueue = updateQueue.next; } while (updateQueue !== firstEffect); @@ -7400,6 +7370,19 @@ module.exports = function ($$$config) { } else ref.current = null; } + function safelyCallDestroy( + current, + nearestMountedAncestor, + destroy, + resource + ) { + destroy = null == resource ? destroy : destroy.bind(null, resource); + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } function commitProfilerPostCommit( finishedWork, current, @@ -12660,251 +12643,253 @@ module.exports = function ($$$config) { useCacheRefresh: throwInvalidHookError }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - enableUseEffectCRUDOverload && - (ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError); var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); if (shouldDoubleInvokeUserFnsInHooksDEV) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + nextCreate(); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) - throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( null, - fiber, - inst, - getServerSnapshot, - getSnapshot - ), - null - ); - return getServerSnapshot; + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind( + null, + currentlyRenderingFiber, + queue + ); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function ( + subscribe, + getSnapshot, + getServerSnapshot + ) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = getTreeId(); + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = getTreeId(); - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); - }, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: mountActionState, - useActionState: mountActionState, - useOptimistic: function (passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null - }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; - }, - useMemoCache: useMemoCache, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber - )); - }, - useEffectEvent: function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) - throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; - } - }; - enableUseEffectCRUDOverload && - (HooksDispatcherOnMount.useResourceEffect = mountResourceEffect); - var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId, - useHostTransitionStatus: useHostTransitionStatus, - useFormState: updateActionState, - useActionState: updateActionState, - useOptimistic: function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - }, - useMemoCache: useMemoCache, - useCacheRefresh: updateRefresh - }; + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; HooksDispatcherOnUpdate.useEffectEvent = updateEvent; - enableUseEffectCRUDOverload && - (HooksDispatcherOnUpdate.useResourceEffect = updateResourceEffect); var HooksDispatcherOnRerender = { readContext: readContext, use: use, @@ -12958,8 +12943,6 @@ module.exports = function ($$$config) { useCacheRefresh: updateRefresh }; HooksDispatcherOnRerender.useEffectEvent = updateEvent; - enableUseEffectCRUDOverload && - (HooksDispatcherOnRerender.useResourceEffect = updateResourceEffect); var thenableState = null, thenableIndexCounter = 0, reconcileChildFibers = createChildReconciler(!0), @@ -13481,7 +13464,7 @@ module.exports = function ($$$config) { version: rendererVersion, rendererPackageName: rendererPackageName, currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-modern-a69b80d0-20250211" }; null !== extraDevToolsConfig && (internals.rendererConfig = extraDevToolsConfig); diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 135d08cfd5..ff820155a9 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -13,7 +13,7 @@ "use strict"; __DEV__ && (function () { - function JSCompiler_object_inline_createNodeMock_1122() { + function JSCompiler_object_inline_createNodeMock_1139() { return null; } function findHook(fiber, id) { @@ -3776,8 +3776,14 @@ __DEV__ && currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + function pushSimpleEffect(tag, inst, create, createDeps) { + tag = { + tag: tag, + create: create, + deps: createDeps, + inst: inst, + next: null + }; inst = currentlyRenderingFiber.updateQueue; null === inst && ((inst = createFunctionComponentUpdateQueue()), @@ -3785,9 +3791,9 @@ __DEV__ && create = inst.lastEffect; null === create ? (inst.lastEffect = tag.next = tag) - : ((deps = create.next), + : ((createDeps = create.next), (create.next = tag), - (tag.next = deps), + (tag.next = createDeps), (inst.lastEffect = tag)); return tag; } @@ -3799,15 +3805,15 @@ __DEV__ && initialValue = { current: initialValue }; return (hook.memoizedState = initialValue); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -3826,11 +3832,11 @@ __DEV__ && deps ))); } - function mountEffect(create, deps) { + function mountEffect(create, createDeps) { 0 !== (currentlyRenderingFiber.mode & 16) && 0 === (currentlyRenderingFiber.mode & 64) - ? mountEffectImpl(276826112, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + ? mountEffectImpl(276826112, Passive, create, createDeps) + : mountEffectImpl(8390656, Passive, create, createDeps); } function mountLayoutEffect(create, deps) { var fiberFlags = 4194308; @@ -8719,10 +8725,11 @@ __DEV__ && ((inst.destroy = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), + (lastEffect = finishedWork), runWithFiberInDEV( - finishedWork, + lastEffect, callDestroyInDEV, - finishedWork, + lastEffect, nearestMountedAncestor, destroy ), @@ -13475,11 +13482,11 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountEffect(create, deps); + checkDepsAreArrayDev(createDeps); + return mountEffect(create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -13601,10 +13608,10 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - return mountEffect(create, deps); + return mountEffect(create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -13722,10 +13729,10 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + updateEffectImpl(2048, Passive, create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -13843,10 +13850,10 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + updateEffectImpl(2048, Passive, create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -13970,11 +13977,11 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); mountHookTypesDev(); - return mountEffect(create, deps); + return mountEffect(create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -14115,11 +14122,11 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + updateEffectImpl(2048, Passive, create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -14260,11 +14267,11 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + updateEffectImpl(2048, Passive, create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -14991,10 +14998,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-classic-0461c0d8-20250211", + version: "19.1.0-www-classic-a69b80d0-20250211", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-classic-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-classic-a69b80d0-20250211" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -15014,7 +15021,7 @@ __DEV__ && exports._Scheduler = Scheduler; exports.act = act; exports.create = function (element, options) { - var createNodeMock = JSCompiler_object_inline_createNodeMock_1122, + var createNodeMock = JSCompiler_object_inline_createNodeMock_1139, isConcurrentOnly = !0 !== global.IS_REACT_NATIVE_TEST_ENVIRONMENT, isConcurrent = isConcurrentOnly, isStrictMode = !1; @@ -15129,5 +15136,5 @@ __DEV__ && exports.unstable_batchedUpdates = function (fn, a) { return fn(a); }; - exports.version = "19.1.0-www-classic-0461c0d8-20250211"; + exports.version = "19.1.0-www-classic-a69b80d0-20250211"; })(); diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 7aeae4322a..b887f81994 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -13,7 +13,7 @@ "use strict"; __DEV__ && (function () { - function JSCompiler_object_inline_createNodeMock_1122() { + function JSCompiler_object_inline_createNodeMock_1139() { return null; } function findHook(fiber, id) { @@ -3776,8 +3776,14 @@ __DEV__ && currentStateHook.memoizedState = action; return [stateHook, dispatch, !1]; } - function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + function pushSimpleEffect(tag, inst, create, createDeps) { + tag = { + tag: tag, + create: create, + deps: createDeps, + inst: inst, + next: null + }; inst = currentlyRenderingFiber.updateQueue; null === inst && ((inst = createFunctionComponentUpdateQueue()), @@ -3785,9 +3791,9 @@ __DEV__ && create = inst.lastEffect; null === create ? (inst.lastEffect = tag.next = tag) - : ((deps = create.next), + : ((createDeps = create.next), (create.next = tag), - (tag.next = deps), + (tag.next = createDeps), (inst.lastEffect = tag)); return tag; } @@ -3799,15 +3805,15 @@ __DEV__ && initialValue = { current: initialValue }; return (hook.memoizedState = initialValue); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + function mountEffectImpl(fiberFlags, hookFlags, create, createDeps) { var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; + createDeps = void 0 === createDeps ? null : createDeps; currentlyRenderingFiber.flags |= fiberFlags; hook.memoizedState = pushSimpleEffect( HasEffect | hookFlags, createEffectInstance(), create, - deps + createDeps ); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { @@ -3826,11 +3832,11 @@ __DEV__ && deps ))); } - function mountEffect(create, deps) { + function mountEffect(create, createDeps) { 0 !== (currentlyRenderingFiber.mode & 16) && 0 === (currentlyRenderingFiber.mode & 64) - ? mountEffectImpl(276826112, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); + ? mountEffectImpl(276826112, Passive, create, createDeps) + : mountEffectImpl(8390656, Passive, create, createDeps); } function mountLayoutEffect(create, deps) { var fiberFlags = 4194308; @@ -8719,10 +8725,11 @@ __DEV__ && ((inst.destroy = void 0), (flags & Insertion) !== NoFlags && (isRunningInsertionEffect = !0), + (lastEffect = finishedWork), runWithFiberInDEV( - finishedWork, + lastEffect, callDestroyInDEV, - finishedWork, + lastEffect, nearestMountedAncestor, destroy ), @@ -13475,11 +13482,11 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; mountHookTypesDev(); - checkDepsAreArrayDev(deps); - return mountEffect(create, deps); + checkDepsAreArrayDev(createDeps); + return mountEffect(create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -13601,10 +13608,10 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - return mountEffect(create, deps); + return mountEffect(create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -13722,10 +13729,10 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + updateEffectImpl(2048, Passive, create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -13843,10 +13850,10 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + updateEffectImpl(2048, Passive, create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -13970,11 +13977,11 @@ __DEV__ && mountHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); mountHookTypesDev(); - return mountEffect(create, deps); + return mountEffect(create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -14115,11 +14122,11 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + updateEffectImpl(2048, Passive, create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -14260,11 +14267,11 @@ __DEV__ && updateHookTypesDev(); return readContext(context); }, - useEffect: function (create, deps) { + useEffect: function (create, createDeps) { currentHookNameInDev = "useEffect"; warnInvalidHookAccess(); updateHookTypesDev(); - updateEffectImpl(2048, Passive, create, deps); + updateEffectImpl(2048, Passive, create, createDeps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = "useImperativeHandle"; @@ -14991,10 +14998,10 @@ __DEV__ && (function () { var internals = { bundleType: 1, - version: "19.1.0-www-modern-0461c0d8-20250211", + version: "19.1.0-www-modern-a69b80d0-20250211", rendererPackageName: "react-test-renderer", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.1.0-www-modern-0461c0d8-20250211" + reconcilerVersion: "19.1.0-www-modern-a69b80d0-20250211" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -15014,7 +15021,7 @@ __DEV__ && exports._Scheduler = Scheduler; exports.act = act; exports.create = function (element, options) { - var createNodeMock = JSCompiler_object_inline_createNodeMock_1122, + var createNodeMock = JSCompiler_object_inline_createNodeMock_1139, isConcurrentOnly = !0 !== global.IS_REACT_NATIVE_TEST_ENVIRONMENT, isConcurrent = isConcurrentOnly, isStrictMode = !1; @@ -15129,5 +15136,5 @@ __DEV__ && exports.unstable_batchedUpdates = function (fn, a) { return fn(a); }; - exports.version = "19.1.0-www-modern-0461c0d8-20250211"; + exports.version = "19.1.0-www-modern-a69b80d0-20250211"; })(); diff --git a/compiled/facebook-www/VERSION_CLASSIC b/compiled/facebook-www/VERSION_CLASSIC index 717b6eae2a..ba72665816 100644 --- a/compiled/facebook-www/VERSION_CLASSIC +++ b/compiled/facebook-www/VERSION_CLASSIC @@ -1 +1 @@ -19.1.0-www-classic-0461c0d8-20250211 \ No newline at end of file +19.1.0-www-classic-a69b80d0-20250211 \ No newline at end of file diff --git a/compiled/facebook-www/VERSION_MODERN b/compiled/facebook-www/VERSION_MODERN index 6618aa4129..7d5fe68696 100644 --- a/compiled/facebook-www/VERSION_MODERN +++ b/compiled/facebook-www/VERSION_MODERN @@ -1 +1 @@ -19.1.0-www-modern-0461c0d8-20250211 \ No newline at end of file +19.1.0-www-modern-a69b80d0-20250211 \ No newline at end of file diff --git a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js index 36ab7cc14c..723b08f46f 100644 --- a/compiled/facebook-www/__test_utils__/ReactAllWarnings.js +++ b/compiled/facebook-www/__test_utils__/ReactAllWarnings.js @@ -390,7 +390,7 @@ export default [ "unmountComponentAtNode was removed in React 19. Use root.unmount() instead.", "unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s", "unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.", + "useEffect must provide a callback which returns a resource. If a managed resource is not needed here, do not provide an updater or destroy callback. Received %s", "useInsertionEffect must not schedule updates.", - "useOptimistic is now in canary. Remove the experimental_ prefix. The prefixed alias will be removed in an upcoming release.", - "useResourceEffect must provide a callback which returns a resource. If a managed resource is not needed here, use useEffect. Received %s" + "useOptimistic is now in canary. Remove the experimental_ prefix. The prefixed alias will be removed in an upcoming release." ];