From 7cec0cb5a514fbecfa3ae77f2bb3fb2b668995b2 Mon Sep 17 00:00:00 2001 From: acdlite Date: Thu, 1 Feb 2024 18:33:51 +0000 Subject: [PATCH] Add stable React.act export (#28160) Starting in version 19, users can import the `act` testing API from the `react` package instead of using a renderer specific API, like `react-dom/test-utils`. DiffTrain build for commit https://github.com/facebook/react/commit/53b12e46a17549ec7644e13c126440ed2f3629fd. --- .../react-test-renderer/cjs/ReactTestRenderer-dev.js | 6 +++--- .../react-test-renderer/cjs/ReactTestRenderer-prod.js | 8 ++++---- .../cjs/ReactTestRenderer-profiling.js | 8 ++++---- .../xplat/js/RKJSModules/vendor/react/cjs/React-dev.js | 6 +++--- .../js/RKJSModules/vendor/react/cjs/React-prod.js | 10 +++++----- .../js/RKJSModules/vendor/react/cjs/React-profiling.js | 10 +++++----- .../js/react-native-github/Libraries/Renderer/REVISION | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js index a55bb7f6a9dd2..a4d60b0298b9d 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -25623,7 +25623,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-canary-4384a7bcd-20240201"; + var ReactVersion = "18.3.0-canary-53b12e46a-20240201"; // Might add PROFILE later. @@ -26059,7 +26059,7 @@ if (__DEV__) { }); } - var act = React.unstable_act; // TODO: Remove from public bundle + var act = React.act; // TODO: Remove from public bundle var defaultTestOptions = { createNodeMock: function () { diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js index d34c870d8c594..ac64b615bc233 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<8c4ed2fabb96724eadedb0d542cd9ecf>> + * @generated SignedSource<<8c9395a5b61885f3066e52faeb0c2d89>> */ "use strict"; @@ -8845,7 +8845,7 @@ function updateContainer(element, container, parentComponent, callback) { function emptyFindFiberByHostInstance() { return null; } -var act = React.unstable_act, +var act = React.act, defaultTestOptions = { createNodeMock: function () { return null; @@ -9149,7 +9149,7 @@ var devToolsConfig$jscomp$inline_1031 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-4384a7bcd-20240201", + version: "18.3.0-canary-53b12e46a-20240201", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1207 = { @@ -9180,7 +9180,7 @@ var internals$jscomp$inline_1207 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-4384a7bcd-20240201" + reconcilerVersion: "18.3.0-canary-53b12e46a-20240201" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1208 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js index a7d5bce50b6bc..d463218213946 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<<84e7b0d0b02f7624902f32d8515cf248>> */ "use strict"; @@ -9273,7 +9273,7 @@ function updateContainer(element, container, parentComponent, callback) { function emptyFindFiberByHostInstance() { return null; } -var act = React.unstable_act, +var act = React.act, defaultTestOptions = { createNodeMock: function () { return null; @@ -9577,7 +9577,7 @@ var devToolsConfig$jscomp$inline_1073 = { throw Error("TestRenderer does not support findFiberByHostInstance()"); }, bundleType: 0, - version: "18.3.0-canary-4384a7bcd-20240201", + version: "18.3.0-canary-53b12e46a-20240201", rendererPackageName: "react-test-renderer" }; var internals$jscomp$inline_1248 = { @@ -9608,7 +9608,7 @@ var internals$jscomp$inline_1248 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-canary-4384a7bcd-20240201" + reconcilerVersion: "18.3.0-canary-53b12e46a-20240201" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_1249 = __REACT_DEVTOOLS_GLOBAL_HOOK__; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js index de3914542d2ec..07a20dfb60b68 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<> + * @generated SignedSource<> */ "use strict"; @@ -24,7 +24,7 @@ if (__DEV__) { ) { __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } - var ReactVersion = "18.3.0-canary-4384a7bcd-20240201"; + var ReactVersion = "18.3.0-canary-53b12e46a-20240201"; // ATTENTION // When adding new symbols to this file, @@ -3803,6 +3803,7 @@ if (__DEV__) { exports.Suspense = REACT_SUSPENSE_TYPE; exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; + exports.act = act; exports.cache = cache; exports.cloneElement = cloneElement; exports.createContext = createContext; @@ -3825,7 +3826,6 @@ if (__DEV__) { exports.unstable_Scope = REACT_SCOPE_TYPE; exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE; exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE; - exports.unstable_act = act; exports.unstable_getCacheForType = getCacheForType; exports.unstable_getCacheSignal = getCacheSignal; exports.unstable_useCacheRefresh = useCacheRefresh; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js index 24667af635793..bb4a652be7a98 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<01a7046607ddd10a45604fb003900a70>> + * @generated SignedSource<<041228aace3ee017428b18b25dc5ebe3>> */ "use strict"; @@ -350,6 +350,9 @@ exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; +exports.act = function () { + throw Error("act(...) is not supported in production builds of React."); +}; exports.cache = function (fn) { return function () { return fn.apply(null, arguments); @@ -463,9 +466,6 @@ exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE; exports.unstable_Scope = REACT_SCOPE_TYPE; exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE; exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE; -exports.unstable_act = function () { - throw Error("act(...) is not supported in production builds of React."); -}; exports.unstable_getCacheForType = function (resourceType) { var dispatcher = ReactCurrentCache.current; return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType(); @@ -545,4 +545,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-canary-4384a7bcd-20240201"; +exports.version = "18.3.0-canary-53b12e46a-20240201"; diff --git a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js index c945e667ade4c..0b134c9ab92b5 100644 --- a/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js +++ b/compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js @@ -7,7 +7,7 @@ * @noflow * @nolint * @preventMunge - * @generated SignedSource<<877b0f86c9972010f80642430d790525>> + * @generated SignedSource<> */ "use strict"; @@ -321,6 +321,9 @@ exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; +exports.act = function () { + throw Error("act(...) is not supported in production builds of React."); +}; exports.cache = function (fn) { return function () { return fn.apply(null, arguments); @@ -459,9 +462,6 @@ exports.unstable_DebugTracingMode = REACT_DEBUG_TRACING_MODE_TYPE; exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE; exports.unstable_Scope = REACT_SCOPE_TYPE; exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE; -exports.unstable_act = function () { - throw Error("act(...) is not supported in production builds of React."); -}; exports.unstable_getCacheForType = function (resourceType) { var dispatcher = ReactCurrentCache.current; return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType(); @@ -541,7 +541,7 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-canary-4384a7bcd-20240201"; +exports.version = "18.3.0-canary-53b12e46a-20240201"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && 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 ca7834c6680eb..5fa27b91cf639 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 @@ -4384a7bcd351c2218c5727a949cf7fff20c3d9d4 +53b12e46a17549ec7644e13c126440ed2f3629fd