Skip to content

Commit

Permalink
[RN] Move unifiedSyncLane back to dynamic (#28430)
Browse files Browse the repository at this point in the history
This surfaced a bug because it wasn't on everywhere, moving back to
dynamic while we investigate the bug

DiffTrain build for commit 98b8359.
  • Loading branch information
sammy-SC committed Feb 23, 2024
1 parent 8136b16 commit 6fb4d0d
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25707,7 +25707,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-aaa4acb12-20240222";
var ReactVersion = "18.3.0-canary-98b8359f6-20240223";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9171,7 +9171,7 @@ var devToolsConfig$jscomp$inline_1014 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-aaa4acb12-20240222",
version: "18.3.0-canary-98b8359f6-20240223",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1195 = {
Expand Down Expand Up @@ -9202,7 +9202,7 @@ var internals$jscomp$inline_1195 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-aaa4acb12-20240222"
reconcilerVersion: "18.3.0-canary-98b8359f6-20240223"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1196 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9599,7 +9599,7 @@ var devToolsConfig$jscomp$inline_1056 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-aaa4acb12-20240222",
version: "18.3.0-canary-98b8359f6-20240223",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1236 = {
Expand Down Expand Up @@ -9630,7 +9630,7 @@ var internals$jscomp$inline_1236 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-aaa4acb12-20240222"
reconcilerVersion: "18.3.0-canary-98b8359f6-20240223"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1237 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (__DEV__) {
}
var dynamicFlags = require("ReactNativeInternalFeatureFlags");

var ReactVersion = "18.3.0-canary-aaa4acb12-20240222";
var ReactVersion = "18.3.0-canary-98b8359f6-20240223";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,4 +600,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-aaa4acb12-20240222";
exports.version = "18.3.0-canary-98b8359f6-20240223";
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-aaa4acb12-20240222";
exports.version = "18.3.0-canary-98b8359f6-20240223";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aaa4acb1280fcda398defb805db47a8623df6c0f
98b8359f656ef714cc44828d7bfd2409ca16b9b3
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<bf21f6d72f3518f207e57e11607507ed>>
* @generated SignedSource<<4c526192e135ce4617cc964ef360f7e3>>
*/

"use strict";
Expand Down Expand Up @@ -3241,7 +3241,8 @@ to return true:wantsResponderID| |
passChildrenWhenCloningPersistedNodes =
dynamicFlags.passChildrenWhenCloningPersistedNodes,
useMicrotasksForSchedulingInFabric =
dynamicFlags.useMicrotasksForSchedulingInFabric; // The rest of the flags are static for better dead code elimination.
dynamicFlags.useMicrotasksForSchedulingInFabric,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane; // The rest of the flags are static for better dead code elimination.
var enableSchedulingProfiler = true;
var enableProfilerTimer = true;
var enableProfilerCommitHooks = true;
Expand Down Expand Up @@ -4005,7 +4006,9 @@ to return true:wantsResponderID| |
var DefaultLane =
/* */
32;
var SyncUpdateLanes = SyncLane | InputContinuousLane | DefaultLane;
var SyncUpdateLanes = enableUnifiedSyncLane
? SyncLane | InputContinuousLane | DefaultLane
: SyncLane;
var TransitionHydrationLane =
/* */
64;
Expand Down Expand Up @@ -4161,7 +4164,7 @@ to return true:wantsResponderID| |
var nextRetryLane = RetryLane1;

function getHighestPriorityLanes(lanes) {
{
if (enableUnifiedSyncLane) {
var pendingSyncLanes = lanes & SyncUpdateLanes;

if (pendingSyncLanes !== 0) {
Expand Down Expand Up @@ -4761,7 +4764,7 @@ to return true:wantsResponderID| |
var renderLane = getHighestPriorityLane(renderLanes);
var lane;

if ((renderLane & SyncUpdateLanes) !== NoLane) {
if (enableUnifiedSyncLane && (renderLane & SyncUpdateLanes) !== NoLane) {
lane = SyncHydrationLane;
} else {
switch (renderLane) {
Expand Down Expand Up @@ -28015,7 +28018,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "18.3.0-canary-2e1e0d6f";
var ReactVersion = "18.3.0-canary-0435735f";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2a3d0aa946faed7a858417c14fa324c6>>
* @generated SignedSource<<743b9976cf9cb1022780b5808cc05a13>>
*/

"use strict";
Expand Down Expand Up @@ -1323,6 +1323,7 @@ var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
dynamicFlags.passChildrenWhenCloningPersistedNodes,
useMicrotasksForSchedulingInFabric =
dynamicFlags.useMicrotasksForSchedulingInFabric,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane,
scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
cancelCallback$1 = Scheduler.unstable_cancelCallback,
shouldYield = Scheduler.unstable_shouldYield,
Expand Down Expand Up @@ -1354,11 +1355,14 @@ function clz32Fallback(x) {
x >>>= 0;
return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0;
}
var nextTransitionLane = 128,
var SyncUpdateLanes = enableUnifiedSyncLane ? 42 : 2,
nextTransitionLane = 128,
nextRetryLane = 4194304;
function getHighestPriorityLanes(lanes) {
var pendingSyncLanes = lanes & 42;
if (0 !== pendingSyncLanes) return pendingSyncLanes;
if (enableUnifiedSyncLane) {
var pendingSyncLanes = lanes & SyncUpdateLanes;
if (0 !== pendingSyncLanes) return pendingSyncLanes;
}
switch (lanes & -lanes) {
case 1:
return 1;
Expand Down Expand Up @@ -5754,7 +5758,8 @@ function updateDehydratedSuspenseComponent(
didPrimaryChildrenDefer = workInProgressRoot;
if (null !== didPrimaryChildrenDefer) {
nextProps = renderLanes & -renderLanes;
if (0 !== (nextProps & 42)) nextProps = 1;
if (enableUnifiedSyncLane && 0 !== (nextProps & SyncUpdateLanes))
nextProps = 1;
else
switch (nextProps) {
case 2:
Expand Down Expand Up @@ -8598,7 +8603,7 @@ function commitRootImpl(
0 !== root.tag &&
flushPassiveEffects();
remainingLanes = root.pendingLanes;
0 !== (transitions & 4194218) && 0 !== (remainingLanes & 42)
0 !== (transitions & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes)
? root === rootWithNestedUpdates
? nestedUpdateCount++
: ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))
Expand Down Expand Up @@ -9687,7 +9692,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1069 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-canary-b37c113f",
version: "18.3.0-canary-06019910",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -9730,7 +9735,7 @@ var internals$jscomp$inline_1294 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-b37c113f"
reconcilerVersion: "18.3.0-canary-06019910"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1295 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<228fd7bab3210ea9b41049c42925b98a>>
* @generated SignedSource<<bfa7c893ceec829541615729b8d25246>>
*/

"use strict";
Expand Down Expand Up @@ -1327,6 +1327,7 @@ var alwaysThrottleRetries = dynamicFlags.alwaysThrottleRetries,
dynamicFlags.passChildrenWhenCloningPersistedNodes,
useMicrotasksForSchedulingInFabric =
dynamicFlags.useMicrotasksForSchedulingInFabric,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane,
scheduleCallback$2 = Scheduler.unstable_scheduleCallback,
cancelCallback$1 = Scheduler.unstable_cancelCallback,
shouldYield = Scheduler.unstable_shouldYield,
Expand Down Expand Up @@ -1430,6 +1431,7 @@ function clz32Fallback(x) {
x >>>= 0;
return 0 === x ? 32 : (31 - ((log(x) / LN2) | 0)) | 0;
}
var SyncUpdateLanes = enableUnifiedSyncLane ? 42 : 2;
function getLabelForLane(lane) {
if (lane & 1) return "SyncHydrationLane";
if (lane & 2) return "Sync";
Expand All @@ -1449,8 +1451,10 @@ function getLabelForLane(lane) {
var nextTransitionLane = 128,
nextRetryLane = 4194304;
function getHighestPriorityLanes(lanes) {
var pendingSyncLanes = lanes & 42;
if (0 !== pendingSyncLanes) return pendingSyncLanes;
if (enableUnifiedSyncLane) {
var pendingSyncLanes = lanes & SyncUpdateLanes;
if (0 !== pendingSyncLanes) return pendingSyncLanes;
}
switch (lanes & -lanes) {
case 1:
return 1;
Expand Down Expand Up @@ -5972,7 +5976,8 @@ function updateDehydratedSuspenseComponent(
didPrimaryChildrenDefer = workInProgressRoot;
if (null !== didPrimaryChildrenDefer) {
nextProps = renderLanes & -renderLanes;
if (0 !== (nextProps & 42)) nextProps = 1;
if (enableUnifiedSyncLane && 0 !== (nextProps & SyncUpdateLanes))
nextProps = 1;
else
switch (nextProps) {
case 2:
Expand Down Expand Up @@ -9206,7 +9211,7 @@ function commitRootImpl(
0 !== root.tag &&
flushPassiveEffects();
remainingLanes = root.pendingLanes;
0 !== (transitions & 4194218) && 0 !== (remainingLanes & 42)
0 !== (transitions & 4194218) && 0 !== (remainingLanes & SyncUpdateLanes)
? ((nestedUpdateScheduled = !0),
root === rootWithNestedUpdates
? nestedUpdateCount++
Expand Down Expand Up @@ -10385,7 +10390,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1147 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-canary-b2e48ba9",
version: "18.3.0-canary-9dda16fd",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10441,7 +10446,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-b2e48ba9"
reconcilerVersion: "18.3.0-canary-9dda16fd"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<83d99d0c79ddb75f425e727a1ae48bd3>>
* @generated SignedSource<<2b24b949db80030833f17449b6904d8c>>
*/

"use strict";
Expand Down Expand Up @@ -2948,8 +2948,8 @@ to return true:wantsResponderID| |
dynamicFlags.enableComponentStackLocations,
enableDeferRootSchedulingToMicrotask =
dynamicFlags.enableDeferRootSchedulingToMicrotask,
enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning;
// The rest of the flags are static for better dead code elimination.
enableUseRefAccessWarning = dynamicFlags.enableUseRefAccessWarning,
enableUnifiedSyncLane = dynamicFlags.enableUnifiedSyncLane; // The rest of the flags are static for better dead code elimination.
var enableSchedulingProfiler = true;
var enableProfilerTimer = true;
var enableProfilerCommitHooks = true;
Expand Down Expand Up @@ -4896,7 +4896,9 @@ to return true:wantsResponderID| |
var DefaultLane =
/* */
32;
var SyncUpdateLanes = SyncLane | InputContinuousLane | DefaultLane;
var SyncUpdateLanes = enableUnifiedSyncLane
? SyncLane | InputContinuousLane | DefaultLane
: SyncLane;
var TransitionHydrationLane =
/* */
64;
Expand Down Expand Up @@ -5052,7 +5054,7 @@ to return true:wantsResponderID| |
var nextRetryLane = RetryLane1;

function getHighestPriorityLanes(lanes) {
{
if (enableUnifiedSyncLane) {
var pendingSyncLanes = lanes & SyncUpdateLanes;

if (pendingSyncLanes !== 0) {
Expand Down Expand Up @@ -5652,7 +5654,7 @@ to return true:wantsResponderID| |
var renderLane = getHighestPriorityLane(renderLanes);
var lane;

if ((renderLane & SyncUpdateLanes) !== NoLane) {
if (enableUnifiedSyncLane && (renderLane & SyncUpdateLanes) !== NoLane) {
lane = SyncHydrationLane;
} else {
switch (renderLane) {
Expand Down Expand Up @@ -28456,7 +28458,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "18.3.0-canary-589e7bda";
var ReactVersion = "18.3.0-canary-a4796866";

function createPortal$1(
children,
Expand Down
Loading

0 comments on commit 6fb4d0d

Please sign in to comment.