Skip to content

Commit

Permalink
Use concurrent root in RTR (#28498)
Browse files Browse the repository at this point in the history
Based on
- #28497
- #28419

Reusing the disableLegacyMode flag, we set ReactTestRenderer to always
render with concurrent root where legacy APIs are no longer available.
If disableLegacyMode is false, we continue to allow the
unstable_isConcurrent option determine the root type.

Also checking a global `IS_REACT_NATIVE_TEST_ENVIRONMENT` so we can
maintain the existing behavior for RN until we remove legacy root
support there.

DiffTrain build for commit bb66aa3.
  • Loading branch information
jackpope committed Mar 26, 2024
1 parent dd1d24b commit ab96eb3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<270144e142689aae36510575078767a1>>
* @generated SignedSource<<c87024931f160e9769cdcf58bdec1a68>>
*/

"use strict";
Expand Down Expand Up @@ -148,6 +148,7 @@ if (__DEV__) {
var enableLegacyHidden = false;
var enableAsyncActions = true;
var alwaysThrottleRetries = true;
var disableLegacyMode = false;
var enableBigIntSupport = false; // Flow magic to verify the exports of this file match the original version.

var FunctionComponent = 0;
Expand Down Expand Up @@ -25508,7 +25509,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-canary-a9ccb423";
var ReactVersion = "19.0.0-canary-ab33cef8";

// Might add PROFILE later.

Expand Down Expand Up @@ -26402,7 +26403,8 @@ if (__DEV__) {

function create(element, options) {
var createNodeMock = defaultTestOptions.createNodeMock;
var isConcurrent = false;
var isConcurrentOnly = disableLegacyMode === true;
var isConcurrent = isConcurrentOnly;
var isStrictMode = false;
var concurrentUpdatesByDefault = null;

Expand All @@ -26412,8 +26414,8 @@ if (__DEV__) {
createNodeMock = options.createNodeMock;
}

if (options.unstable_isConcurrent === true) {
isConcurrent = true;
{
isConcurrent = options.unstable_isConcurrent;
}

if (options.unstable_strictMode === true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<a75b0d81ed7e65574a940500686411f9>>
* @generated SignedSource<<9e59b85bab1889d947c7a99fc106a97b>>
*/

"use strict";
Expand Down Expand Up @@ -9159,7 +9159,7 @@ var devToolsConfig$jscomp$inline_1023 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-canary-1b271a1b",
version: "19.0.0-canary-f55d214e",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1213 = {
Expand Down Expand Up @@ -9190,7 +9190,7 @@ var internals$jscomp$inline_1213 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-1b271a1b"
reconcilerVersion: "19.0.0-canary-f55d214e"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1214 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -9216,7 +9216,7 @@ exports.create = function (element, options) {
null !== options &&
("function" === typeof options.createNodeMock &&
(createNodeMock = options.createNodeMock),
!0 === options.unstable_isConcurrent && (isConcurrent = !0),
(isConcurrent = options.unstable_isConcurrent),
!0 === options.unstable_strictMode && (isStrictMode = !0),
void 0 !== options.unstable_concurrentUpdatesByDefault &&
(concurrentUpdatesByDefault =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e79f3ae88518b14f6808a7938d5b3e84>>
* @generated SignedSource<<b2573824248edd9931bd15024b146aaa>>
*/

"use strict";
Expand Down Expand Up @@ -9585,7 +9585,7 @@ var devToolsConfig$jscomp$inline_1065 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-canary-a6321e7c",
version: "19.0.0-canary-cdabf445",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1254 = {
Expand Down Expand Up @@ -9616,7 +9616,7 @@ var internals$jscomp$inline_1254 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-a6321e7c"
reconcilerVersion: "19.0.0-canary-cdabf445"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1255 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -9642,7 +9642,7 @@ exports.create = function (element, options) {
null !== options &&
("function" === typeof options.createNodeMock &&
(createNodeMock = options.createNodeMock),
!0 === options.unstable_isConcurrent && (isConcurrent = !0),
(isConcurrent = options.unstable_isConcurrent),
!0 === options.unstable_strictMode && (isStrictMode = !0),
void 0 !== options.unstable_concurrentUpdatesByDefault &&
(concurrentUpdatesByDefault =
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
84c84d72f11ff1961a103b3cd59919876e48f759
bb66aa3cef4e42aee790200d03cf7a82659da121

0 comments on commit ab96eb3

Please sign in to comment.