Skip to content

Commit e9cd841

Browse files
committed
Use a shared noop function from shared/noop (#33154)
Stacked on #33150. We use `noop` functions in a lot of places as place holders. I don't think there's any real optimizations we get from having separate instances. This moves them to use a common instance in `shared/noop`. DiffTrain build for [21fdf30](21fdf30)
1 parent a5a6ecd commit e9cd841

24 files changed

+241
-257
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.2.0-native-fb-4ca97e48-20250508
1+
19.2.0-native-fb-21fdf308-20250508

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<6be1231f0a2cf5263e09a1bc1ecddf64>>
10+
* @generated SignedSource<<879734e451df2cdd333c693d19eea634>>
1111
*/
1212

1313
"use strict";
@@ -404,5 +404,5 @@ __DEV__ &&
404404
exports.useFormStatus = function () {
405405
return resolveDispatcher().useHostTransitionStatus();
406406
};
407-
exports.version = "19.2.0-native-fb-4ca97e48-20250508";
407+
exports.version = "19.2.0-native-fb-21fdf308-20250508";
408408
})();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<90bf4ce482387e50d0dc3389b4019c01>>
10+
* @generated SignedSource<<e334c27c92cc40ff972f97bccdb82f2d>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.2.0-native-fb-4ca97e48-20250508";
206+
exports.version = "19.2.0-native-fb-21fdf308-20250508";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<90bf4ce482387e50d0dc3389b4019c01>>
10+
* @generated SignedSource<<e334c27c92cc40ff972f97bccdb82f2d>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.2.0-native-fb-4ca97e48-20250508";
206+
exports.version = "19.2.0-native-fb-21fdf308-20250508";

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

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<43b19660149a48f857a91e01876b46dd>>
10+
* @generated SignedSource<<601a133d3a33f7f0b400fa8b4d795409>>
1111
*/
1212

