Skip to content

Commit 819f58c

Browse files
committed
Enable enableUnifiedSyncLane (#27646)
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory. Before submitting a pull request, please make sure the following is done: 1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`. 2. Run `yarn` in the repository root. 3. If you've fixed a bug or added code that should be tested, add tests! 4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development. 5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`. 6. If you need a debugger, run `yarn test --debug --watch TestName`, open `chrome://inspect`, and press "Inspect". 7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`). 8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files. 9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`). 10. If you haven't already, complete the CLA. Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html --> ## Summary <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> The flag has been tested internally on WWW, should be good to set to true for OSS. Added a dynamic flag for fb RN. ## How did you test this change? <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. How exactly did you verify that your PR solves the issue you wanted to solve? If you leave this empty, your PR will very likely be closed. --> yarn test DiffTrain build for commit 52d542a.
1 parent d8d66eb commit 819f58c

File tree

13 files changed

+350
-264
lines changed

13 files changed

+350
-264
lines changed

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @noflow
99
* @nolint
1010
* @preventMunge
11-
* @generated SignedSource<<bb5ef5a2f4eb8edaae00d8385d079e76>>
11+
* @generated SignedSource<<769546074522c131978074e9337b9413>>
1212
*/
1313

1414
"use strict";
@@ -1078,7 +1078,7 @@ if (__DEV__) {
10781078
var DefaultLane =
10791079
/* */
10801080
32;
1081-
var SyncUpdateLanes = SyncLane;
1081+
var SyncUpdateLanes = SyncLane | InputContinuousLane | DefaultLane;
10821082
var TransitionHydrationLane =
10831083
/* */
10841084
64;
@@ -1173,6 +1173,14 @@ if (__DEV__) {
11731173
var nextRetryLane = RetryLane1;
11741174

11751175
function getHighestPriorityLanes(lanes) {
1176+
{
1177+
var pendingSyncLanes = lanes & SyncUpdateLanes;
1178+
1179+
if (pendingSyncLanes !== 0) {
1180+
return pendingSyncLanes;
1181+
}
1182+
}
1183+
11761184
switch (getHighestPriorityLane(lanes)) {
11771185
case SyncHydrationLane:
11781186
return SyncHydrationLane;
@@ -1771,7 +1779,9 @@ if (__DEV__) {
17711779
var renderLane = getHighestPriorityLane(renderLanes);
17721780
var lane;
17731781

1774-
{
1782+
if ((renderLane & SyncUpdateLanes) !== NoLane) {
1783+
lane = SyncHydrationLane;
1784+
} else {
17751785
switch (renderLane) {
17761786
case SyncLane:
17771787
lane = SyncHydrationLane;
@@ -25346,7 +25356,7 @@ if (__DEV__) {
2534625356
return root;
2534725357
}
2534825358

25349-
var ReactVersion = "18.3.0-canary-2c8a139a5-20231107";
25359+
var ReactVersion = "18.3.0-canary-52d542ad6-20231107";
2535025360

2535125361
// Might add PROFILE later.
2535225362

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

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@noflow
99
@nolint
1010
@preventMunge
11-
@generated SignedSource<<42aaf404bbde7ea71491676ec56cb0e1>>
11+
@generated SignedSource<<64fea925e1f2075ccf9b0d7a53d3616f>>
1212
*/
1313
"use strict";
1414
var React = require("react"),
@@ -302,6 +302,8 @@ function clz32Fallback(x) {
302302
var nextTransitionLane = 128,
303303
nextRetryLane = 4194304;
304304
function getHighestPriorityLanes(lanes) {
305+
var pendingSyncLanes = lanes & 42;
306+
if (0 !== pendingSyncLanes) return pendingSyncLanes;
305307
switch (lanes & -lanes) {
306308
case 1:
307309
return 1;
@@ -4357,43 +4359,46 @@ function updateDehydratedSuspenseComponent(
43574359
if (didReceiveUpdate || didSuspend) {
43584360
nextProps = workInProgressRoot;
43594361
if (null !== nextProps) {
4360-
switch (renderLanes & -renderLanes) {
4361-
case 2:
4362-
didSuspend = 1;
4363-
break;
4364-
case 8:
4365-
didSuspend = 4;
4366-
break;
4367-
case 32:
4368-
didSuspend = 16;
4369-
break;
4370-
case 128:
4371-
case 256:
4372-
case 512:
4373-
case 1024:
4374-
case 2048:
4375-
case 4096:
4376-
case 8192:
4377-
case 16384:
4378-
case 32768:
4379-
case 65536:
4380-
case 131072:
4381-
case 262144:
4382-
case 524288:
4383-
case 1048576:
4384-
case 2097152:
4385-
case 4194304:
4386-
case 8388608:
4387-
case 16777216:
4388-
case 33554432:
4389-
didSuspend = 64;
4390-
break;
4391-
case 268435456:
4392-
didSuspend = 134217728;
4393-
break;
4394-
default:
4395-
didSuspend = 0;
4396-
}
4362+
didSuspend = renderLanes & -renderLanes;
4363+
if (0 !== (didSuspend & 42)) didSuspend = 1;
4364+
else
4365+
switch (didSuspend) {
4366+
case 2:
4367+
didSuspend = 1;
4368+
break;
4369+
case 8:
4370+
didSuspend = 4;
4371+
break;
4372+
case 32:
4373+
didSuspend = 16;
4374+
break;
4375+
case 128:
4376+
case 256:
4377+
case 512:
4378+
case 1024:
4379+
case 2048:
4380+
case 4096:
4381+
case 8192:
4382+
case 16384:
4383+
case 32768:
4384+
case 65536:
4385+
case 131072:
4386+
case 262144:
4387+
case 524288:
4388+
case 1048576:
4389+
case 2097152:
4390+
case 4194304:
4391+
case 8388608:
4392+
case 16777216:
4393+
case 33554432:
4394+
didSuspend = 64;
4395+
break;
4396+
case 268435456:
4397+
didSuspend = 134217728;
4398+
break;
4399+
default:
4400+
didSuspend = 0;
4401+
}
43974402
didSuspend =
43984403
0 !== (didSuspend & (nextProps.suspendedLanes | renderLanes))
43994404
? 0
@@ -7717,7 +7722,7 @@ function commitRootImpl(
77177722
0 !== root.tag &&
77187723
flushPassiveEffects();
77197724
remainingLanes = root.pendingLanes;
7720-
0 !== (lanes & 4194218) && 0 !== (remainingLanes & 2)
7725+
0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)
77217726
? root === rootWithNestedUpdates
77227727
? nestedUpdateCount++
77237728
: ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))
@@ -9039,7 +9044,7 @@ var devToolsConfig$jscomp$inline_1033 = {
90399044
throw Error("TestRenderer does not support findFiberByHostInstance()");
90409045
},
90419046
bundleType: 0,
9042-
version: "18.3.0-canary-2c8a139a5-20231107",
9047+
version: "18.3.0-canary-52d542ad6-20231107",
90439048
rendererPackageName: "react-test-renderer"
90449049
};
90459050
var internals$jscomp$inline_1226 = {
@@ -9070,7 +9075,7 @@ var internals$jscomp$inline_1226 = {
90709075
scheduleRoot: null,
90719076
setRefreshHandler: null,
90729077
getCurrentFiber: null,
9073-
reconcilerVersion: "18.3.0-canary-2c8a139a5-20231107"
9078+
reconcilerVersion: "18.3.0-canary-52d542ad6-20231107"
90749079
};
90759080
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90769081
var hook$jscomp$inline_1227 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

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

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@noflow
99
@nolint
1010
@preventMunge
11-
@generated SignedSource<<a6bb3bf359cbeea2e35d544470fb83f6>>
11+
@generated SignedSource<<61b6979329b48da7cd49daaed19bd835>>
1212
*/
1313
"use strict";
1414
var React = require("react"),
@@ -320,6 +320,8 @@ function clz32Fallback(x) {
320320
var nextTransitionLane = 128,
321321
nextRetryLane = 4194304;
322322
function getHighestPriorityLanes(lanes) {
323+
var pendingSyncLanes = lanes & 42;
324+
if (0 !== pendingSyncLanes) return pendingSyncLanes;
323325
switch (lanes & -lanes) {
324326
case 1:
325327
return 1;
@@ -4453,43 +4455,46 @@ function updateDehydratedSuspenseComponent(
44534455
if (didReceiveUpdate || didSuspend) {
44544456
nextProps = workInProgressRoot;
44554457
if (null !== nextProps) {
4456-
switch (renderLanes & -renderLanes) {
4457-
case 2:
4458-
didSuspend = 1;
4459-
break;
4460-
case 8:
4461-
didSuspend = 4;
4462-
break;
4463-
case 32:
4464-
didSuspend = 16;
4465-
break;
4466-
case 128:
4467-
case 256:
4468-
case 512:
4469-
case 1024:
4470-
case 2048:
4471-
case 4096:
4472-
case 8192:
4473-
case 16384:
4474-
case 32768:
4475-
case 65536:
4476-
case 131072:
4477-
case 262144:
4478-
case 524288:
4479-
case 1048576:
4480-
case 2097152:
4481-
case 4194304:
4482-
case 8388608:
4483-
case 16777216:
4484-
case 33554432:
4485-
didSuspend = 64;
4486-
break;
4487-
case 268435456:
4488-
didSuspend = 134217728;
4489-
break;
4490-
default:
4491-
didSuspend = 0;
4492-
}
4458+
didSuspend = renderLanes & -renderLanes;
4459+
if (0 !== (didSuspend & 42)) didSuspend = 1;
4460+
else
4461+
switch (didSuspend) {
4462+
case 2:
4463+
didSuspend = 1;
4464+
break;
4465+
case 8:
4466+
didSuspend = 4;
4467+
break;
4468+
case 32:
4469+
didSuspend = 16;
4470+
break;
4471+
case 128:
4472+
case 256:
4473+
case 512:
4474+
case 1024:
4475+
case 2048:
4476+
case 4096:
4477+
case 8192:
4478+
case 16384:
4479+
case 32768:
4480+
case 65536:
4481+
case 131072:
4482+
case 262144:
4483+
case 524288:
4484+
case 1048576:
4485+
case 2097152:
4486+
case 4194304:
4487+
case 8388608:
4488+
case 16777216:
4489+
case 33554432:
4490+
didSuspend = 64;
4491+
break;
4492+
case 268435456:
4493+
didSuspend = 134217728;
4494+
break;
4495+
default:
4496+
didSuspend = 0;
4497+
}
44934498
didSuspend =
44944499
0 !== (didSuspend & (nextProps.suspendedLanes | renderLanes))
44954500
? 0
@@ -8079,7 +8084,7 @@ function commitRootImpl(
80798084
0 !== root.tag &&
80808085
flushPassiveEffects();
80818086
remainingLanes = root.pendingLanes;
8082-
0 !== (lanes & 4194218) && 0 !== (remainingLanes & 2)
8087+
0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)
80838088
? ((nestedUpdateScheduled = !0),
80848089
root === rootWithNestedUpdates
80858090
? nestedUpdateCount++
@@ -9465,7 +9470,7 @@ var devToolsConfig$jscomp$inline_1075 = {
94659470
throw Error("TestRenderer does not support findFiberByHostInstance()");
94669471
},
94679472
bundleType: 0,
9468-
version: "18.3.0-canary-2c8a139a5-20231107",
9473+
version: "18.3.0-canary-52d542ad6-20231107",
94699474
rendererPackageName: "react-test-renderer"
94709475
};
94719476
var internals$jscomp$inline_1267 = {
@@ -9496,7 +9501,7 @@ var internals$jscomp$inline_1267 = {
94969501
scheduleRoot: null,
94979502
setRefreshHandler: null,
94989503
getCurrentFiber: null,
9499-
reconcilerVersion: "18.3.0-canary-2c8a139a5-20231107"
9504+
reconcilerVersion: "18.3.0-canary-52d542ad6-20231107"
95009505
};
95019506
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95029507
var hook$jscomp$inline_1268 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if (__DEV__) {
2525
) {
2626
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2727
}
28-
var ReactVersion = "18.3.0-canary-2c8a139a5-20231107";
28+
var ReactVersion = "18.3.0-canary-52d542ad6-20231107";
2929

3030
// ATTENTION
3131
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,4 @@ exports.useSyncExternalStore = function (
580580
exports.useTransition = function () {
581581
return ReactCurrentDispatcher.current.useTransition();
582582
};
583-
exports.version = "18.3.0-canary-2c8a139a5-20231107";
583+
exports.version = "18.3.0-canary-52d542ad6-20231107";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ exports.useSyncExternalStore = function (
576576
exports.useTransition = function () {
577577
return ReactCurrentDispatcher.current.useTransition();
578578
};
579-
exports.version = "18.3.0-canary-2c8a139a5-20231107";
579+
exports.version = "18.3.0-canary-52d542ad6-20231107";
580580
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
581581
"function" ===
582582
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2c8a139a593e0294c3a6953d74b451bd05fdcfca
1+
52d542ad6d410008c495084f511247f43387055f

0 commit comments

Comments
 (0)