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 [bb66aa3](bb66aa3)
  • Loading branch information
jackpope committed Mar 26, 2024
1 parent 71cc6ab commit 34ee899
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
84c84d72f11ff1961a103b3cd59919876e48f759
bb66aa3cef4e42aee790200d03cf7a82659da121
10 changes: 6 additions & 4 deletions compiled/facebook-www/ReactTestRenderer-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ if (__DEV__) {
var enableLegacyHidden = false;
var enableAsyncActions = true;
var alwaysThrottleRetries = true;
var disableLegacyMode = false;

var FunctionComponent = 0;
var ClassComponent = 1;
Expand Down Expand Up @@ -26108,7 +26109,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-www-classic-4c1f5e46";
var ReactVersion = "19.0.0-www-classic-ac0f08bc";

// Might add PROFILE later.

Expand Down Expand Up @@ -27002,7 +27003,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 @@ -27012,8 +27014,8 @@ if (__DEV__) {
createNodeMock = options.createNodeMock;
}

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

if (options.unstable_strictMode === true) {
Expand Down
10 changes: 6 additions & 4 deletions compiled/facebook-www/ReactTestRenderer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ if (__DEV__) {
var enableLegacyHidden = false;
var enableAsyncActions = true;
var alwaysThrottleRetries = true;
var disableLegacyMode = false;

var FunctionComponent = 0;
var ClassComponent = 1;
Expand Down Expand Up @@ -26108,7 +26109,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-www-modern-4c1f5e46";
var ReactVersion = "19.0.0-www-modern-ac0f08bc";

// Might add PROFILE later.

Expand Down Expand Up @@ -27002,7 +27003,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 @@ -27012,8 +27014,8 @@ if (__DEV__) {
createNodeMock = options.createNodeMock;
}

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

if (options.unstable_strictMode === true) {
Expand Down

0 comments on commit 34ee899

Please sign in to comment.