1313
/*
@@ -85,7 +85,7 @@ __DEV__ &&
8585
"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()."
8686
);
8787
}
88-
function noop$2() {}
88+
function noop() {}
8989
function warnForMissingKey() {}
9090
function setToSortedString(set) {
9191
var array = [];
@@ -3246,6 +3246,7 @@ __DEV__ &&
32463246
? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
32473247
: url;
32483248
}
3249+
function noop$1() {}
32493250
function getEventTarget(nativeEvent) {
32503251
nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;
32513252
nativeEvent.correspondingUseElement &&
@@ -5244,7 +5245,6 @@ __DEV__ &&
52445245
thenable = thenable.status;
52455246
return "fulfilled" === thenable || "rejected" === thenable;
52465247
}
5247-
function noop$3() {}
52485248
function trackUsedThenable(thenableState, thenable, index) {
52495249
null !== ReactSharedInternals.actQueue &&
52505250
(ReactSharedInternals.didUsePromise = !0);
@@ -5258,7 +5258,7 @@ __DEV__ &&
52585258
console.error(
52595259
"A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework."
52605260
)),
5261-
thenable.then(noop$3, noop$3),
5261+
thenable.then(noop$1, noop$1),
52625262
(thenable = index));
52635263
switch (thenable.status) {
52645264
case "fulfilled":
@@ -5271,7 +5271,7 @@ __DEV__ &&
52715271
);
52725272
default:
52735273
if ("string" === typeof thenable.status)
5274-
thenable.then(noop$3, noop$3);
5274+
thenable.then(noop$1, noop$1);
52755275
else {
52765276
thenableState = workInProgressRoot;
52775277
if (
@@ -8169,7 +8169,7 @@ __DEV__ &&
81698169
pendingState,
81708170
NotPendingTransition,
81718171
null === action
8172-
? noop$2
8172+
? noop
81738173
: function () {
81748174
requestFormReset$1(formFiber);
81758175
return action(formData);
@@ -15911,7 +15911,11 @@ __DEV__ &&
1591115911
16785408 === (suspendedCommitReason & 16785408)
1591215912
)
1591315913
if (
15914-
((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }),
15914+
((suspendedState = {
15915+
stylesheets: null,
15916+
count: 0,
15917+
unsuspend: noop$1
15918+
}),
1591515919
accumulateSuspenseyCommitOnFiber(finishedWork),
1591615920
(suspendedCommitReason = waitForCommitToBeReady()),
1591715921
null !== suspendedCommitReason)
@@ -18663,7 +18667,6 @@ __DEV__ &&
1866318667
? !0
1866418668
: !1;
1866518669
}
18666-
function noop$1() {}
1866718670
function setProp(domElement, tag, key, value, props, prevValue) {
1866818671
switch (key) {
1866918672
case "children":
@@ -22140,7 +22143,6 @@ __DEV__ &&
2214022143
? !1
2214122144
: !0;
2214222145
}
22143-
function noop() {}
2214422146
function suspendResource(hoistableRoot, resource, props) {
2214522147
if (null === suspendedState)
2214622148
throw Error(
@@ -26956,11 +26958,11 @@ __DEV__ &&
2695626958
};
2695726959
(function () {
2695826960
var isomorphicReactPackageVersion = React.version;
26959-
if ("19.2.0-native-fb-4ca97e48-20250508" !== isomorphicReactPackageVersion)
26961+
if ("19.2.0-native-fb-21fdf308-20250508" !== isomorphicReactPackageVersion)
2696026962
throw Error(
2696126963
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2696226964
(isomorphicReactPackageVersion +
26963-
"\n - react-dom: 19.2.0-native-fb-4ca97e48-20250508\nLearn more: https://react.dev/warnings/version-mismatch")
26965+
"\n - react-dom: 19.2.0-native-fb-21fdf308-20250508\nLearn more: https://react.dev/warnings/version-mismatch")
2696426966
);
2696526967
})();
2696626968
("function" === typeof Map &&
@@ -26997,10 +26999,10 @@ __DEV__ &&
2699726999
!(function () {
2699827000
var internals = {
2699927001
bundleType: 1,
27000-
version: "19.2.0-native-fb-4ca97e48-20250508",
27002+
version: "19.2.0-native-fb-21fdf308-20250508",
2700127003
rendererPackageName: "react-dom",
2700227004
currentDispatcherRef: ReactSharedInternals,
27003-
reconcilerVersion: "19.2.0-native-fb-4ca97e48-20250508"
27005+
reconcilerVersion: "19.2.0-native-fb-21fdf308-20250508"
2700427006
};
2700527007
internals.overrideHookState = overrideHookState;
2700627008
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -27138,5 +27140,5 @@ __DEV__ &&
2713827140
listenToAllSupportedEvents(container);
2713927141
return new ReactDOMHydrationRoot(initialChildren);
2714027142
};
27141-
exports.version = "19.2.0-native-fb-4ca97e48-20250508";
27143+
exports.version = "19.2.0-native-fb-21fdf308-20250508";
2714227144
})();

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<ca6f3798ed0c2aa38084c61ca21da62f>>
10+
* @generated SignedSource<<ee6f2363f2caf79f0a55f1f40eb6728c>>
1111
*/
1212

