Skip to content

Commit

Permalink
[flags] Clean up scheduler flags (facebook#31814)
Browse files Browse the repository at this point in the history
These flags are hardcoded now, we can make them static.

DiffTrain build for [d428725](facebook@d428725)
  • Loading branch information
pull[bot] committed Dec 17, 2024
1 parent 457b3f0 commit ee9732e
Show file tree
Hide file tree
Showing 44 changed files with 2,036 additions and 3,714 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e06c72fcf4632ad3117add713a25f6354631f037
d42872588282b9eef56b8fa02441b33d596fd197
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e06c72fcf4632ad3117add713a25f6354631f037
d42872588282b9eef56b8fa02441b33d596fd197
10 changes: 1 addition & 9 deletions compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1870,14 +1870,6 @@ __DEV__ &&
exports.unstable_useCacheRefresh = function () {
return resolveDispatcher().useCacheRefresh();
};
exports.unstable_useContextWithBailout = function (context, select) {
var dispatcher = resolveDispatcher();
context.$$typeof === REACT_CONSUMER_TYPE &&
error$jscomp$0(
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
);
return dispatcher.unstable_useContextWithBailout(context, select);
};
exports.unstable_useMemoCache = useMemoCache;
exports.use = function (usable) {
return resolveDispatcher().use(usable);
Expand Down Expand Up @@ -1950,7 +1942,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-classic-e06c72fc-20241215";
exports.version = "19.1.0-www-classic-d4287258-20241217";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 1 addition & 9 deletions compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1870,14 +1870,6 @@ __DEV__ &&
exports.unstable_useCacheRefresh = function () {
return resolveDispatcher().useCacheRefresh();
};
exports.unstable_useContextWithBailout = function (context, select) {
var dispatcher = resolveDispatcher();
context.$$typeof === REACT_CONSUMER_TYPE &&
error$jscomp$0(
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
);
return dispatcher.unstable_useContextWithBailout(context, select);
};
exports.unstable_useMemoCache = useMemoCache;
exports.use = function (usable) {
return resolveDispatcher().use(usable);
Expand Down Expand Up @@ -1950,7 +1942,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-modern-e06c72fc-20241215";
exports.version = "19.1.0-www-modern-d4287258-20241217";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
5 changes: 1 addition & 4 deletions compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,6 @@ exports.unstable_getCacheForType = function (resourceType) {
exports.unstable_useCacheRefresh = function () {
return ReactSharedInternals.H.useCacheRefresh();
};
exports.unstable_useContextWithBailout = function (context, select) {
return ReactSharedInternals.H.unstable_useContextWithBailout(context, select);
};
exports.unstable_useMemoCache = useMemoCache;
exports.use = function (usable) {
return ReactSharedInternals.H.use(usable);
Expand Down Expand Up @@ -633,4 +630,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-e06c72fc-20241215";
exports.version = "19.1.0-www-classic-d4287258-20241217";
5 changes: 1 addition & 4 deletions compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,6 @@ exports.unstable_getCacheForType = function (resourceType) {
exports.unstable_useCacheRefresh = function () {
return ReactSharedInternals.H.useCacheRefresh();
};
exports.unstable_useContextWithBailout = function (context, select) {
return ReactSharedInternals.H.unstable_useContextWithBailout(context, select);
};
exports.unstable_useMemoCache = useMemoCache;
exports.use = function (usable) {
return ReactSharedInternals.H.use(usable);
Expand Down Expand Up @@ -633,4 +630,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-e06c72fc-20241215";
exports.version = "19.1.0-www-modern-d4287258-20241217";
5 changes: 1 addition & 4 deletions compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,6 @@ exports.unstable_getCacheForType = function (resourceType) {
exports.unstable_useCacheRefresh = function () {
return ReactSharedInternals.H.useCacheRefresh();
};
exports.unstable_useContextWithBailout = function (context, select) {
return ReactSharedInternals.H.unstable_useContextWithBailout(context, select);
};
exports.unstable_useMemoCache = useMemoCache;
exports.use = function (usable) {
return ReactSharedInternals.H.use(usable);
Expand Down Expand Up @@ -637,7 +634,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-e06c72fc-20241215";
exports.version = "19.1.0-www-classic-d4287258-20241217";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
5 changes: 1 addition & 4 deletions compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,6 @@ exports.unstable_getCacheForType = function (resourceType) {
exports.unstable_useCacheRefresh = function () {
return ReactSharedInternals.H.useCacheRefresh();
};
exports.unstable_useContextWithBailout = function (context, select) {
return ReactSharedInternals.H.unstable_useContextWithBailout(context, select);
};
exports.unstable_useMemoCache = useMemoCache;
exports.use = function (usable) {
return ReactSharedInternals.H.use(usable);
Expand Down Expand Up @@ -637,7 +634,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-e06c72fc-20241215";
exports.version = "19.1.0-www-modern-d4287258-20241217";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
129 changes: 9 additions & 120 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3146,35 +3146,6 @@ __DEV__ &&
}
return workInProgressHook;
}
function unstable_useContextWithBailout(context, select) {
if (null === select) var JSCompiler_temp = readContext(context);
else {
JSCompiler_temp = currentlyRenderingFiber;
var value = context._currentValue2;
context = {
context: context,
memoizedValue: value,
next: null,
select: select,
lastSelectedValue: select(value)
};
if (null === lastContextDependency) {
if (null === JSCompiler_temp)
throw Error(
"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()."
);
lastContextDependency = context;
JSCompiler_temp.dependencies = {
lanes: 0,
firstContext: context,
_debugThenableState: null
};
JSCompiler_temp.flags |= 524288;
} else lastContextDependency = lastContextDependency.next = context;
JSCompiler_temp = value;
}
return JSCompiler_temp;
}
function createFunctionComponentUpdateQueue() {
return { lastEffect: null, events: null, stores: null, memoCache: null };
}
Expand Down Expand Up @@ -8611,19 +8582,8 @@ __DEV__ &&
a: for (; null !== list; ) {
var dependency = list;
list = fiber;
var i = 0;
b: for (; i < contexts.length; i++)
for (var i = 0; i < contexts.length; i++)
if (dependency.context === contexts[i]) {
var select = dependency.select;
if (
null != select &&
null != dependency.lastSelectedValue &&
!checkIfSelectedContextValuesChanged(
dependency.lastSelectedValue,
select(dependency.context._currentValue2)
)
)
continue b;
list.lanes |= renderLanes;
dependency = list.alternate;
null !== dependency && (dependency.lanes |= renderLanes);
Expand Down Expand Up @@ -8721,37 +8681,19 @@ __DEV__ &&
);
workInProgress.flags |= 262144;
}
function checkIfSelectedContextValuesChanged(
oldComparedValue,
newComparedValue
) {
if (isArrayImpl(oldComparedValue) && isArrayImpl(newComparedValue)) {
if (oldComparedValue.length !== newComparedValue.length) return !0;
for (var i = 0; i < oldComparedValue.length; i++)
if (!objectIs(newComparedValue[i], oldComparedValue[i])) return !0;
} else throw Error("Compared context values must be arrays");
return !1;
}
function checkIfContextChanged(currentDependencies) {
for (
currentDependencies = currentDependencies.firstContext;
null !== currentDependencies;

) {
var newValue = currentDependencies.context._currentValue2,
oldValue = currentDependencies.memoizedValue;
if (
null != currentDependencies.select &&
null != currentDependencies.lastSelectedValue
) {
if (
checkIfSelectedContextValuesChanged(
currentDependencies.lastSelectedValue,
currentDependencies.select(newValue)
)
!objectIs(
currentDependencies.context._currentValue2,
currentDependencies.memoizedValue
)
return !0;
} else if (!objectIs(newValue, oldValue)) return !0;
)
return !0;
currentDependencies = currentDependencies.next;
}
return !1;
Expand Down Expand Up @@ -15150,8 +15092,6 @@ __DEV__ &&
ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError;
enableUseResourceEffectHook &&
(ContextOnlyDispatcher.useResourceEffect = throwInvalidHookError);
ContextOnlyDispatcher.unstable_useContextWithBailout =
throwInvalidHookError;
var HooksDispatcherOnMountInDEV = null,
HooksDispatcherOnMountWithHookTypesInDEV = null,
HooksDispatcherOnUpdateInDEV = null,
Expand Down Expand Up @@ -15317,14 +15257,6 @@ __DEV__ &&
destroy
);
});
HooksDispatcherOnMountInDEV.unstable_useContextWithBailout = function (
context,
select
) {
currentHookNameInDev = "useContext";
mountHookTypesDev();
return unstable_useContextWithBailout(context, select);
};
HooksDispatcherOnMountWithHookTypesInDEV = {
readContext: function (context) {
return readContext(context);
Expand Down Expand Up @@ -15469,12 +15401,6 @@ __DEV__ &&
destroy
);
});
HooksDispatcherOnMountWithHookTypesInDEV.unstable_useContextWithBailout =
function (context, select) {
currentHookNameInDev = "useContext";
updateHookTypesDev();
return unstable_useContextWithBailout(context, select);
};
HooksDispatcherOnUpdateInDEV = {
readContext: function (context) {
return readContext(context);
Expand Down Expand Up @@ -15621,14 +15547,6 @@ __DEV__ &&
destroy
);
});
HooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout = function (
context,
select
) {
currentHookNameInDev = "useContext";
updateHookTypesDev();
return unstable_useContextWithBailout(context, select);
};
HooksDispatcherOnRerenderInDEV = {
readContext: function (context) {
return readContext(context);
Expand Down Expand Up @@ -15775,14 +15693,6 @@ __DEV__ &&
destroy
);
});
HooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout = function (
context,
select
) {
currentHookNameInDev = "useContext";
updateHookTypesDev();
return unstable_useContextWithBailout(context, select);
};
InvalidNestedHooksDispatcherOnMountInDEV = {
readContext: function (context) {
warnInvalidContextAccess();
Expand Down Expand Up @@ -15953,13 +15863,6 @@ __DEV__ &&
destroy
);
});
InvalidNestedHooksDispatcherOnMountInDEV.unstable_useContextWithBailout =
function (context, select) {
currentHookNameInDev = "useContext";
warnInvalidHookAccess();
mountHookTypesDev();
return unstable_useContextWithBailout(context, select);
};
InvalidNestedHooksDispatcherOnUpdateInDEV = {
readContext: function (context) {
warnInvalidContextAccess();
Expand Down Expand Up @@ -16132,13 +16035,6 @@ __DEV__ &&
destroy
);
});
InvalidNestedHooksDispatcherOnUpdateInDEV.unstable_useContextWithBailout =
function (context, select) {
currentHookNameInDev = "useContext";
warnInvalidHookAccess();
updateHookTypesDev();
return unstable_useContextWithBailout(context, select);
};
InvalidNestedHooksDispatcherOnRerenderInDEV = {
readContext: function (context) {
warnInvalidContextAccess();
Expand Down Expand Up @@ -16306,13 +16202,6 @@ __DEV__ &&
destroy
);
});
InvalidNestedHooksDispatcherOnRerenderInDEV.unstable_useContextWithBailout =
function (context, select) {
currentHookNameInDev = "useContext";
warnInvalidHookAccess();
updateHookTypesDev();
return unstable_useContextWithBailout(context, select);
};
var callComponent = {
"react-stack-bottom-frame": function (Component, props, secondArg) {
var wasRendering = isRendering;
Expand Down Expand Up @@ -17015,10 +16904,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-e06c72fc-20241215",
version: "19.1.0-www-classic-d4287258-20241217",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-e06c72fc-20241215"
reconcilerVersion: "19.1.0-www-classic-d4287258-20241217"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -17052,7 +16941,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-e06c72fc-20241215";
exports.version = "19.1.0-www-classic-d4287258-20241217";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit ee9732e

Please sign in to comment.