Skip to content

Commit 4609b0b

Browse files
committed
Remove allowConcurrentByDefault flag (#30445)
Following #30436 Concurrent by default strategy has been unshipped. Here we clean up the `allowConcurrentByDefault` path and related logic/tests. For now, this keeps the `concurrentUpdatesByDefaultOverride` argument in `createContainer` and `createHydrationContainer` and ignores the value to prevent more breaking changes to `react-reconciler` in the RC stage. DiffTrain build for commit 14a4699.
1 parent b7c63f3 commit 4609b0b

File tree

14 files changed

+130
-175
lines changed

14 files changed

+130
-175
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.0.0-native-fb-da4abf00-20240723
1+
19.0.0-native-fb-14a4699f-20240725

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<57df8e4f7de7b472200a9ec4cd85a19a>>
10+
* @generated SignedSource<<f9399cb065edf5442d1eee766d19ca1e>>
1111
*/
1212

1313
"use strict";
1414
__DEV__ &&
1515
(function () {
16-
function JSCompiler_object_inline_createNodeMock_1097() {
16+
function JSCompiler_object_inline_createNodeMock_1096() {
1717
return null;
1818
}
1919
function findHook(fiber, id) {
@@ -976,16 +976,6 @@ __DEV__ &&
976976
root = root.pendingLanes & ~OffscreenLane;
977977
return 0 !== root ? root : root & OffscreenLane ? OffscreenLane : 0;
978978
}
979-
function includesBlockingLane(root, lanes) {
980-
return 0 !== (root.current.mode & 32)
981-
? !1
982-
: 0 !==
983-
(lanes &
984-
(InputContinuousHydrationLane |
985-
InputContinuousLane |
986-
DefaultHydrationLane |
987-
DefaultLane));
988-
}
989979
function claimNextTransitionLane() {
990980
var lane = nextTransitionLane;
991981
nextTransitionLane <<= 1;
@@ -4117,12 +4107,16 @@ __DEV__ &&
41174107
),
41184108
(didWarnUncachedGetSnapshot = !0));
41194109
}
4120-
cachedSnapshot = workInProgressRoot;
4121-
if (null === cachedSnapshot)
4110+
if (null === workInProgressRoot)
41224111
throw Error(
41234112
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
41244113
);
4125-
includesBlockingLane(cachedSnapshot, workInProgressRootRenderLanes) ||
4114+
0 !==
4115+
(workInProgressRootRenderLanes &
4116+
(InputContinuousHydrationLane |
4117+
InputContinuousLane |
4118+
DefaultHydrationLane |
4119+
DefaultLane)) ||
41264120
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
41274121
hook.memoizedState = nextSnapshot;
41284122
cachedSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot };
@@ -4187,12 +4181,16 @@ __DEV__ &&
41874181
{ destroy: void 0 },
41884182
null
41894183
);
4190-
subscribe = workInProgressRoot;
4191-
if (null === subscribe)
4184+
if (null === workInProgressRoot)
41924185
throw Error(
41934186
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
41944187
);
4195-
includesBlockingLane(subscribe, renderLanes) ||
4188+
0 !==
4189+
(renderLanes &
4190+
(InputContinuousHydrationLane |
4191+
InputContinuousLane |
4192+
DefaultHydrationLane |
4193+
DefaultLane)) ||
41964194
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
41974195
}
41984196
return nextSnapshot;
@@ -10611,7 +10609,12 @@ __DEV__ &&
1061110609
);
1061210610
if (0 === lanes) return null;
1061310611
var shouldTimeSlice =
10614-
!includesBlockingLane(root, lanes) &&
10612+
0 ===
10613+
(lanes &
10614+
(InputContinuousHydrationLane |
10615+
InputContinuousLane |
10616+
DefaultHydrationLane |
10617+
DefaultLane)) &&
1061510618
0 === (lanes & root.expiredLanes) &&
1061610619
!didTimeout;
1061710620
didTimeout = shouldTimeSlice
@@ -10973,9 +10976,7 @@ __DEV__ &&
1097310976
workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors =
1097410977
null;
1097510978
workInProgressRootDidIncludeRecursiveRenderUpdate = !1;
10976-
0 === (root.current.mode & 32) &&
10977-
0 !== (lanes & InputContinuousLane) &&
10978-
(lanes |= lanes & DefaultLane);
10979+
0 !== (lanes & InputContinuousLane) && (lanes |= lanes & DefaultLane);
1097910980
var allEntangledLanes = root.entangledLanes;
1098010981
if (0 !== allEntangledLanes)
1098110982
for (
@@ -12712,23 +12713,19 @@ __DEV__ &&
1271212713
onRecoverableError,
1271312714
null
1271412715
);
12715-
1 === tag
12716-
? ((tag = 1),
12717-
!0 === isStrictMode && (tag |= 24),
12718-
concurrentUpdatesByDefaultOverride && (tag |= 32))
12719-
: (tag = 0);
12716+
1 === tag ? ((tag = 1), !0 === isStrictMode && (tag |= 24)) : (tag = 0);
1272012717
isDevToolsPresent && (tag |= 2);
1272112718
isStrictMode = createFiber(3, null, null, tag);
1272212719
containerInfo.current = isStrictMode;
1272312720
isStrictMode.stateNode = containerInfo;
12724-
concurrentUpdatesByDefaultOverride = createCache();
12725-
retainCache(concurrentUpdatesByDefaultOverride);
12726-
containerInfo.pooledCache = concurrentUpdatesByDefaultOverride;
12727-
retainCache(concurrentUpdatesByDefaultOverride);
12721+
tag = createCache();
12722+
retainCache(tag);
12723+
containerInfo.pooledCache = tag;
12724+
retainCache(tag);
1272812725
isStrictMode.memoizedState = {
1272912726
element: null,
1273012727
isDehydrated: !1,
12731-
cache: concurrentUpdatesByDefaultOverride
12728+
cache: tag
1273212729
};
1273312730
initializeUpdateQueue(isStrictMode);
1273412731
return containerInfo;
@@ -15120,32 +15117,28 @@ __DEV__ &&
1512015117
scheduleRoot: scheduleRoot,
1512115118
setRefreshHandler: setRefreshHandler,
1512215119
getCurrentFiber: getCurrentFiberForDevTools,
15123-
reconcilerVersion: "19.0.0-native-fb-da4abf00-20240723"
15120+
reconcilerVersion: "19.0.0-native-fb-14a4699f-20240725"
1512415121
});
1512515122
})({
1512615123
findFiberByHostInstance: function () {
1512715124
throw Error("TestRenderer does not support findFiberByHostInstance()");
1512815125
},
1512915126
bundleType: 1,
15130-
version: "19.0.0-native-fb-da4abf00-20240723",
15127+
version: "19.0.0-native-fb-14a4699f-20240725",
1513115128
rendererPackageName: "react-test-renderer"
1513215129
});
1513315130
exports._Scheduler = Scheduler;
1513415131
exports.act = act;
1513515132
exports.create = function (element, options) {
15136-
var createNodeMock = JSCompiler_object_inline_createNodeMock_1097,
15133+
var createNodeMock = JSCompiler_object_inline_createNodeMock_1096,
1513715134
isConcurrent = !1,
15138-
isStrictMode = !1,
15139-
concurrentUpdatesByDefault = null;
15135+
isStrictMode = !1;
1514015136
"object" === typeof options &&
1514115137
null !== options &&
1514215138
("function" === typeof options.createNodeMock &&
1514315139
(createNodeMock = options.createNodeMock),
1514415140
(isConcurrent = options.unstable_isConcurrent),
15145-
!0 === options.unstable_strictMode && (isStrictMode = !0),
15146-
void 0 !== options.unstable_concurrentUpdatesByDefault &&
15147-
(concurrentUpdatesByDefault =
15148-
options.unstable_concurrentUpdatesByDefault));
15141+
!0 === options.unstable_strictMode && (isStrictMode = !0));
1514915142
var container = {
1515015143
children: [],
1515115144
createNodeMock: createNodeMock,
@@ -15156,7 +15149,7 @@ __DEV__ &&
1515615149
isConcurrent ? 1 : 0,
1515715150
null,
1515815151
isStrictMode,
15159-
concurrentUpdatesByDefault,
15152+
!1,
1516015153
"",
1516115154
defaultOnUncaughtError,
1516215155
defaultOnCaughtError,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 35 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<77ef7f9c50bfdc1ebd871ef8296a1aae>>
10+
* @generated SignedSource<<eeda2335f11ef85ccbd49c18671110ee>>
1111
*/
1212

1313
"use strict";
@@ -618,9 +618,6 @@ function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) {
618618
root = root.pendingLanes & -536870913;
619619
return 0 !== root ? root : root & 536870912 ? 536870912 : 0;
620620
}
621-
function includesBlockingLane(root, lanes) {
622-
return 0 !== (root.current.mode & 32) ? !1 : 0 !== (lanes & 60);
623-
}
624621
function claimNextTransitionLane() {
625622
var lane = nextTransitionLane;
626623
nextTransitionLane <<= 1;
@@ -2706,12 +2703,11 @@ function updateSyncExternalStore(subscribe, getSnapshot) {
27062703
{ destroy: void 0 },
27072704
null
27082705
);
2709-
subscribe = workInProgressRoot;
2710-
if (null === subscribe)
2706+
if (null === workInProgressRoot)
27112707
throw Error(
27122708
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
27132709
);
2714-
includesBlockingLane(subscribe, renderLanes) ||
2710+
0 !== (renderLanes & 60) ||
27152711
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
27162712
}
27172713
return nextSnapshot;
@@ -3375,23 +3371,22 @@ var HooksDispatcherOnMount = {
33753371
var fiber = currentlyRenderingFiber$1,
33763372
hook = mountWorkInProgressHook();
33773373
var nextSnapshot = getSnapshot();
3378-
var root = workInProgressRoot;
3379-
if (null === root)
3374+
if (null === workInProgressRoot)
33803375
throw Error(
33813376
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
33823377
);
3383-
includesBlockingLane(root, workInProgressRootRenderLanes) ||
3378+
0 !== (workInProgressRootRenderLanes & 60) ||
33843379
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
33853380
hook.memoizedState = nextSnapshot;
3386-
root = { value: nextSnapshot, getSnapshot: getSnapshot };
3387-
hook.queue = root;
3388-
mountEffect(subscribeToStore.bind(null, fiber, root, subscribe), [
3381+
var inst = { value: nextSnapshot, getSnapshot: getSnapshot };
3382+
hook.queue = inst;
3383+
mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
33893384
subscribe
33903385
]);
33913386
fiber.flags |= 2048;
33923387
pushEffect(
33933388
9,
3394-
updateStoreInstance.bind(null, fiber, root, nextSnapshot, getSnapshot),
3389+
updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot),
33953390
{ destroy: void 0 },
33963391
null
33973392
);
@@ -7643,9 +7638,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
76437638
);
76447639
if (0 === lanes) return null;
76457640
var exitStatus = (didTimeout =
7646-
!includesBlockingLane(root, lanes) &&
7647-
0 === (lanes & root.expiredLanes) &&
7648-
!didTimeout)
7641+
0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout)
76497642
? renderRootConcurrent(root, lanes)
76507643
: renderRootSync(root, lanes);
76517644
if (0 !== exitStatus) {
@@ -7976,7 +7969,7 @@ function prepareFreshStack(root, lanes) {
79767969
workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors =
79777970
null;
79787971
workInProgressRootDidIncludeRecursiveRenderUpdate = !1;
7979-
0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32);
7972+
0 !== (lanes & 8) && (lanes |= lanes & 32);
79807973
var allEntangledLanes = root.entangledLanes;
79817974
if (0 !== allEntangledLanes)
79827975
for (
@@ -8959,23 +8952,15 @@ function createContainer(
89598952
onRecoverableError,
89608953
null
89618954
);
8962-
1 === tag
8963-
? ((tag = 1),
8964-
!0 === isStrictMode && (tag |= 24),
8965-
concurrentUpdatesByDefaultOverride && (tag |= 32))
8966-
: (tag = 0);
8955+
1 === tag ? ((tag = 1), !0 === isStrictMode && (tag |= 24)) : (tag = 0);
89678956
isStrictMode = createFiberImplClass(3, null, null, tag);
89688957
containerInfo.current = isStrictMode;
89698958
isStrictMode.stateNode = containerInfo;
8970-
concurrentUpdatesByDefaultOverride = createCache();
8971-
concurrentUpdatesByDefaultOverride.refCount++;
8972-
containerInfo.pooledCache = concurrentUpdatesByDefaultOverride;
8973-
concurrentUpdatesByDefaultOverride.refCount++;
8974-
isStrictMode.memoizedState = {
8975-
element: null,
8976-
isDehydrated: !1,
8977-
cache: concurrentUpdatesByDefaultOverride
8978-
};
8959+
tag = createCache();
8960+
tag.refCount++;
8961+
containerInfo.pooledCache = tag;
8962+
tag.refCount++;
8963+
isStrictMode.memoizedState = { element: null, isDehydrated: !1, cache: tag };
89798964
initializeUpdateQueue(isStrictMode);
89808965
return containerInfo;
89818966
}
@@ -9338,19 +9323,19 @@ function wrapFiber(fiber) {
93389323
fiberToWrapper.set(fiber, wrapper));
93399324
return wrapper;
93409325
}
9341-
var devToolsConfig$jscomp$inline_1036 = {
9326+
var devToolsConfig$jscomp$inline_1035 = {
93429327
findFiberByHostInstance: function () {
93439328
throw Error("TestRenderer does not support findFiberByHostInstance()");
93449329
},
93459330
bundleType: 0,
9346-
version: "19.0.0-native-fb-da4abf00-20240723",
9331+
version: "19.0.0-native-fb-14a4699f-20240725",
93479332
rendererPackageName: "react-test-renderer"
93489333
};
9349-
var internals$jscomp$inline_1213 = {
9350-
bundleType: devToolsConfig$jscomp$inline_1036.bundleType,
9351-
version: devToolsConfig$jscomp$inline_1036.version,
9352-
rendererPackageName: devToolsConfig$jscomp$inline_1036.rendererPackageName,
9353-
rendererConfig: devToolsConfig$jscomp$inline_1036.rendererConfig,
9334+
var internals$jscomp$inline_1211 = {
9335+
bundleType: devToolsConfig$jscomp$inline_1035.bundleType,
9336+
version: devToolsConfig$jscomp$inline_1035.version,
9337+
rendererPackageName: devToolsConfig$jscomp$inline_1035.rendererPackageName,
9338+
rendererConfig: devToolsConfig$jscomp$inline_1035.rendererConfig,
93549339
overrideHookState: null,
93559340
overrideHookStateDeletePath: null,
93569341
overrideHookStateRenamePath: null,
@@ -9367,44 +9352,40 @@ var internals$jscomp$inline_1213 = {
93679352
return null === fiber ? null : fiber.stateNode;
93689353
},
93699354
findFiberByHostInstance:
9370-
devToolsConfig$jscomp$inline_1036.findFiberByHostInstance ||
9355+
devToolsConfig$jscomp$inline_1035.findFiberByHostInstance ||
93719356
emptyFindFiberByHostInstance,
93729357
findHostInstancesForRefresh: null,
93739358
scheduleRefresh: null,
93749359
scheduleRoot: null,
93759360
setRefreshHandler: null,
93769361
getCurrentFiber: null,
9377-
reconcilerVersion: "19.0.0-native-fb-da4abf00-20240723"
9362+
reconcilerVersion: "19.0.0-native-fb-14a4699f-20240725"
93789363
};
93799364
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
9380-
var hook$jscomp$inline_1214 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
9365+
var hook$jscomp$inline_1212 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
93819366
if (
9382-
!hook$jscomp$inline_1214.isDisabled &&
9383-
hook$jscomp$inline_1214.supportsFiber
9367+
!hook$jscomp$inline_1212.isDisabled &&
9368+
hook$jscomp$inline_1212.supportsFiber
93849369
)
93859370
try {
9386-
(rendererID = hook$jscomp$inline_1214.inject(
9387-
internals$jscomp$inline_1213
9371+
(rendererID = hook$jscomp$inline_1212.inject(
9372+
internals$jscomp$inline_1211
93889373
)),
9389-
(injectedHook = hook$jscomp$inline_1214);
9374+
(injectedHook = hook$jscomp$inline_1212);
93909375
} catch (err) {}
93919376
}
93929377
exports._Scheduler = Scheduler;
93939378
exports.act = act;
93949379
exports.create = function (element, options) {
93959380
var createNodeMock = defaultTestOptions.createNodeMock,
93969381
isConcurrent = !1,
9397-
isStrictMode = !1,
9398-
concurrentUpdatesByDefault = null;
9382+
isStrictMode = !1;
93999383
"object" === typeof options &&
94009384
null !== options &&
94019385
("function" === typeof options.createNodeMock &&
94029386
(createNodeMock = options.createNodeMock),
94039387
(isConcurrent = options.unstable_isConcurrent),
9404-
!0 === options.unstable_strictMode && (isStrictMode = !0),
9405-
void 0 !== options.unstable_concurrentUpdatesByDefault &&
9406-
(concurrentUpdatesByDefault =
9407-
options.unstable_concurrentUpdatesByDefault));
9388+
!0 === options.unstable_strictMode && (isStrictMode = !0));
94089389
var container = {
94099390
children: [],
94109391
createNodeMock: createNodeMock,
@@ -9415,7 +9396,7 @@ exports.create = function (element, options) {
94159396
isConcurrent ? 1 : 0,
94169397
null,
94179398
isStrictMode,
9418-
concurrentUpdatesByDefault,
9399+
!1,
94199400
"",
94209401
defaultOnUncaughtError,
94219402
defaultOnCaughtError,

0 commit comments

Comments
 (0)