1313
/*
@@ -1528,6 +1528,7 @@ function sanitizeURL(url) {
15281528
? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
15291529
: url;
15301530
}
1531+
function noop$1() {}
15311532
var currentReplayingEvent = null;
15321533
function getEventTarget(nativeEvent) {
15331534
nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;
@@ -3391,12 +3392,11 @@ function isThenableResolved(thenable) {
33913392
thenable = thenable.status;
33923393
return "fulfilled" === thenable || "rejected" === thenable;
33933394
}
3394-
function noop$3() {}
33953395
function trackUsedThenable(thenableState, thenable, index) {
33963396
index = thenableState[index];
33973397
void 0 === index
33983398
? thenableState.push(thenable)
3399-
: index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index));
3399+
: index !== thenable && (thenable.then(noop$1, noop$1), (thenable = index));
34003400
switch (thenable.status) {
34013401
case "fulfilled":
34023402
return thenable.value;
@@ -3407,7 +3407,7 @@ function trackUsedThenable(thenableState, thenable, index) {
34073407
thenableState)
34083408
);
34093409
default:
3410-
if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3);
3410+
if ("string" === typeof thenable.status) thenable.then(noop$1, noop$1);
34113411
else {
34123412
thenableState = workInProgressRoot;
34133413
if (null !== thenableState && 100 < thenableState.shellSuspendCounter)
@@ -5426,7 +5426,7 @@ function startTransition(fiber, queue, pendingState, finishedState, callback) {
54265426
(ReactSharedInternals.T = prevTransition);
54275427
}
54285428
}
5429-
function noop$2() {}
5429+
function noop() {}
54305430
function startHostTransition(formFiber, pendingState, action, formData) {
54315431
if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));
54325432
var queue = ensureFormComponentIsStateful(formFiber).queue;
@@ -5436,7 +5436,7 @@ function startHostTransition(formFiber, pendingState, action, formData) {
54365436
pendingState,
54375437
sharedNotPendingObject,
54385438
null === action
5439-
? noop$2
5439+
? noop
54405440
: function () {
54415441
requestFormReset$1(formFiber);
54425442
return action(formData);
@@ -11587,7 +11587,7 @@ function commitRootWhenReady(
1158711587
16785408 === (suspendedCommitReason & 16785408)
1158811588
)
1158911589
if (
11590-
((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }),
11590+
((suspendedState = { stylesheets: null, count: 0, unsuspend: noop$1 }),
1159111591
accumulateSuspenseyCommitOnFiber(finishedWork),
1159211592
(suspendedCommitReason = waitForCommitToBeReady()),
1159311593
null !== suspendedCommitReason)
@@ -13757,7 +13757,6 @@ function checkForUnmatchedText(serverText, clientText) {
1375713757
clientText = normalizeMarkupForTextOrAttribute(clientText);
1375813758
return normalizeMarkupForTextOrAttribute(serverText) === clientText ? !0 : !1;
1375913759
}
13760-
function noop$1() {}
1376113760
function setProp(domElement, tag, key, value, props, prevValue) {
1376213761
switch (key) {
1376313762
case "children":
@@ -16138,7 +16137,6 @@ function preloadResource(resource) {
1613816137
: !0;
1613916138
}
1614016139
var suspendedState = null;
16141-
function noop() {}
1614216140
function suspendResource(hoistableRoot, resource, props) {
1614316141
if (null === suspendedState) throw Error(formatProdErrorMessage(475));
1614416142
var state = suspendedState;
@@ -17051,14 +17049,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1705117049
};
1705217050
var isomorphicReactPackageVersion$jscomp$inline_2015 = React.version;
1705317051
if (
17054-
"19.2.0-native-fb-4ca97e48-20250508" !==
17052+
"19.2.0-native-fb-21fdf308-20250508" !==
1705517053
isomorphicReactPackageVersion$jscomp$inline_2015
1705617054
)
1705717055
throw Error(
1705817056
formatProdErrorMessage(
1705917057
527,
1706017058
isomorphicReactPackageVersion$jscomp$inline_2015,
17061-
"19.2.0-native-fb-4ca97e48-20250508"
17059+
"19.2.0-native-fb-21fdf308-20250508"
1706217060
)
1706317061
);
1706417062
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17080,10 +17078,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1708017078
};
1708117079
var internals$jscomp$inline_2534 = {
1708217080
bundleType: 0,
17083-
version: "19.2.0-native-fb-4ca97e48-20250508",
17081+
version: "19.2.0-native-fb-21fdf308-20250508",
1708417082
rendererPackageName: "react-dom",
1708517083
currentDispatcherRef: ReactSharedInternals,
17086-
reconcilerVersion: "19.2.0-native-fb-4ca97e48-20250508"
17084+
reconcilerVersion: "19.2.0-native-fb-21fdf308-20250508"
1708717085
};
1708817086
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1708917087
var hook$jscomp$inline_2535 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17181,4 +17179,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1718117179
listenToAllSupportedEvents(container);
1718217180
return new ReactDOMHydrationRoot(initialChildren);
1718317181
};
17184-
exports.version = "19.2.0-native-fb-4ca97e48-20250508";
17182+
exports.version = "19.2.0-native-fb-21fdf308-20250508";

0 commit comments

Comments
 (0)