Skip to content

Commit ee9732e

Browse files
committed
[flags] Clean up scheduler flags (facebook#31814)
These flags are hardcoded now, we can make them static. DiffTrain build for [d428725](facebook@d428725)
1 parent 457b3f0 commit ee9732e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2036
-3714
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e06c72fcf4632ad3117add713a25f6354631f037
1+
d42872588282b9eef56b8fa02441b33d596fd197
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e06c72fcf4632ad3117add713a25f6354631f037
1+
d42872588282b9eef56b8fa02441b33d596fd197

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,14 +1870,6 @@ __DEV__ &&
18701870
exports.unstable_useCacheRefresh = function () {
18711871
return resolveDispatcher().useCacheRefresh();
18721872
};
1873-
exports.unstable_useContextWithBailout = function (context, select) {
1874-
var dispatcher = resolveDispatcher();
1875-
context.$$typeof === REACT_CONSUMER_TYPE &&
1876-
error$jscomp$0(
1877-
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1878-
);
1879-
return dispatcher.unstable_useContextWithBailout(context, select);
1880-
};
18811873
exports.unstable_useMemoCache = useMemoCache;
18821874
exports.use = function (usable) {
18831875
return resolveDispatcher().use(usable);
@@ -1950,7 +1942,7 @@ __DEV__ &&
19501942
exports.useTransition = function () {
19511943
return resolveDispatcher().useTransition();
19521944
};
1953-
exports.version = "19.1.0-www-classic-e06c72fc-20241215";
1945+
exports.version = "19.1.0-www-classic-d4287258-20241217";
19541946
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19551947
"function" ===
19561948
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,14 +1870,6 @@ __DEV__ &&
18701870
exports.unstable_useCacheRefresh = function () {
18711871
return resolveDispatcher().useCacheRefresh();
18721872
};
1873-
exports.unstable_useContextWithBailout = function (context, select) {
1874-
var dispatcher = resolveDispatcher();
1875-
context.$$typeof === REACT_CONSUMER_TYPE &&
1876-
error$jscomp$0(
1877-
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
1878-
);
1879-
return dispatcher.unstable_useContextWithBailout(context, select);
1880-
};
18811873
exports.unstable_useMemoCache = useMemoCache;
18821874
exports.use = function (usable) {
18831875
return resolveDispatcher().use(usable);
@@ -1950,7 +1942,7 @@ __DEV__ &&
19501942
exports.useTransition = function () {
19511943
return resolveDispatcher().useTransition();
19521944
};
1953-
exports.version = "19.1.0-www-modern-e06c72fc-20241215";
1945+
exports.version = "19.1.0-www-modern-d4287258-20241217";
19541946
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19551947
"function" ===
19561948
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,6 @@ exports.unstable_getCacheForType = function (resourceType) {
569569
exports.unstable_useCacheRefresh = function () {
570570
return ReactSharedInternals.H.useCacheRefresh();
571571
};
572-
exports.unstable_useContextWithBailout = function (context, select) {
573-
return ReactSharedInternals.H.unstable_useContextWithBailout(context, select);
574-
};
575572
exports.unstable_useMemoCache = useMemoCache;
576573
exports.use = function (usable) {
577574
return ReactSharedInternals.H.use(usable);
@@ -633,4 +630,4 @@ exports.useSyncExternalStore = function (
633630
exports.useTransition = function () {
634631
return ReactSharedInternals.H.useTransition();
635632
};
636-
exports.version = "19.1.0-www-classic-e06c72fc-20241215";
633+
exports.version = "19.1.0-www-classic-d4287258-20241217";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,6 @@ exports.unstable_getCacheForType = function (resourceType) {
569569
exports.unstable_useCacheRefresh = function () {
570570
return ReactSharedInternals.H.useCacheRefresh();
571571
};
572-
exports.unstable_useContextWithBailout = function (context, select) {
573-
return ReactSharedInternals.H.unstable_useContextWithBailout(context, select);
574-
};
575572
exports.unstable_useMemoCache = useMemoCache;
576573
exports.use = function (usable) {
577574
return ReactSharedInternals.H.use(usable);
@@ -633,4 +630,4 @@ exports.useSyncExternalStore = function (
633630
exports.useTransition = function () {
634631
return ReactSharedInternals.H.useTransition();
635632
};
636-
exports.version = "19.1.0-www-modern-e06c72fc-20241215";
633+
exports.version = "19.1.0-www-modern-d4287258-20241217";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,6 @@ exports.unstable_getCacheForType = function (resourceType) {
573573
exports.unstable_useCacheRefresh = function () {
574574
return ReactSharedInternals.H.useCacheRefresh();
575575
};
576-
exports.unstable_useContextWithBailout = function (context, select) {
577-
return ReactSharedInternals.H.unstable_useContextWithBailout(context, select);
578-
};
579576
exports.unstable_useMemoCache = useMemoCache;
580577
exports.use = function (usable) {
581578
return ReactSharedInternals.H.use(usable);
@@ -637,7 +634,7 @@ exports.useSyncExternalStore = function (
637634
exports.useTransition = function () {
638635
return ReactSharedInternals.H.useTransition();
639636
};
640-
exports.version = "19.1.0-www-classic-e06c72fc-20241215";
637+
exports.version = "19.1.0-www-classic-d4287258-20241217";
641638
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
642639
"function" ===
643640
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,9 +573,6 @@ exports.unstable_getCacheForType = function (resourceType) {
573573
exports.unstable_useCacheRefresh = function () {
574574
return ReactSharedInternals.H.useCacheRefresh();
575575
};
576-
exports.unstable_useContextWithBailout = function (context, select) {
577-
return ReactSharedInternals.H.unstable_useContextWithBailout(context, select);
578-
};
579576
exports.unstable_useMemoCache = useMemoCache;
580577
exports.use = function (usable) {
581578
return ReactSharedInternals.H.use(usable);
@@ -637,7 +634,7 @@ exports.useSyncExternalStore = function (
637634
exports.useTransition = function () {
638635
return ReactSharedInternals.H.useTransition();
639636
};
640-
exports.version = "19.1.0-www-modern-e06c72fc-20241215";
637+
exports.version = "19.1.0-www-modern-d4287258-20241217";
641638
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
642639
"function" ===
643640
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 9 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -3146,35 +3146,6 @@ __DEV__ &&
31463146
}
31473147
return workInProgressHook;
31483148
}
3149-
function unstable_useContextWithBailout(context, select) {
3150-
if (null === select) var JSCompiler_temp = readContext(context);
3151-
else {
3152-
JSCompiler_temp = currentlyRenderingFiber;
3153-
var value = context._currentValue2;
3154-
context = {
3155-
context: context,
3156-
memoizedValue: value,
3157-
next: null,
3158-
select: select,
3159-
lastSelectedValue: select(value)
3160-
};
3161-
if (null === lastContextDependency) {
3162-
if (null === JSCompiler_temp)
3163-
throw Error(
3164-
"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
3165-
);
3166-
lastContextDependency = context;
3167-
JSCompiler_temp.dependencies = {
3168-
lanes: 0,
3169-
firstContext: context,
3170-
_debugThenableState: null
3171-
};
3172-
JSCompiler_temp.flags |= 524288;
3173-
} else lastContextDependency = lastContextDependency.next = context;
3174-
JSCompiler_temp = value;
3175-
}
3176-
return JSCompiler_temp;
3177-
}
31783149
function createFunctionComponentUpdateQueue() {
31793150
return { lastEffect: null, events: null, stores: null, memoCache: null };
31803151
}
@@ -8611,19 +8582,8 @@ __DEV__ &&
86118582
a: for (; null !== list; ) {
86128583
var dependency = list;
86138584
list = fiber;
8614-
var i = 0;
8615-
b: for (; i < contexts.length; i++)
8585+
for (var i = 0; i < contexts.length; i++)
86168586
if (dependency.context === contexts[i]) {
8617-
var select = dependency.select;
8618-
if (
8619-
null != select &&
8620-
null != dependency.lastSelectedValue &&
8621-
!checkIfSelectedContextValuesChanged(
8622-
dependency.lastSelectedValue,
8623-
select(dependency.context._currentValue2)
8624-
)
8625-
)
8626-
continue b;
86278587
list.lanes |= renderLanes;
86288588
dependency = list.alternate;
86298589
null !== dependency && (dependency.lanes |= renderLanes);
@@ -8721,37 +8681,19 @@ __DEV__ &&
87218681
);
87228682
workInProgress.flags |= 262144;
87238683
}
8724-
function checkIfSelectedContextValuesChanged(
8725-
oldComparedValue,
8726-
newComparedValue
8727-
) {
8728-
if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) {
8729-
if (oldComparedValue.length !== newComparedValue.length) return !0;
8730-
for (var i = 0; i < oldComparedValue.length; i++)
8731-
if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0;
8732-
} else throw Error("Compared context values must be arrays");
8733-
return !1;
8734-
}
87358684
function checkIfContextChanged(currentDependencies) {
87368685
for (
87378686
currentDependencies = currentDependencies.firstContext;
87388687
null !== currentDependencies;
87398688

87408689
) {
8741-
var newValue = currentDependencies.context._currentValue2,
8742-
oldValue = currentDependencies.memoizedValue;
87438690
if (
8744-
null != currentDependencies.select &&
8745-
null != currentDependencies.lastSelectedValue
8746-
) {
8747-
if (
8748-
checkIfSelectedContextValuesChanged(
8749-
currentDependencies.lastSelectedValue,
8750-
currentDependencies.select(newValue)
8751-
)
8691+
!objectIs(
8692+
currentDependencies.context._currentValue2,
8693+
currentDependencies.memoizedValue
87528694
)
8753-
return !0;
8754-
} else if (!objectIs(newValue, oldValue)) return !0;
8695+
)
8696+
return !0;
87558697
currentDependencies = currentDependencies.next;
87568698
}
87578699
return !1;
@@ -15150,8 +15092,6 @@ __DEV__ &&
1515015092
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
1515115093
enableUseResourceEffectHook &&
1515215094
(ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError);
15153-
ContextOnlyDispatcher.unstable_useContextWithBailout =
15154-
throwInvalidHookError;
1515515095
var HooksDispatcherOnMountInDEV = null,
1515615096
HooksDispatcherOnMountWithHookTypesInDEV = null,
1515715097
HooksDispatcherOnUpdateInDEV = null,
@@ -15317,14 +15257,6 @@ __DEV__ &&
1531715257
destroy
1531815258
);
1531915259
});
15320-
HooksDispatcherOnMountInDEV.unstable_useContextWithBailout = function (
15321-
context,
15322-
select
15323-
) {
15324-
currentHookNameInDev = "useContext";
15325-
mountHookTypesDev();
15326-
return unstable_useContextWithBailout(context, select);
15327-
};
1532815260
HooksDispatcherOnMountWithHookTypesInDEV = {
1532915261
readContext: function (context) {
1533015262
return readContext(context);
@@ -15469,12 +15401,6 @@ __DEV__ &&
1546915401
destroy
1547015402
);
1547115403
});
15472-
HooksDispatcherOnMountWithHookTypesInDEV.unstable_useContextWithBailout =
15473-
function (context, select) {
15474-
currentHookNameInDev = "useContext";
15475-
updateHookTypesDev();
15476-
return unstable_useContextWithBailout(context, select);
15477-
};
1547815404
HooksDispatcherOnUpdateInDEV = {
1547915405
readContext: function (context) {
1548015406
return readContext(context);
@@ -15621,14 +15547,6 @@ __DEV__ &&
1562115547
destroy
1562215548
);
1562315549
});
15624-
HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function (
15625-
context,
15626-
select
15627-
) {
15628-
currentHookNameInDev = "useContext";
15629-
updateHookTypesDev();
15630-
return unstable_useContextWithBailout(context, select);
15631-
};
1563215550
HooksDispatcherOnRerenderInDEV = {
1563315551
readContext: function (context) {
1563415552
return readContext(context);
@@ -15775,14 +15693,6 @@ __DEV__ &&
1577515693
destroy
1577615694
);
1577715695
});
15778-
HooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = function (
15779-
context,
15780-
select
15781-
) {
15782-
currentHookNameInDev = "useContext";
15783-
updateHookTypesDev();
15784-
return unstable_useContextWithBailout(context, select);
15785-
};
1578615696
InvalidNestedHooksDispatcherOnMountInDEV = {
1578715697
readContext: function (context) {
1578815698
warnInvalidContextAccess();
@@ -15953,13 +15863,6 @@ __DEV__ &&
1595315863
destroy
1595415864
);
1595515865
});
15956-
InvalidNestedHooksDispatcherOnMountInDEV.unstable_useContextWithBailout =
15957-
function (context, select) {
15958-
currentHookNameInDev = "useContext";
15959-
warnInvalidHookAccess();
15960-
mountHookTypesDev();
15961-
return unstable_useContextWithBailout(context, select);
15962-
};
1596315866
InvalidNestedHooksDispatcherOnUpdateInDEV = {
1596415867
readContext: function (context) {
1596515868
warnInvalidContextAccess();
@@ -16132,13 +16035,6 @@ __DEV__ &&
1613216035
destroy
1613316036
);
1613416037
});
16135-
InvalidNestedHooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout =
16136-
function (context, select) {
16137-
currentHookNameInDev = "useContext";
16138-
warnInvalidHookAccess();
16139-
updateHookTypesDev();
16140-
return unstable_useContextWithBailout(context, select);
16141-
};
1614216038
InvalidNestedHooksDispatcherOnRerenderInDEV = {
1614316039
readContext: function (context) {
1614416040
warnInvalidContextAccess();
@@ -16306,13 +16202,6 @@ __DEV__ &&
1630616202
destroy
1630716203
);
1630816204
});
16309-
InvalidNestedHooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout =
16310-
function (context, select) {
16311-
currentHookNameInDev = "useContext";
16312-
warnInvalidHookAccess();
16313-
updateHookTypesDev();
16314-
return unstable_useContextWithBailout(context, select);
16315-
};
1631616205
var callComponent = {
1631716206
"react-stack-bottom-frame": function (Component, props, secondArg) {
1631816207
var wasRendering = isRendering;
@@ -17015,10 +16904,10 @@ __DEV__ &&
1701516904
(function () {
1701616905
var internals = {
1701716906
bundleType: 1,
17018-
version: "19.1.0-www-classic-e06c72fc-20241215",
16907+
version: "19.1.0-www-classic-d4287258-20241217",
1701916908
rendererPackageName: "react-art",
1702016909
currentDispatcherRef: ReactSharedInternals,
17021-
reconcilerVersion: "19.1.0-www-classic-e06c72fc-20241215"
16910+
reconcilerVersion: "19.1.0-www-classic-d4287258-20241217"
1702216911
};
1702316912
internals.overrideHookState = overrideHookState;
1702416913
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -17052,7 +16941,7 @@ __DEV__ &&
1705216941
exports.Shape = Shape;
1705316942
exports.Surface = Surface;
1705416943
exports.Text = Text;
17055-
exports.version = "19.1.0-www-classic-e06c72fc-20241215";
16944+
exports.version = "19.1.0-www-classic-d4287258-20241217";
1705616945
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1705716946
"function" ===
1705816947
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)