Skip to content

Commit

Permalink
Remove allowConcurrentByDefault flag (#30445)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jackpope committed Jul 25, 2024
1 parent b7c63f3 commit 4609b0b
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 175 deletions.
2 changes: 1 addition & 1 deletion compiled-rn/VERSION_NATIVE_FB
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.0.0-native-fb-da4abf00-20240723
19.0.0-native-fb-14a4699f-20240725
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<57df8e4f7de7b472200a9ec4cd85a19a>>
* @generated SignedSource<<f9399cb065edf5442d1eee766d19ca1e>>
*/

"use strict";
__DEV__ &&
(function () {
function JSCompiler_object_inline_createNodeMock_1097() {
function JSCompiler_object_inline_createNodeMock_1096() {
return null;
}
function findHook(fiber, id) {
Expand Down Expand Up @@ -976,16 +976,6 @@ __DEV__ &&
root = root.pendingLanes & ~OffscreenLane;
return 0 !== root ? root : root & OffscreenLane ? OffscreenLane : 0;
}
function includesBlockingLane(root, lanes) {
return 0 !== (root.current.mode & 32)
? !1
: 0 !==
(lanes &
(InputContinuousHydrationLane |
InputContinuousLane |
DefaultHydrationLane |
DefaultLane));
}
function claimNextTransitionLane() {
var lane = nextTransitionLane;
nextTransitionLane <<= 1;
Expand Down Expand Up @@ -4117,12 +4107,16 @@ __DEV__ &&
),
(didWarnUncachedGetSnapshot = !0));
}
cachedSnapshot = workInProgressRoot;
if (null === cachedSnapshot)
if (null === workInProgressRoot)
throw Error(
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
);
includesBlockingLane(cachedSnapshot, workInProgressRootRenderLanes) ||
0 !==
(workInProgressRootRenderLanes &
(InputContinuousHydrationLane |
InputContinuousLane |
DefaultHydrationLane |
DefaultLane)) ||
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
hook.memoizedState = nextSnapshot;
cachedSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot };
Expand Down Expand Up @@ -4187,12 +4181,16 @@ __DEV__ &&
{ destroy: void 0 },
null
);
subscribe = workInProgressRoot;
if (null === subscribe)
if (null === workInProgressRoot)
throw Error(
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
);
includesBlockingLane(subscribe, renderLanes) ||
0 !==
(renderLanes &
(InputContinuousHydrationLane |
InputContinuousLane |
DefaultHydrationLane |
DefaultLane)) ||
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
}
return nextSnapshot;
Expand Down Expand Up @@ -10611,7 +10609,12 @@ __DEV__ &&
);
if (0 === lanes) return null;
var shouldTimeSlice =
!includesBlockingLane(root, lanes) &&
0 ===
(lanes &
(InputContinuousHydrationLane |
InputContinuousLane |
DefaultHydrationLane |
DefaultLane)) &&
0 === (lanes & root.expiredLanes) &&
!didTimeout;
didTimeout = shouldTimeSlice
Expand Down Expand Up @@ -10973,9 +10976,7 @@ __DEV__ &&
workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors =
null;
workInProgressRootDidIncludeRecursiveRenderUpdate = !1;
0 === (root.current.mode & 32) &&
0 !== (lanes & InputContinuousLane) &&
(lanes |= lanes & DefaultLane);
0 !== (lanes & InputContinuousLane) && (lanes |= lanes & DefaultLane);
var allEntangledLanes = root.entangledLanes;
if (0 !== allEntangledLanes)
for (
Expand Down Expand Up @@ -12712,23 +12713,19 @@ __DEV__ &&
onRecoverableError,
null
);
1 === tag
? ((tag = 1),
!0 === isStrictMode && (tag |= 24),
concurrentUpdatesByDefaultOverride && (tag |= 32))
: (tag = 0);
1 === tag ? ((tag = 1), !0 === isStrictMode && (tag |= 24)) : (tag = 0);
isDevToolsPresent && (tag |= 2);
isStrictMode = createFiber(3, null, null, tag);
containerInfo.current = isStrictMode;
isStrictMode.stateNode = containerInfo;
concurrentUpdatesByDefaultOverride = createCache();
retainCache(concurrentUpdatesByDefaultOverride);
containerInfo.pooledCache = concurrentUpdatesByDefaultOverride;
retainCache(concurrentUpdatesByDefaultOverride);
tag = createCache();
retainCache(tag);
containerInfo.pooledCache = tag;
retainCache(tag);
isStrictMode.memoizedState = {
element: null,
isDehydrated: !1,
cache: concurrentUpdatesByDefaultOverride
cache: tag
};
initializeUpdateQueue(isStrictMode);
return containerInfo;
Expand Down Expand Up @@ -15120,32 +15117,28 @@ __DEV__ &&
scheduleRoot: scheduleRoot,
setRefreshHandler: setRefreshHandler,
getCurrentFiber: getCurrentFiberForDevTools,
reconcilerVersion: "19.0.0-native-fb-da4abf00-20240723"
reconcilerVersion: "19.0.0-native-fb-14a4699f-20240725"
});
})({
findFiberByHostInstance: function () {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 1,
version: "19.0.0-native-fb-da4abf00-20240723",
version: "19.0.0-native-fb-14a4699f-20240725",
rendererPackageName: "react-test-renderer"
});
exports._Scheduler = Scheduler;
exports.act = act;
exports.create = function (element, options) {
var createNodeMock = JSCompiler_object_inline_createNodeMock_1097,
var createNodeMock = JSCompiler_object_inline_createNodeMock_1096,
isConcurrent = !1,
isStrictMode = !1,
concurrentUpdatesByDefault = null;
isStrictMode = !1;
"object" === typeof options &&
null !== options &&
("function" === typeof options.createNodeMock &&
(createNodeMock = options.createNodeMock),
(isConcurrent = options.unstable_isConcurrent),
!0 === options.unstable_strictMode && (isStrictMode = !0),
void 0 !== options.unstable_concurrentUpdatesByDefault &&
(concurrentUpdatesByDefault =
options.unstable_concurrentUpdatesByDefault));
!0 === options.unstable_strictMode && (isStrictMode = !0));
var container = {
children: [],
createNodeMock: createNodeMock,
Expand All @@ -15156,7 +15149,7 @@ __DEV__ &&
isConcurrent ? 1 : 0,
null,
isStrictMode,
concurrentUpdatesByDefault,
!1,
"",
defaultOnUncaughtError,
defaultOnCaughtError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<77ef7f9c50bfdc1ebd871ef8296a1aae>>
* @generated SignedSource<<eeda2335f11ef85ccbd49c18671110ee>>
*/

"use strict";
Expand Down Expand Up @@ -618,9 +618,6 @@ function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) {
root = root.pendingLanes & -536870913;
return 0 !== root ? root : root & 536870912 ? 536870912 : 0;
}
function includesBlockingLane(root, lanes) {
return 0 !== (root.current.mode & 32) ? !1 : 0 !== (lanes & 60);
}
function claimNextTransitionLane() {
var lane = nextTransitionLane;
nextTransitionLane <<= 1;
Expand Down Expand Up @@ -2706,12 +2703,11 @@ function updateSyncExternalStore(subscribe, getSnapshot) {
{ destroy: void 0 },
null
);
subscribe = workInProgressRoot;
if (null === subscribe)
if (null === workInProgressRoot)
throw Error(
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
);
includesBlockingLane(subscribe, renderLanes) ||
0 !== (renderLanes & 60) ||
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
}
return nextSnapshot;
Expand Down Expand Up @@ -3375,23 +3371,22 @@ var HooksDispatcherOnMount = {
var fiber = currentlyRenderingFiber$1,
hook = mountWorkInProgressHook();
var nextSnapshot = getSnapshot();
var root = workInProgressRoot;
if (null === root)
if (null === workInProgressRoot)
throw Error(
"Expected a work-in-progress root. This is a bug in React. Please file an issue."
);
includesBlockingLane(root, workInProgressRootRenderLanes) ||
0 !== (workInProgressRootRenderLanes & 60) ||
pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot);
hook.memoizedState = nextSnapshot;
root = { value: nextSnapshot, getSnapshot: getSnapshot };
hook.queue = root;
mountEffect(subscribeToStore.bind(null, fiber, root, subscribe), [
var inst = { value: nextSnapshot, getSnapshot: getSnapshot };
hook.queue = inst;
mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [
subscribe
]);
fiber.flags |= 2048;
pushEffect(
9,
updateStoreInstance.bind(null, fiber, root, nextSnapshot, getSnapshot),
updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot),
{ destroy: void 0 },
null
);
Expand Down Expand Up @@ -7643,9 +7638,7 @@ function performConcurrentWorkOnRoot(root, didTimeout) {
);
if (0 === lanes) return null;
var exitStatus = (didTimeout =
!includesBlockingLane(root, lanes) &&
0 === (lanes & root.expiredLanes) &&
!didTimeout)
0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout)
? renderRootConcurrent(root, lanes)
: renderRootSync(root, lanes);
if (0 !== exitStatus) {
Expand Down Expand Up @@ -7976,7 +7969,7 @@ function prepareFreshStack(root, lanes) {
workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors =
null;
workInProgressRootDidIncludeRecursiveRenderUpdate = !1;
0 === (root.current.mode & 32) && 0 !== (lanes & 8) && (lanes |= lanes & 32);
0 !== (lanes & 8) && (lanes |= lanes & 32);
var allEntangledLanes = root.entangledLanes;
if (0 !== allEntangledLanes)
for (
Expand Down Expand Up @@ -8959,23 +8952,15 @@ function createContainer(
onRecoverableError,
null
);
1 === tag
? ((tag = 1),
!0 === isStrictMode && (tag |= 24),
concurrentUpdatesByDefaultOverride && (tag |= 32))
: (tag = 0);
1 === tag ? ((tag = 1), !0 === isStrictMode && (tag |= 24)) : (tag = 0);
isStrictMode = createFiberImplClass(3, null, null, tag);
containerInfo.current = isStrictMode;
isStrictMode.stateNode = containerInfo;
concurrentUpdatesByDefaultOverride = createCache();
concurrentUpdatesByDefaultOverride.refCount++;
containerInfo.pooledCache = concurrentUpdatesByDefaultOverride;
concurrentUpdatesByDefaultOverride.refCount++;
isStrictMode.memoizedState = {
element: null,
isDehydrated: !1,
cache: concurrentUpdatesByDefaultOverride
};
tag = createCache();
tag.refCount++;
containerInfo.pooledCache = tag;
tag.refCount++;
isStrictMode.memoizedState = { element: null, isDehydrated: !1, cache: tag };
initializeUpdateQueue(isStrictMode);
return containerInfo;
}
Expand Down Expand Up @@ -9338,19 +9323,19 @@ function wrapFiber(fiber) {
fiberToWrapper.set(fiber, wrapper));
return wrapper;
}
var devToolsConfig$jscomp$inline_1036 = {
var devToolsConfig$jscomp$inline_1035 = {
findFiberByHostInstance: function () {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-native-fb-da4abf00-20240723",
version: "19.0.0-native-fb-14a4699f-20240725",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1213 = {
bundleType: devToolsConfig$jscomp$inline_1036.bundleType,
version: devToolsConfig$jscomp$inline_1036.version,
rendererPackageName: devToolsConfig$jscomp$inline_1036.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1036.rendererConfig,
var internals$jscomp$inline_1211 = {
bundleType: devToolsConfig$jscomp$inline_1035.bundleType,
version: devToolsConfig$jscomp$inline_1035.version,
rendererPackageName: devToolsConfig$jscomp$inline_1035.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1035.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
Expand All @@ -9367,44 +9352,40 @@ var internals$jscomp$inline_1213 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1036.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1035.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-native-fb-da4abf00-20240723"
reconcilerVersion: "19.0.0-native-fb-14a4699f-20240725"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1214 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1212 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1214.isDisabled &&
hook$jscomp$inline_1214.supportsFiber
!hook$jscomp$inline_1212.isDisabled &&
hook$jscomp$inline_1212.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1214.inject(
internals$jscomp$inline_1213
(rendererID = hook$jscomp$inline_1212.inject(
internals$jscomp$inline_1211
)),
(injectedHook = hook$jscomp$inline_1214);
(injectedHook = hook$jscomp$inline_1212);
} catch (err) {}
}
exports._Scheduler = Scheduler;
exports.act = act;
exports.create = function (element, options) {
var createNodeMock = defaultTestOptions.createNodeMock,
isConcurrent = !1,
isStrictMode = !1,
concurrentUpdatesByDefault = null;
isStrictMode = !1;
"object" === typeof options &&
null !== options &&
("function" === typeof options.createNodeMock &&
(createNodeMock = options.createNodeMock),
(isConcurrent = options.unstable_isConcurrent),
!0 === options.unstable_strictMode && (isStrictMode = !0),
void 0 !== options.unstable_concurrentUpdatesByDefault &&
(concurrentUpdatesByDefault =
options.unstable_concurrentUpdatesByDefault));
!0 === options.unstable_strictMode && (isStrictMode = !0));
var container = {
children: [],
createNodeMock: createNodeMock,
Expand All @@ -9415,7 +9396,7 @@ exports.create = function (element, options) {
isConcurrent ? 1 : 0,
null,
isStrictMode,
concurrentUpdatesByDefault,
!1,
"",
defaultOnUncaughtError,
defaultOnCaughtError,
Expand Down
Loading

0 comments on commit 4609b0b

Please sign in to comment.