From ca3d324212fec3824eb3d36885df683a19cc4970 Mon Sep 17 00:00:00 2001 From: acdlite Date: Tue, 28 May 2024 19:15:58 +0000 Subject: [PATCH] Fix: Use action implementation at time of dispatch (#29618) Fixes the behavior of actions that are queued by useActionState to use the action function that was current at the time it was dispatched, not at the time it eventually executes. The conceptual model is that the action is immediately dispatched, as if it were sent to a remote server/worker. It's the remote worker that maintains the queue, not the client. This is another property of actions makes them more like event handlers than like reducers. DiffTrain build for commit https://github.com/facebook/react/commit/163122766b6008e992898b00f1fe3b104ed78737. --- .../cjs/ReactTestRenderer-dev.js | 27 ++++++++++----- .../cjs/ReactTestRenderer-prod.js | 30 +++++++--------- .../cjs/ReactTestRenderer-profiling.js | 30 +++++++--------- .../Libraries/Renderer/REVISION | 2 +- .../implementations/ReactFabric-dev.fb.js | 27 ++++++++++----- .../implementations/ReactFabric-prod.fb.js | 30 +++++++--------- .../ReactFabric-profiling.fb.js | 30 +++++++--------- .../ReactNativeRenderer-dev.fb.js | 27 ++++++++++----- .../ReactNativeRenderer-prod.fb.js | 34 ++++++++----------- .../ReactNativeRenderer-profiling.fb.js | 34 ++++++++----------- 10 files changed, 137 insertions(+), 134 deletions(-) diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js index cbfc4fbf06..f92dda631f 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<5d2de112982cec5eac69c9d1f8e71fe5>> + * @generated SignedSource<> */ 'use strict'; @@ -8595,26 +8595,26 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl // it immediately. var newLast = { payload: payload, + action: actionQueue.action, next: null // circular }; newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, payload); + runActionStateAction(actionQueue, setPendingState, setState, newLast); } else { // There's already an action running. Add to the queue. var first = last.next; var _newLast = { payload: payload, + action: actionQueue.action, next: first }; actionQueue.pending = last.next = _newLast; } } -function runActionStateAction(actionQueue, setPendingState, setState, payload) { - var action = actionQueue.action; - var prevState = actionQueue.state; // This is a fork of startTransition - +function runActionStateAction(actionQueue, setPendingState, setState, node) { + // This is a fork of startTransition var prevTransition = ReactSharedInternals.T; var currentTransition = {}; ReactSharedInternals.T = currentTransition; @@ -8625,7 +8625,16 @@ function runActionStateAction(actionQueue, setPendingState, setState, payload) { // This will be reverted automatically when all actions are finished. - setPendingState(true); + setPendingState(true); // `node.action` represents the action function at the time it was dispatched. + // If this action was queued, it might be stale, i.e. it's not necessarily the + // most current implementation of the action, stored on `actionQueue`. This is + // intentional. The conceptual model for queued actions is that they are + // queued in a remote worker; the dispatch happens immediately, only the + // execution is delayed. + + var action = node.action; + var payload = node.payload; + var prevState = actionQueue.state; try { var returnValue = action(prevState, payload); @@ -8698,7 +8707,7 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next.payload); + runActionStateAction(actionQueue, setPendingState, setState, next); } } } @@ -23462,7 +23471,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-rc-44b67cc6'; +var ReactVersion = '19.0.0-rc-0d4b9126'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js index e8e68312a9..b3d89a014a 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -2773,21 +2773,22 @@ function dispatchActionState( throw Error("Cannot update form state while rendering."); fiber = actionQueue.pending; null === fiber - ? ((fiber = { payload: payload, next: null }), - (fiber.next = actionQueue.pending = fiber), + ? ((payload = { payload: payload, action: actionQueue.action, next: null }), + (payload.next = actionQueue.pending = payload), runActionStateAction(actionQueue, setPendingState, setState, payload)) : (actionQueue.pending = fiber.next = - { payload: payload, next: fiber.next }); + { payload: payload, action: actionQueue.action, next: fiber.next }); } -function runActionStateAction(actionQueue, setPendingState, setState, payload) { - var action = actionQueue.action, - prevState = actionQueue.state, - prevTransition = ReactSharedInternals.T, +function runActionStateAction(actionQueue, setPendingState, setState, node) { + var prevTransition = ReactSharedInternals.T, currentTransition = {}; ReactSharedInternals.T = currentTransition; setPendingState(!0); + var action = node.action; + node = node.payload; + var prevState = actionQueue.state; try { - var returnValue = action(prevState, payload), + var returnValue = action(prevState, node), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); @@ -2834,12 +2835,7 @@ function finishRunningActionStateAction( ? (actionQueue.pending = null) : ((first = first.next), (last.next = first), - runActionStateAction( - actionQueue, - setPendingState, - setState, - first.payload - )); + runActionStateAction(actionQueue, setPendingState, setState, first)); } } function actionStateReducer(oldState, newState) { @@ -9302,7 +9298,7 @@ var devToolsConfig$jscomp$inline_1047 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "19.0.0-rc-96bb2a1a", + version: "19.0.0-rc-135fcf29", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1234 = { @@ -9333,7 +9329,7 @@ var internals$jscomp$inline_1234 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-96bb2a1a" + reconcilerVersion: "19.0.0-rc-135fcf29" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1235 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js index c069df7541..c2176c3739 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<382b340fe45aa68c7ed8c70111650a72>> + * @generated SignedSource<> */ "use strict"; @@ -2861,21 +2861,22 @@ function dispatchActionState( throw Error("Cannot update form state while rendering."); fiber = actionQueue.pending; null === fiber - ? ((fiber = { payload: payload, next: null }), - (fiber.next = actionQueue.pending = fiber), + ? ((payload = { payload: payload, action: actionQueue.action, next: null }), + (payload.next = actionQueue.pending = payload), runActionStateAction(actionQueue, setPendingState, setState, payload)) : (actionQueue.pending = fiber.next = - { payload: payload, next: fiber.next }); + { payload: payload, action: actionQueue.action, next: fiber.next }); } -function runActionStateAction(actionQueue, setPendingState, setState, payload) { - var action = actionQueue.action, - prevState = actionQueue.state, - prevTransition = ReactSharedInternals.T, +function runActionStateAction(actionQueue, setPendingState, setState, node) { + var prevTransition = ReactSharedInternals.T, currentTransition = {}; ReactSharedInternals.T = currentTransition; setPendingState(!0); + var action = node.action; + node = node.payload; + var prevState = actionQueue.state; try { - var returnValue = action(prevState, payload), + var returnValue = action(prevState, node), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); @@ -2922,12 +2923,7 @@ function finishRunningActionStateAction( ? (actionQueue.pending = null) : ((first = first.next), (last.next = first), - runActionStateAction( - actionQueue, - setPendingState, - setState, - first.payload - )); + runActionStateAction(actionQueue, setPendingState, setState, first)); } } function actionStateReducer(oldState, newState) { @@ -9924,7 +9920,7 @@ var devToolsConfig$jscomp$inline_1130 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "19.0.0-rc-d4795057", + version: "19.0.0-rc-17313e5b", rendererPackageName: "react-test-renderer" }; (function (internals) { @@ -9968,7 +9964,7 @@ var devToolsConfig$jscomp$inline_1130 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-d4795057" + reconcilerVersion: "19.0.0-rc-17313e5b" }); exports._Scheduler = Scheduler; exports.act = act; diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION index 1f0a77d869..5e1e837b6d 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION @@ -1 +1 @@ -2787eebe52864356252a280fd811cd9d52807a82 +163122766b6008e992898b00f1fe3b104ed78737 diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js index ebd33c47a0..46acb4f0fd 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ 'use strict'; @@ -11341,26 +11341,26 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl // it immediately. var newLast = { payload: payload, + action: actionQueue.action, next: null // circular }; newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, payload); + runActionStateAction(actionQueue, setPendingState, setState, newLast); } else { // There's already an action running. Add to the queue. var first = last.next; var _newLast = { payload: payload, + action: actionQueue.action, next: first }; actionQueue.pending = last.next = _newLast; } } -function runActionStateAction(actionQueue, setPendingState, setState, payload) { - var action = actionQueue.action; - var prevState = actionQueue.state; // This is a fork of startTransition - +function runActionStateAction(actionQueue, setPendingState, setState, node) { + // This is a fork of startTransition var prevTransition = ReactSharedInternals.T; var currentTransition = {}; ReactSharedInternals.T = currentTransition; @@ -11371,7 +11371,16 @@ function runActionStateAction(actionQueue, setPendingState, setState, payload) { // This will be reverted automatically when all actions are finished. - setPendingState(true); + setPendingState(true); // `node.action` represents the action function at the time it was dispatched. + // If this action was queued, it might be stale, i.e. it's not necessarily the + // most current implementation of the action, stored on `actionQueue`. This is + // intentional. The conceptual model for queued actions is that they are + // queued in a remote worker; the dispatch happens immediately, only the + // execution is delayed. + + var action = node.action; + var payload = node.payload; + var prevState = actionQueue.state; try { var returnValue = action(prevState, payload); @@ -11444,7 +11453,7 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next.payload); + runActionStateAction(actionQueue, setPendingState, setState, next); } } } @@ -26203,7 +26212,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-rc-571af8c1'; +var ReactVersion = '19.0.0-rc-e4976d97'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js index 3e9065b4ec..4b1bade6e3 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<2010209dd2101a00236bbe4927c1ce22>> + * @generated SignedSource<<90fa919b6a227b2cc430690a633373b6>> */ "use strict"; @@ -4153,21 +4153,22 @@ function dispatchActionState( throw Error("Cannot update form state while rendering."); fiber = actionQueue.pending; null === fiber - ? ((fiber = { payload: payload, next: null }), - (fiber.next = actionQueue.pending = fiber), + ? ((payload = { payload: payload, action: actionQueue.action, next: null }), + (payload.next = actionQueue.pending = payload), runActionStateAction(actionQueue, setPendingState, setState, payload)) : (actionQueue.pending = fiber.next = - { payload: payload, next: fiber.next }); + { payload: payload, action: actionQueue.action, next: fiber.next }); } -function runActionStateAction(actionQueue, setPendingState, setState, payload) { - var action = actionQueue.action, - prevState = actionQueue.state, - prevTransition = ReactSharedInternals.T, +function runActionStateAction(actionQueue, setPendingState, setState, node) { + var prevTransition = ReactSharedInternals.T, currentTransition = {}; ReactSharedInternals.T = currentTransition; setPendingState(!0); + var action = node.action; + node = node.payload; + var prevState = actionQueue.state; try { - var returnValue = action(prevState, payload), + var returnValue = action(prevState, node), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); @@ -4214,12 +4215,7 @@ function finishRunningActionStateAction( ? (actionQueue.pending = null) : ((first = first.next), (last.next = first), - runActionStateAction( - actionQueue, - setPendingState, - setState, - first.payload - )); + runActionStateAction(actionQueue, setPendingState, setState, first)); } } function actionStateReducer(oldState, newState) { @@ -10558,7 +10554,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1124 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-rc-68b4213e", + version: "19.0.0-rc-515f4c11", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10601,7 +10597,7 @@ var internals$jscomp$inline_1354 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-68b4213e" + reconcilerVersion: "19.0.0-rc-515f4c11" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1355 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js index 8a4626d7ad..ab5c1dd6d1 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<8bf9b34548f4c8e979ea4fc8b49091e3>> + * @generated SignedSource<> */ "use strict"; @@ -4275,21 +4275,22 @@ function dispatchActionState( throw Error("Cannot update form state while rendering."); fiber = actionQueue.pending; null === fiber - ? ((fiber = { payload: payload, next: null }), - (fiber.next = actionQueue.pending = fiber), + ? ((payload = { payload: payload, action: actionQueue.action, next: null }), + (payload.next = actionQueue.pending = payload), runActionStateAction(actionQueue, setPendingState, setState, payload)) : (actionQueue.pending = fiber.next = - { payload: payload, next: fiber.next }); + { payload: payload, action: actionQueue.action, next: fiber.next }); } -function runActionStateAction(actionQueue, setPendingState, setState, payload) { - var action = actionQueue.action, - prevState = actionQueue.state, - prevTransition = ReactSharedInternals.T, +function runActionStateAction(actionQueue, setPendingState, setState, node) { + var prevTransition = ReactSharedInternals.T, currentTransition = {}; ReactSharedInternals.T = currentTransition; setPendingState(!0); + var action = node.action; + node = node.payload; + var prevState = actionQueue.state; try { - var returnValue = action(prevState, payload), + var returnValue = action(prevState, node), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); @@ -4336,12 +4337,7 @@ function finishRunningActionStateAction( ? (actionQueue.pending = null) : ((first = first.next), (last.next = first), - runActionStateAction( - actionQueue, - setPendingState, - setState, - first.payload - )); + runActionStateAction(actionQueue, setPendingState, setState, first)); } } function actionStateReducer(oldState, newState) { @@ -11264,7 +11260,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1205 = { findFiberByHostInstance: getInstanceFromNode, bundleType: 0, - version: "19.0.0-rc-30caa758", + version: "19.0.0-rc-1abc9c11", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11320,7 +11316,7 @@ var roots = new Map(), scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-30caa758" + reconcilerVersion: "19.0.0-rc-1abc9c11" }); exports.createPortal = function (children, containerTag) { return createPortal$1( diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js index c95e00aeaa..e4ca353b1c 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<99a2a7f7d6e7d571646aa72aabedfaa0>> + * @generated SignedSource<<40a0e1ce33bc52f3d6d9fc7ae12f7651>> */ 'use strict'; @@ -11518,26 +11518,26 @@ function dispatchActionState(fiber, actionQueue, setPendingState, setState, payl // it immediately. var newLast = { payload: payload, + action: actionQueue.action, next: null // circular }; newLast.next = actionQueue.pending = newLast; - runActionStateAction(actionQueue, setPendingState, setState, payload); + runActionStateAction(actionQueue, setPendingState, setState, newLast); } else { // There's already an action running. Add to the queue. var first = last.next; var _newLast = { payload: payload, + action: actionQueue.action, next: first }; actionQueue.pending = last.next = _newLast; } } -function runActionStateAction(actionQueue, setPendingState, setState, payload) { - var action = actionQueue.action; - var prevState = actionQueue.state; // This is a fork of startTransition - +function runActionStateAction(actionQueue, setPendingState, setState, node) { + // This is a fork of startTransition var prevTransition = ReactSharedInternals.T; var currentTransition = {}; ReactSharedInternals.T = currentTransition; @@ -11548,7 +11548,16 @@ function runActionStateAction(actionQueue, setPendingState, setState, payload) { // This will be reverted automatically when all actions are finished. - setPendingState(true); + setPendingState(true); // `node.action` represents the action function at the time it was dispatched. + // If this action was queued, it might be stale, i.e. it's not necessarily the + // most current implementation of the action, stored on `actionQueue`. This is + // intentional. The conceptual model for queued actions is that they are + // queued in a remote worker; the dispatch happens immediately, only the + // execution is delayed. + + var action = node.action; + var payload = node.payload; + var prevState = actionQueue.state; try { var returnValue = action(prevState, payload); @@ -11621,7 +11630,7 @@ function finishRunningActionStateAction(actionQueue, setPendingState, setState) var next = first.next; last.next = next; // Run the next action. - runActionStateAction(actionQueue, setPendingState, setState, next.payload); + runActionStateAction(actionQueue, setPendingState, setState, next); } } } @@ -26553,7 +26562,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition return root; } -var ReactVersion = '19.0.0-rc-c2f0c7bb'; +var ReactVersion = '19.0.0-rc-a40621a5'; /* * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js index a7d2737004..de7c4c4af7 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<247c643cf9a4130707253f9a40761f49>> + * @generated SignedSource<> */ "use strict"; @@ -4176,21 +4176,22 @@ function dispatchActionState( throw Error("Cannot update form state while rendering."); fiber = actionQueue.pending; null === fiber - ? ((fiber = { payload: payload, next: null }), - (fiber.next = actionQueue.pending = fiber), + ? ((payload = { payload: payload, action: actionQueue.action, next: null }), + (payload.next = actionQueue.pending = payload), runActionStateAction(actionQueue, setPendingState, setState, payload)) : (actionQueue.pending = fiber.next = - { payload: payload, next: fiber.next }); + { payload: payload, action: actionQueue.action, next: fiber.next }); } -function runActionStateAction(actionQueue, setPendingState, setState, payload) { - var action = actionQueue.action, - prevState = actionQueue.state, - prevTransition = ReactSharedInternals.T, +function runActionStateAction(actionQueue, setPendingState, setState, node) { + var prevTransition = ReactSharedInternals.T, currentTransition = {}; ReactSharedInternals.T = currentTransition; setPendingState(!0); + var action = node.action; + node = node.payload; + var prevState = actionQueue.state; try { - var returnValue = action(prevState, payload), + var returnValue = action(prevState, node), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); @@ -4237,12 +4238,7 @@ function finishRunningActionStateAction( ? (actionQueue.pending = null) : ((first = first.next), (last.next = first), - runActionStateAction( - actionQueue, - setPendingState, - setState, - first.payload - )); + runActionStateAction(actionQueue, setPendingState, setState, first)); } } function actionStateReducer(oldState, newState) { @@ -10700,11 +10696,11 @@ function traverseOwnerTreeUp(hierarchy, instance) { traverseOwnerTreeUp(hierarchy, instance); } var isomorphicReactPackageVersion = React.version; -if ("19.0.0-rc-28c9760f" !== isomorphicReactPackageVersion) +if ("19.0.0-rc-1573a96d" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.0.0-rc-28c9760f\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-rc-1573a96d\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -10754,7 +10750,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1192 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-rc-28c9760f", + version: "19.0.0-rc-1573a96d", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -10797,7 +10793,7 @@ var internals$jscomp$inline_1439 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-28c9760f" + reconcilerVersion: "19.0.0-rc-1573a96d" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1440 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js index be9964a176..21fa7a3237 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +++ b/compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<6652e7dae32d5fb11c7bcc6eec0f1201>> */ "use strict"; @@ -4298,21 +4298,22 @@ function dispatchActionState( throw Error("Cannot update form state while rendering."); fiber = actionQueue.pending; null === fiber - ? ((fiber = { payload: payload, next: null }), - (fiber.next = actionQueue.pending = fiber), + ? ((payload = { payload: payload, action: actionQueue.action, next: null }), + (payload.next = actionQueue.pending = payload), runActionStateAction(actionQueue, setPendingState, setState, payload)) : (actionQueue.pending = fiber.next = - { payload: payload, next: fiber.next }); + { payload: payload, action: actionQueue.action, next: fiber.next }); } -function runActionStateAction(actionQueue, setPendingState, setState, payload) { - var action = actionQueue.action, - prevState = actionQueue.state, - prevTransition = ReactSharedInternals.T, +function runActionStateAction(actionQueue, setPendingState, setState, node) { + var prevTransition = ReactSharedInternals.T, currentTransition = {}; ReactSharedInternals.T = currentTransition; setPendingState(!0); + var action = node.action; + node = node.payload; + var prevState = actionQueue.state; try { - var returnValue = action(prevState, payload), + var returnValue = action(prevState, node), onStartTransitionFinish = ReactSharedInternals.S; null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue); @@ -4359,12 +4360,7 @@ function finishRunningActionStateAction( ? (actionQueue.pending = null) : ((first = first.next), (last.next = first), - runActionStateAction( - actionQueue, - setPendingState, - setState, - first.payload - )); + runActionStateAction(actionQueue, setPendingState, setState, first)); } } function actionStateReducer(oldState, newState) { @@ -11407,11 +11403,11 @@ function traverseOwnerTreeUp(hierarchy, instance) { traverseOwnerTreeUp(hierarchy, instance); } var isomorphicReactPackageVersion = React.version; -if ("19.0.0-rc-3983b44c" !== isomorphicReactPackageVersion) +if ("19.0.0-rc-dc7a4039" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-native-renderer: 19.0.0-rc-3983b44c\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-native-renderer: 19.0.0-rc-dc7a4039\nLearn more: https://react.dev/warnings/version-mismatch") ); if ( "function" !== @@ -11461,7 +11457,7 @@ var roots = new Map(), devToolsConfig$jscomp$inline_1273 = { findFiberByHostInstance: getInstanceFromTag, bundleType: 0, - version: "19.0.0-rc-3983b44c", + version: "19.0.0-rc-dc7a4039", rendererPackageName: "react-native-renderer", rendererConfig: { getInspectorDataForInstance: getInspectorDataForInstance, @@ -11517,7 +11513,7 @@ var roots = new Map(), scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "19.0.0-rc-3983b44c" + reconcilerVersion: "19.0.0-rc-dc7a4039" }); exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { computeComponentStackForErrorReporting: function (reactTag) {