[crud] Revert CRUD overload (#32741)

Cleans up this experiment. After some internal experimentation we are
deprioritizing this project for now and may revisit it at a later point.

DiffTrain build for [313332d111](https://github.com/facebook/react/commit/313332d111a2fba2db94c584334d8895e8d73c61)
This commit is contained in:
poteto
2025-03-26 09:15:37 -07:00
parent 2057aaeae8
commit 5dd6f3faaf
35 changed files with 41328 additions and 45779 deletions
+1 -1
View File
@@ -1 +1 @@
f99c9feaf786fbdad0ad8d2d81196a247302dd3c
313332d111a2fba2db94c584334d8895e8d73c61
+1 -1
View File
@@ -1 +1 @@
f99c9feaf786fbdad0ad8d2d81196a247302dd3c
313332d111a2fba2db94c584334d8895e8d73c61
+3 -27
View File
@@ -691,8 +691,6 @@ __DEV__ &&
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableUseEffectCRUDOverload =
dynamicFeatureFlags.enableUseEffectCRUDOverload,
renameElementSymbol = dynamicFeatureFlags.renameElementSymbol,
enableViewTransition = dynamicFeatureFlags.enableViewTransition;
dynamicFeatureFlags = Symbol.for("react.element");
@@ -1457,34 +1455,12 @@ __DEV__ &&
exports.useDeferredValue = function (value, initialValue) {
return resolveDispatcher().useDeferredValue(value, initialValue);
};
exports.useEffect = function (
create,
createDeps,
update,
updateDeps,
destroy
) {
exports.useEffect = function (create, deps) {
null == create &&
console.warn(
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
);
var dispatcher = resolveDispatcher();
if (
enableUseEffectCRUDOverload &&
("function" === typeof update || "function" === typeof destroy)
)
return dispatcher.useEffect(
create,
createDeps,
update,
updateDeps,
destroy
);
if ("function" === typeof update)
throw Error(
"useEffect CRUD overload is not enabled in this build of React."
);
return dispatcher.useEffect(create, createDeps);
return resolveDispatcher().useEffect(create, deps);
};
exports.useId = function () {
return resolveDispatcher().useId();
@@ -1535,7 +1511,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-classic-f99c9fea-20250326";
exports.version = "19.1.0-www-classic-313332d1-20250326";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
+3 -27
View File
@@ -691,8 +691,6 @@ __DEV__ &&
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableUseEffectCRUDOverload =
dynamicFeatureFlags.enableUseEffectCRUDOverload,
renameElementSymbol = dynamicFeatureFlags.renameElementSymbol,
enableViewTransition = dynamicFeatureFlags.enableViewTransition;
dynamicFeatureFlags = Symbol.for("react.element");
@@ -1457,34 +1455,12 @@ __DEV__ &&
exports.useDeferredValue = function (value, initialValue) {
return resolveDispatcher().useDeferredValue(value, initialValue);
};
exports.useEffect = function (
create,
createDeps,
update,
updateDeps,
destroy
) {
exports.useEffect = function (create, deps) {
null == create &&
console.warn(
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
);
var dispatcher = resolveDispatcher();
if (
enableUseEffectCRUDOverload &&
("function" === typeof update || "function" === typeof destroy)
)
return dispatcher.useEffect(
create,
createDeps,
update,
updateDeps,
destroy
);
if ("function" === typeof update)
throw Error(
"useEffect CRUD overload is not enabled in this build of React."
);
return dispatcher.useEffect(create, createDeps);
return resolveDispatcher().useEffect(create, deps);
};
exports.useId = function () {
return resolveDispatcher().useId();
@@ -1535,7 +1511,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-modern-f99c9fea-20250326";
exports.version = "19.1.0-www-modern-313332d1-20250326";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
+3 -20
View File
@@ -16,7 +16,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"),
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableUseEffectCRUDOverload = dynamicFeatureFlags.enableUseEffectCRUDOverload,
renameElementSymbol = dynamicFeatureFlags.renameElementSymbol,
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
REACT_ELEMENT_TYPE = renameElementSymbol
@@ -581,24 +580,8 @@ exports.useDebugValue = function () {};
exports.useDeferredValue = function (value, initialValue) {
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
};
exports.useEffect = function (create, createDeps, update, updateDeps, destroy) {
var dispatcher = ReactSharedInternals.H;
if (
enableUseEffectCRUDOverload &&
("function" === typeof update || "function" === typeof destroy)
)
return dispatcher.useEffect(
create,
createDeps,
update,
updateDeps,
destroy
);
if ("function" === typeof update)
throw Error(
"useEffect CRUD overload is not enabled in this build of React."
);
return dispatcher.useEffect(create, createDeps);
exports.useEffect = function (create, deps) {
return ReactSharedInternals.H.useEffect(create, deps);
};
exports.useId = function () {
return ReactSharedInternals.H.useId();
@@ -641,4 +624,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-f99c9fea-20250326";
exports.version = "19.1.0-www-classic-313332d1-20250326";
+3 -20
View File
@@ -16,7 +16,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"),
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableUseEffectCRUDOverload = dynamicFeatureFlags.enableUseEffectCRUDOverload,
renameElementSymbol = dynamicFeatureFlags.renameElementSymbol,
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
REACT_ELEMENT_TYPE = renameElementSymbol
@@ -581,24 +580,8 @@ exports.useDebugValue = function () {};
exports.useDeferredValue = function (value, initialValue) {
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
};
exports.useEffect = function (create, createDeps, update, updateDeps, destroy) {
var dispatcher = ReactSharedInternals.H;
if (
enableUseEffectCRUDOverload &&
("function" === typeof update || "function" === typeof destroy)
)
return dispatcher.useEffect(
create,
createDeps,
update,
updateDeps,
destroy
);
if ("function" === typeof update)
throw Error(
"useEffect CRUD overload is not enabled in this build of React."
);
return dispatcher.useEffect(create, createDeps);
exports.useEffect = function (create, deps) {
return ReactSharedInternals.H.useEffect(create, deps);
};
exports.useId = function () {
return ReactSharedInternals.H.useId();
@@ -641,4 +624,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-f99c9fea-20250326";
exports.version = "19.1.0-www-modern-313332d1-20250326";
@@ -20,7 +20,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"),
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableUseEffectCRUDOverload = dynamicFeatureFlags.enableUseEffectCRUDOverload,
renameElementSymbol = dynamicFeatureFlags.renameElementSymbol,
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
REACT_ELEMENT_TYPE = renameElementSymbol
@@ -585,24 +584,8 @@ exports.useDebugValue = function () {};
exports.useDeferredValue = function (value, initialValue) {
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
};
exports.useEffect = function (create, createDeps, update, updateDeps, destroy) {
var dispatcher = ReactSharedInternals.H;
if (
enableUseEffectCRUDOverload &&
("function" === typeof update || "function" === typeof destroy)
)
return dispatcher.useEffect(
create,
createDeps,
update,
updateDeps,
destroy
);
if ("function" === typeof update)
throw Error(
"useEffect CRUD overload is not enabled in this build of React."
);
return dispatcher.useEffect(create, createDeps);
exports.useEffect = function (create, deps) {
return ReactSharedInternals.H.useEffect(create, deps);
};
exports.useId = function () {
return ReactSharedInternals.H.useId();
@@ -645,7 +628,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-f99c9fea-20250326";
exports.version = "19.1.0-www-classic-313332d1-20250326";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -20,7 +20,6 @@ var dynamicFeatureFlags = require("ReactFeatureFlags"),
dynamicFeatureFlags.disableDefaultPropsExceptForClasses,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableUseEffectCRUDOverload = dynamicFeatureFlags.enableUseEffectCRUDOverload,
renameElementSymbol = dynamicFeatureFlags.renameElementSymbol,
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
REACT_ELEMENT_TYPE = renameElementSymbol
@@ -585,24 +584,8 @@ exports.useDebugValue = function () {};
exports.useDeferredValue = function (value, initialValue) {
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
};
exports.useEffect = function (create, createDeps, update, updateDeps, destroy) {
var dispatcher = ReactSharedInternals.H;
if (
enableUseEffectCRUDOverload &&
("function" === typeof update || "function" === typeof destroy)
)
return dispatcher.useEffect(
create,
createDeps,
update,
updateDeps,
destroy
);
if ("function" === typeof update)
throw Error(
"useEffect CRUD overload is not enabled in this build of React."
);
return dispatcher.useEffect(create, createDeps);
exports.useEffect = function (create, deps) {
return ReactSharedInternals.H.useEffect(create, deps);
};
exports.useId = function () {
return ReactSharedInternals.H.useId();
@@ -645,7 +628,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-f99c9fea-20250326";
exports.version = "19.1.0-www-modern-313332d1-20250326";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -9440,5 +9440,5 @@ __DEV__ &&
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-classic-f99c9fea-20250326";
exports.version = "19.1.0-www-classic-313332d1-20250326";
})();
@@ -9369,5 +9369,5 @@ __DEV__ &&
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-modern-f99c9fea-20250326";
exports.version = "19.1.0-www-modern-313332d1-20250326";
})();
@@ -6203,4 +6203,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-classic-f99c9fea-20250326";
exports.version = "19.1.0-www-classic-313332d1-20250326";
@@ -6115,4 +6115,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-modern-f99c9fea-20250326";
exports.version = "19.1.0-www-modern-313332d1-20250326";
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1 +1 @@
19.1.0-www-classic-f99c9fea-20250326
19.1.0-www-classic-313332d1-20250326
+1 -1
View File
@@ -1 +1 @@
19.1.0-www-modern-f99c9fea-20250326
19.1.0-www-modern-313332d1-20250326
@@ -36,7 +36,6 @@ export default [
"%s is not a supported value for revealOrder on <SuspenseList />. Did you mean \"together\", \"forwards\" or \"backwards\"?",
"%s must not return anything besides a function, which is used for clean-up.%s",
"%s objects cannot be rendered as text children. Try formatting it using toString().%s",
"%s received a dependency array with no dependencies. When specified, the dependency array must have at least one dependency.",
"%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",
"%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",
"%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",
@@ -149,13 +148,11 @@ export default [
"Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",
"Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",
"Expected `%s` listener to be a function, instead got a value of `%s` type.",
"Expected a ResourceEffectUpdateKind to follow ResourceEffectIdentityKind, got %s. This is a bug in React.",
"Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",
"Expected an empty stack. Something was not reset properly.",
"Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue.",
"Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue.",
"Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.",
"Expected only SimpleEffects when enableUseEffectCRUDOverload is disabled, got %s",
"Expected the last optional `callback` argument to be a function. Instead received: %s.",
"Expected to be hydrating. This is a bug in React. Please file an issue.",
"Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue.",
@@ -313,7 +310,6 @@ export default [
"Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",
"Unexpected type for suspenseCallback.",
"Unexpected type of fiber triggered a suspensey commit. This is a bug in React.",
"Unhandled Effect kind %s. This is a bug in React.",
"Unknown ARIA attribute `%s`. Did you mean `%s`?",
"Unknown event handler property `%s`. It will be ignored.",
"Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles",
@@ -395,7 +391,6 @@ export default [
"unmountComponentAtNode was removed in React 19. Use root.unmount() instead.",
"unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s",
"unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React.",
"useEffect must provide a callback which returns a resource. If a managed resource is not needed here, do not provide an updater or destroy callback. Received %s",
"useInsertionEffect must not schedule updates.",
"useOptimistic is now in canary. Remove the experimental_ prefix. The prefixed alias will be removed in an upcoming release.",
"useSwipeTransition() caused something to mutate <%s>. This is not possible in the current implementation. Make sure that the swipe doesn't update any state which causes <%s> to change.",