mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Expose cacheSignal() alongside cache() (#33557)
This was really meant to be there from the beginning. A `cache()`:ed
entry has a life time. On the server this ends when the render finishes.
On the client this ends when the cache of that scope gets refreshed.
When a cache is no longer needed, it should be possible to abort any
outstanding network requests or other resources. That's what
`cacheSignal()` gives you. It returns an `AbortSignal` which aborts when
the cache lifetime is done based on the same execution scope as a
`cache()`ed function - i.e. `AsyncLocalStorage` on the server or the
render scope on the client.
```js
import {cacheSignal} from 'react';
async function Component() {
await fetch(url, { signal: cacheSignal() });
}
```
For `fetch` in particular, a patch should really just do this
automatically for you. But it's useful for other resources like database
connections.
Another reason it's useful to have a `cacheSignal()` is to ignore any
errors that might have triggered from the act of being aborted. This is
just a general useful JavaScript pattern if you have access to a signal:
```js
async function getData(id, signal) {
try {
await queryDatabase(id, { signal });
} catch (x) {
if (!signal.aborted) {
logError(x); // only log if it's a real error and not due to cancellation
}
return null;
}
}
```
This just gets you a convenient way to get to it without drilling
through so a more idiomatic code in React might look something like.
```js
import {cacheSignal} from "react";
async function getData(id) {
try {
await queryDatabase(id);
} catch (x) {
if (!cacheSignal()?.aborted) {
logError(x);
}
return null;
}
}
```
If it's called outside of a React render, we normally treat any cached
functions as uncached. They're not an error call. They can still load
data. It's just not cached. This is not like an aborted signal because
then you couldn't issue any requests. It's also not like an infinite
abort signal because it's not actually cached forever. Therefore,
`cacheSignal()` returns `null` when called outside of a React render
scope.
Notably the `signal` option passed to `renderToReadableStream` in both
SSR (Fizz) and RSC (Flight Server) is not the same instance that comes
out of `cacheSignal()`. If you abort the `signal` passed in, then the
`cacheSignal()` is also aborted with the same reason. However, the
`cacheSignal()` can also get aborted if the render completes
successfully or fatally errors during render - allowing any outstanding
work that wasn't used to clean up. In the future we might also expand on
this to give different
[`TaskSignal`](https://developer.mozilla.org/en-US/docs/Web/API/TaskSignal)
to different scopes to pass different render or network priorities.
On the client version of `"react"` this exposes a noop (both for
Fiber/Fizz) due to `disableClientCache` flag but it's exposed so that
you can write shared code.
DiffTrain build for [e1dc03492e](https://github.com/facebook/react/commit/e1dc03492eedaec517e14a6e32b8fda571d00767)
This commit is contained in:
@@ -1 +1 @@
|
||||
19.2.0-native-fb-75e78d24-20250616
|
||||
19.2.0-native-fb-e1dc0349-20250617
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<630c960e90cfb49f53ce703b43fc5058>>
|
||||
* @generated SignedSource<<81a28e2329322fca2be4855eed4d24f8>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -404,5 +404,5 @@ __DEV__ &&
|
||||
exports.useFormStatus = function () {
|
||||
return resolveDispatcher().useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
})();
|
||||
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<b9a3377d38a49313fb0fea5bdd9be663>>
|
||||
* @generated SignedSource<<95769ab918352fbbe251a5972deb853d>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
|
||||
exports.useFormStatus = function () {
|
||||
return ReactSharedInternals.H.useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<b9a3377d38a49313fb0fea5bdd9be663>>
|
||||
* @generated SignedSource<<95769ab918352fbbe251a5972deb853d>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
|
||||
exports.useFormStatus = function () {
|
||||
return ReactSharedInternals.H.useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
|
||||
Vendored
+9
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<109ba2365c1b7fa46fc043010b6feb5f>>
|
||||
* @generated SignedSource<<64c42466af3e6a72d9d65af3964750a6>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -26195,6 +26195,9 @@ __DEV__ &&
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
},
|
||||
getOwner: function () {
|
||||
return current;
|
||||
}
|
||||
@@ -27061,11 +27064,11 @@ __DEV__ &&
|
||||
};
|
||||
(function () {
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.2.0-native-fb-75e78d24-20250616" !== isomorphicReactPackageVersion)
|
||||
if ("19.2.0-native-fb-e1dc0349-20250617" !== isomorphicReactPackageVersion)
|
||||
throw Error(
|
||||
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
|
||||
(isomorphicReactPackageVersion +
|
||||
"\n - react-dom: 19.2.0-native-fb-75e78d24-20250616\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-dom: 19.2.0-native-fb-e1dc0349-20250617\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
})();
|
||||
("function" === typeof Map &&
|
||||
@@ -27102,10 +27105,10 @@ __DEV__ &&
|
||||
!(function () {
|
||||
var internals = {
|
||||
bundleType: 1,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
internals.overrideHookState = overrideHookState;
|
||||
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
|
||||
@@ -27243,5 +27246,5 @@ __DEV__ &&
|
||||
listenToAllSupportedEvents(container);
|
||||
return new ReactDOMHydrationRoot(initialChildren);
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
})();
|
||||
|
||||
compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js
Vendored
+9
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<d04189e38310f6ee8c3a98a1b2bed36b>>
|
||||
* @generated SignedSource<<b77d95e8151632567305939d0be77748>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -11333,6 +11333,9 @@ var DefaultAsyncDispatcher = {
|
||||
((cacheForType = resourceType()),
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
}
|
||||
},
|
||||
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
|
||||
@@ -17118,14 +17121,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
|
||||
};
|
||||
var isomorphicReactPackageVersion$jscomp$inline_2017 = React.version;
|
||||
if (
|
||||
"19.2.0-native-fb-75e78d24-20250616" !==
|
||||
"19.2.0-native-fb-e1dc0349-20250617" !==
|
||||
isomorphicReactPackageVersion$jscomp$inline_2017
|
||||
)
|
||||
throw Error(
|
||||
formatProdErrorMessage(
|
||||
527,
|
||||
isomorphicReactPackageVersion$jscomp$inline_2017,
|
||||
"19.2.0-native-fb-75e78d24-20250616"
|
||||
"19.2.0-native-fb-e1dc0349-20250617"
|
||||
)
|
||||
);
|
||||
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
@@ -17147,10 +17150,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
};
|
||||
var internals$jscomp$inline_2536 = {
|
||||
bundleType: 0,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2537 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -17248,4 +17251,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
|
||||
listenToAllSupportedEvents(container);
|
||||
return new ReactDOMHydrationRoot(initialChildren);
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
|
||||
+9
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<5fd386cdd936654f6c3f872ef12e82dd>>
|
||||
* @generated SignedSource<<111b97dd282b06a774640f89b8523600>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -11894,6 +11894,9 @@ var DefaultAsyncDispatcher = {
|
||||
((cacheForType = resourceType()),
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
}
|
||||
},
|
||||
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
|
||||
@@ -17828,14 +17831,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
|
||||
};
|
||||
var isomorphicReactPackageVersion$jscomp$inline_2120 = React.version;
|
||||
if (
|
||||
"19.2.0-native-fb-75e78d24-20250616" !==
|
||||
"19.2.0-native-fb-e1dc0349-20250617" !==
|
||||
isomorphicReactPackageVersion$jscomp$inline_2120
|
||||
)
|
||||
throw Error(
|
||||
formatProdErrorMessage(
|
||||
527,
|
||||
isomorphicReactPackageVersion$jscomp$inline_2120,
|
||||
"19.2.0-native-fb-75e78d24-20250616"
|
||||
"19.2.0-native-fb-e1dc0349-20250617"
|
||||
)
|
||||
);
|
||||
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
@@ -17857,10 +17860,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
};
|
||||
var internals$jscomp$inline_2127 = {
|
||||
bundleType: 0,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616",
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
getLaneLabelMap: function () {
|
||||
for (
|
||||
var map = new Map(), lane = 1, index$313 = 0;
|
||||
@@ -17973,4 +17976,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
|
||||
listenToAllSupportedEvents(container);
|
||||
return new ReactDOMHydrationRoot(initialChildren);
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
|
||||
+9
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<b06f747feceac8be51047297e0488527>>
|
||||
* @generated SignedSource<<323c0c817c416c5c3d9afafbc844fc15>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -26251,6 +26251,9 @@ __DEV__ &&
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
},
|
||||
getOwner: function () {
|
||||
return current;
|
||||
}
|
||||
@@ -27117,11 +27120,11 @@ __DEV__ &&
|
||||
};
|
||||
(function () {
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.2.0-native-fb-75e78d24-20250616" !== isomorphicReactPackageVersion)
|
||||
if ("19.2.0-native-fb-e1dc0349-20250617" !== isomorphicReactPackageVersion)
|
||||
throw Error(
|
||||
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
|
||||
(isomorphicReactPackageVersion +
|
||||
"\n - react-dom: 19.2.0-native-fb-75e78d24-20250616\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-dom: 19.2.0-native-fb-e1dc0349-20250617\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
})();
|
||||
("function" === typeof Map &&
|
||||
@@ -27158,10 +27161,10 @@ __DEV__ &&
|
||||
!(function () {
|
||||
var internals = {
|
||||
bundleType: 1,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
internals.overrideHookState = overrideHookState;
|
||||
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
|
||||
@@ -27615,7 +27618,7 @@ __DEV__ &&
|
||||
exports.useFormStatus = function () {
|
||||
return resolveDispatcher().useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
+9
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<a13cc681f4444fb472ffa96a00f80894>>
|
||||
* @generated SignedSource<<df7e8e78c8a62b1b35c75abeaf139b06>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -11333,6 +11333,9 @@ var DefaultAsyncDispatcher = {
|
||||
((cacheForType = resourceType()),
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
}
|
||||
},
|
||||
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
|
||||
@@ -17129,14 +17132,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
|
||||
};
|
||||
var isomorphicReactPackageVersion$jscomp$inline_2018 = React.version;
|
||||
if (
|
||||
"19.2.0-native-fb-75e78d24-20250616" !==
|
||||
"19.2.0-native-fb-e1dc0349-20250617" !==
|
||||
isomorphicReactPackageVersion$jscomp$inline_2018
|
||||
)
|
||||
throw Error(
|
||||
formatProdErrorMessage(
|
||||
527,
|
||||
isomorphicReactPackageVersion$jscomp$inline_2018,
|
||||
"19.2.0-native-fb-75e78d24-20250616"
|
||||
"19.2.0-native-fb-e1dc0349-20250617"
|
||||
)
|
||||
);
|
||||
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
@@ -17158,10 +17161,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
};
|
||||
var internals$jscomp$inline_2539 = {
|
||||
bundleType: 0,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2540 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -17412,4 +17415,4 @@ exports.useFormState = function (action, initialState, permalink) {
|
||||
exports.useFormStatus = function () {
|
||||
return ReactSharedInternals.H.useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
|
||||
+9
-6
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<cf408fad07f798041c15fc74734d89c5>>
|
||||
* @generated SignedSource<<fac43c09363a9138535d5da8fb04d68d>>
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -11898,6 +11898,9 @@ var DefaultAsyncDispatcher = {
|
||||
((cacheForType = resourceType()),
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
}
|
||||
},
|
||||
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
|
||||
@@ -17843,14 +17846,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
|
||||
};
|
||||
var isomorphicReactPackageVersion$jscomp$inline_2121 = React.version;
|
||||
if (
|
||||
"19.2.0-native-fb-75e78d24-20250616" !==
|
||||
"19.2.0-native-fb-e1dc0349-20250617" !==
|
||||
isomorphicReactPackageVersion$jscomp$inline_2121
|
||||
)
|
||||
throw Error(
|
||||
formatProdErrorMessage(
|
||||
527,
|
||||
isomorphicReactPackageVersion$jscomp$inline_2121,
|
||||
"19.2.0-native-fb-75e78d24-20250616"
|
||||
"19.2.0-native-fb-e1dc0349-20250617"
|
||||
)
|
||||
);
|
||||
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
@@ -17872,10 +17875,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
|
||||
};
|
||||
var internals$jscomp$inline_2128 = {
|
||||
bundleType: 0,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-dom",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616",
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
getLaneLabelMap: function () {
|
||||
for (
|
||||
var map = new Map(), lane = 1, index$313 = 0;
|
||||
@@ -18141,7 +18144,7 @@ exports.useFormState = function (action, initialState, permalink) {
|
||||
exports.useFormStatus = function () {
|
||||
return ReactSharedInternals.H.useHostTransitionStatus();
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
+7
-4
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<12150442b769f0fb84d725a8dd8ee196>>
|
||||
* @generated SignedSource<<b8a3bb6e31a093536faab3987c9e8a21>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -15407,6 +15407,9 @@ __DEV__ &&
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
},
|
||||
getOwner: function () {
|
||||
return current;
|
||||
}
|
||||
@@ -15705,10 +15708,10 @@ __DEV__ &&
|
||||
(function () {
|
||||
var internals = {
|
||||
bundleType: 1,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-test-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
internals.overrideHookState = overrideHookState;
|
||||
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
|
||||
@@ -15853,5 +15856,5 @@ __DEV__ &&
|
||||
flushSyncWorkAcrossRoots_impl(0, !0));
|
||||
}
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
})();
|
||||
|
||||
+7
-4
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<2c34fddf25beef74d8d77d18f5e6e3b1>>
|
||||
* @generated SignedSource<<a10c8df4633efa0525d2e63027633afa>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -8119,6 +8119,9 @@ var DefaultAsyncDispatcher = {
|
||||
((cacheForType = resourceType()),
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
}
|
||||
},
|
||||
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
|
||||
@@ -9902,10 +9905,10 @@ function wrapFiber(fiber) {
|
||||
}
|
||||
var internals$jscomp$inline_1447 = {
|
||||
bundleType: 0,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-test-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1448 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -10041,4 +10044,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
|
||||
flushSyncWorkAcrossRoots_impl(0, !0));
|
||||
}
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
|
||||
+7
-4
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<a21245e187a354e27c6cd46547bac93c>>
|
||||
* @generated SignedSource<<28481e2a5163e6793f7975712f4f4483>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -8615,6 +8615,9 @@ var DefaultAsyncDispatcher = {
|
||||
((cacheForType = resourceType()),
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
}
|
||||
},
|
||||
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
|
||||
@@ -10522,10 +10525,10 @@ function wrapFiber(fiber) {
|
||||
}
|
||||
var internals$jscomp$inline_1254 = {
|
||||
bundleType: 0,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-test-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616",
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
getLaneLabelMap: function () {
|
||||
for (
|
||||
var map = new Map(), lane = 1, index$155 = 0;
|
||||
@@ -10676,4 +10679,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
|
||||
flushSyncWorkAcrossRoots_impl(0, !0));
|
||||
}
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
|
||||
+5
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<a082ba08dfb335cedf1100fcd4b7dab8>>
|
||||
* @generated SignedSource<<896fd62bd26778de51cfe885e79232f4>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -1000,6 +1000,9 @@ __DEV__ &&
|
||||
return fn.apply(null, arguments);
|
||||
};
|
||||
};
|
||||
exports.cacheSignal = function () {
|
||||
return null;
|
||||
};
|
||||
exports.cloneElement = function (element, config, children) {
|
||||
if (null === element || void 0 === element)
|
||||
throw Error(
|
||||
@@ -1410,7 +1413,7 @@ __DEV__ &&
|
||||
exports.useTransition = function () {
|
||||
return resolveDispatcher().useTransition();
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
+5
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<103d6927e9005afd28ef051b67793c98>>
|
||||
* @generated SignedSource<<b7c0f8f451e02853cbae8a3dc9a33bfe>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -394,6 +394,9 @@ exports.cache = function (fn) {
|
||||
return fn.apply(null, arguments);
|
||||
};
|
||||
};
|
||||
exports.cacheSignal = function () {
|
||||
return null;
|
||||
};
|
||||
exports.captureOwnerStack = void 0;
|
||||
exports.cloneElement = function (element, config, children) {
|
||||
if (null === element || void 0 === element)
|
||||
@@ -586,4 +589,4 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactSharedInternals.H.useTransition();
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
|
||||
Vendored
+5
-2
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<80b822a95c4287b9c15c7a6b29f12344>>
|
||||
* @generated SignedSource<<0ea9cc0ddee169a595a620b59e035593>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -398,6 +398,9 @@ exports.cache = function (fn) {
|
||||
return fn.apply(null, arguments);
|
||||
};
|
||||
};
|
||||
exports.cacheSignal = function () {
|
||||
return null;
|
||||
};
|
||||
exports.captureOwnerStack = void 0;
|
||||
exports.cloneElement = function (element, config, children) {
|
||||
if (null === element || void 0 === element)
|
||||
@@ -590,7 +593,7 @@ exports.useSyncExternalStore = function (
|
||||
exports.useTransition = function () {
|
||||
return ReactSharedInternals.H.useTransition();
|
||||
};
|
||||
exports.version = "19.2.0-native-fb-75e78d24-20250616";
|
||||
exports.version = "19.2.0-native-fb-e1dc0349-20250617";
|
||||
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
||||
"function" ===
|
||||
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
75e78d243f749d009fa1c5c09c3464301b992718
|
||||
e1dc03492eedaec517e14a6e32b8fda571d00767
|
||||
|
||||
+6
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<261c21f008b70d3ce80fba3cd796d67f>>
|
||||
* @generated SignedSource<<4ff6d4797af53ed2867a5bb00e80014d>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -17121,6 +17121,9 @@ __DEV__ &&
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
},
|
||||
getOwner: function () {
|
||||
return current;
|
||||
}
|
||||
@@ -17580,10 +17583,10 @@ __DEV__ &&
|
||||
(function () {
|
||||
var internals = {
|
||||
bundleType: 1,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+6
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<a78dfcd529734941eb812c8b5b822f2a>>
|
||||
* @generated SignedSource<<a477486c3e228d29288912d2ca646059>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -9516,6 +9516,9 @@ var DefaultAsyncDispatcher = {
|
||||
((cacheForType = resourceType()),
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
}
|
||||
},
|
||||
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
|
||||
@@ -11261,10 +11264,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
var roots = new Map(),
|
||||
internals$jscomp$inline_1263 = {
|
||||
bundleType: 0,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals$jscomp$inline_1263.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+6
-3
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<5ed5a15461634ad18804688ef3972bd5>>
|
||||
* @generated SignedSource<<b4404b7aecf4ff82d3f1f8588dacf002>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -10059,6 +10059,9 @@ var DefaultAsyncDispatcher = {
|
||||
((cacheForType = resourceType()),
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
}
|
||||
},
|
||||
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
|
||||
@@ -11965,10 +11968,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
var roots = new Map(),
|
||||
internals$jscomp$inline_1364 = {
|
||||
bundleType: 0,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals$jscomp$inline_1364.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+8
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<f32b620dafbb0bc0fc8c182699213106>>
|
||||
* @generated SignedSource<<c5e5b554e1d76a09a181ecc5c56b2f61>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -17483,6 +17483,9 @@ __DEV__ &&
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
},
|
||||
getOwner: function () {
|
||||
return current;
|
||||
}
|
||||
@@ -17656,11 +17659,11 @@ __DEV__ &&
|
||||
shouldSuspendImpl = newShouldSuspendImpl;
|
||||
};
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.2.0-native-fb-75e78d24-20250616" !== isomorphicReactPackageVersion)
|
||||
if ("19.2.0-native-fb-e1dc0349-20250617" !== isomorphicReactPackageVersion)
|
||||
throw Error(
|
||||
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
|
||||
(isomorphicReactPackageVersion +
|
||||
"\n - react-native-renderer: 19.2.0-native-fb-75e78d24-20250616\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-native-renderer: 19.2.0-native-fb-e1dc0349-20250617\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
if (
|
||||
"function" !==
|
||||
@@ -17686,10 +17689,10 @@ __DEV__ &&
|
||||
(function () {
|
||||
var internals = {
|
||||
bundleType: 1,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+8
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<0d86b502d20d7b3f89c80e05d5dcd021>>
|
||||
* @generated SignedSource<<e833c56eb5a66672ac8dad683d87fc19>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -9726,6 +9726,9 @@ var DefaultAsyncDispatcher = {
|
||||
((cacheForType = resourceType()),
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
}
|
||||
},
|
||||
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
|
||||
@@ -11218,11 +11221,11 @@ function updateContainer(element, container, parentComponent, callback) {
|
||||
return lane;
|
||||
}
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.2.0-native-fb-75e78d24-20250616" !== isomorphicReactPackageVersion)
|
||||
if ("19.2.0-native-fb-e1dc0349-20250617" !== isomorphicReactPackageVersion)
|
||||
throw Error(
|
||||
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
|
||||
(isomorphicReactPackageVersion +
|
||||
"\n - react-native-renderer: 19.2.0-native-fb-75e78d24-20250616\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-native-renderer: 19.2.0-native-fb-e1dc0349-20250617\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
if (
|
||||
"function" !==
|
||||
@@ -11272,10 +11275,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
var roots = new Map(),
|
||||
internals$jscomp$inline_1307 = {
|
||||
bundleType: 0,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals$jscomp$inline_1307.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+8
-5
@@ -7,7 +7,7 @@
|
||||
* @noflow
|
||||
* @nolint
|
||||
* @preventMunge
|
||||
* @generated SignedSource<<860a6987b4dae76e902fd13a08c61776>>
|
||||
* @generated SignedSource<<b88f8a1204a4b414b4ee8f6f568ab5a9>>
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
@@ -10267,6 +10267,9 @@ var DefaultAsyncDispatcher = {
|
||||
((cacheForType = resourceType()),
|
||||
cache.data.set(resourceType, cacheForType));
|
||||
return cacheForType;
|
||||
},
|
||||
cacheSignal: function () {
|
||||
return readContext(CacheContext).controller.signal;
|
||||
}
|
||||
},
|
||||
PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map,
|
||||
@@ -11920,11 +11923,11 @@ function updateContainer(element, container, parentComponent, callback) {
|
||||
return lane;
|
||||
}
|
||||
var isomorphicReactPackageVersion = React.version;
|
||||
if ("19.2.0-native-fb-75e78d24-20250616" !== isomorphicReactPackageVersion)
|
||||
if ("19.2.0-native-fb-e1dc0349-20250617" !== isomorphicReactPackageVersion)
|
||||
throw Error(
|
||||
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
|
||||
(isomorphicReactPackageVersion +
|
||||
"\n - react-native-renderer: 19.2.0-native-fb-75e78d24-20250616\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
"\n - react-native-renderer: 19.2.0-native-fb-e1dc0349-20250617\nLearn more: https://react.dev/warnings/version-mismatch")
|
||||
);
|
||||
if (
|
||||
"function" !==
|
||||
@@ -11974,10 +11977,10 @@ batchedUpdatesImpl = function (fn, a) {
|
||||
var roots = new Map(),
|
||||
internals$jscomp$inline_1408 = {
|
||||
bundleType: 0,
|
||||
version: "19.2.0-native-fb-75e78d24-20250616",
|
||||
version: "19.2.0-native-fb-e1dc0349-20250617",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
currentDispatcherRef: ReactSharedInternals,
|
||||
reconcilerVersion: "19.2.0-native-fb-75e78d24-20250616"
|
||||
reconcilerVersion: "19.2.0-native-fb-e1dc0349-20250617"
|
||||
};
|
||||
null !== extraDevToolsConfig &&
|
||||
(internals$jscomp$inline_1408.rendererConfig = extraDevToolsConfig);
|
||||
|
||||
+57
-55
@@ -12,7 +12,7 @@
|
||||
* @lightSyntaxTransform
|
||||
* @preventMunge
|
||||
* @oncall react_core
|
||||
* @generated SignedSource<<870f00adc13ea8547e454cb0410e95d9>>
|
||||
* @generated SignedSource<<6f3965782e9227b96e955551e0d10967>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -49666,62 +49666,64 @@ function inlineImmediatelyInvokedFunctionExpressions(fn) {
|
||||
const inlinedFunctions = new Set();
|
||||
const queue = Array.from(fn.body.blocks.values());
|
||||
queue: for (const block of queue) {
|
||||
for (let ii = 0; ii < block.instructions.length; ii++) {
|
||||
const instr = block.instructions[ii];
|
||||
switch (instr.value.kind) {
|
||||
case 'FunctionExpression': {
|
||||
if (instr.lvalue.identifier.name === null) {
|
||||
functions.set(instr.lvalue.identifier.id, instr.value);
|
||||
if (isStatementBlockKind(block.kind)) {
|
||||
for (let ii = 0; ii < block.instructions.length; ii++) {
|
||||
const instr = block.instructions[ii];
|
||||
switch (instr.value.kind) {
|
||||
case 'FunctionExpression': {
|
||||
if (instr.lvalue.identifier.name === null) {
|
||||
functions.set(instr.lvalue.identifier.id, instr.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'CallExpression': {
|
||||
if (instr.value.args.length !== 0) {
|
||||
continue;
|
||||
case 'CallExpression': {
|
||||
if (instr.value.args.length !== 0) {
|
||||
continue;
|
||||
}
|
||||
const body = functions.get(instr.value.callee.identifier.id);
|
||||
if (body === undefined) {
|
||||
continue;
|
||||
}
|
||||
if (body.loweredFunc.func.params.length > 0 ||
|
||||
body.loweredFunc.func.async ||
|
||||
body.loweredFunc.func.generator) {
|
||||
continue;
|
||||
}
|
||||
inlinedFunctions.add(instr.value.callee.identifier.id);
|
||||
const continuationBlockId = fn.env.nextBlockId;
|
||||
const continuationBlock = {
|
||||
id: continuationBlockId,
|
||||
instructions: block.instructions.slice(ii + 1),
|
||||
kind: block.kind,
|
||||
phis: new Set(),
|
||||
preds: new Set(),
|
||||
terminal: block.terminal,
|
||||
};
|
||||
fn.body.blocks.set(continuationBlockId, continuationBlock);
|
||||
block.instructions.length = ii;
|
||||
const newTerminal = {
|
||||
block: body.loweredFunc.func.body.entry,
|
||||
id: makeInstructionId(0),
|
||||
kind: 'label',
|
||||
fallthrough: continuationBlockId,
|
||||
loc: block.terminal.loc,
|
||||
};
|
||||
block.terminal = newTerminal;
|
||||
const result = instr.lvalue;
|
||||
declareTemporary(fn.env, block, result);
|
||||
promoteTemporary(result.identifier);
|
||||
for (const [id, block] of body.loweredFunc.func.body.blocks) {
|
||||
block.preds.clear();
|
||||
rewriteBlock(fn.env, block, continuationBlockId, result);
|
||||
fn.body.blocks.set(id, block);
|
||||
}
|
||||
queue.push(continuationBlock);
|
||||
continue queue;
|
||||
}
|
||||
const body = functions.get(instr.value.callee.identifier.id);
|
||||
if (body === undefined) {
|
||||
continue;
|
||||
}
|
||||
if (body.loweredFunc.func.params.length > 0 ||
|
||||
body.loweredFunc.func.async ||
|
||||
body.loweredFunc.func.generator) {
|
||||
continue;
|
||||
}
|
||||
inlinedFunctions.add(instr.value.callee.identifier.id);
|
||||
const continuationBlockId = fn.env.nextBlockId;
|
||||
const continuationBlock = {
|
||||
id: continuationBlockId,
|
||||
instructions: block.instructions.slice(ii + 1),
|
||||
kind: block.kind,
|
||||
phis: new Set(),
|
||||
preds: new Set(),
|
||||
terminal: block.terminal,
|
||||
};
|
||||
fn.body.blocks.set(continuationBlockId, continuationBlock);
|
||||
block.instructions.length = ii;
|
||||
const newTerminal = {
|
||||
block: body.loweredFunc.func.body.entry,
|
||||
id: makeInstructionId(0),
|
||||
kind: 'label',
|
||||
fallthrough: continuationBlockId,
|
||||
loc: block.terminal.loc,
|
||||
};
|
||||
block.terminal = newTerminal;
|
||||
const result = instr.lvalue;
|
||||
declareTemporary(fn.env, block, result);
|
||||
promoteTemporary(result.identifier);
|
||||
for (const [id, block] of body.loweredFunc.func.body.blocks) {
|
||||
block.preds.clear();
|
||||
rewriteBlock(fn.env, block, continuationBlockId, result);
|
||||
fn.body.blocks.set(id, block);
|
||||
}
|
||||
queue.push(continuationBlock);
|
||||
continue queue;
|
||||
}
|
||||
default: {
|
||||
for (const place of eachInstructionValueOperand(instr.value)) {
|
||||
functions.delete(place.identifier.id);
|
||||
default: {
|
||||
for (const place of eachInstructionValueOperand(instr.value)) {
|
||||
functions.delete(place.identifier.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+57
-55
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
* @generated SignedSource<<2a9081e0196e1db500124884fc1203a5>>
|
||||
* @generated SignedSource<<6bd04f43c2c59c63845a3660db4ebd24>>
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@@ -49445,62 +49445,64 @@ function inlineImmediatelyInvokedFunctionExpressions(fn) {
|
||||
const inlinedFunctions = new Set();
|
||||
const queue = Array.from(fn.body.blocks.values());
|
||||
queue: for (const block of queue) {
|
||||
for (let ii = 0; ii < block.instructions.length; ii++) {
|
||||
const instr = block.instructions[ii];
|
||||
switch (instr.value.kind) {
|
||||
case 'FunctionExpression': {
|
||||
if (instr.lvalue.identifier.name === null) {
|
||||
functions.set(instr.lvalue.identifier.id, instr.value);
|
||||
if (isStatementBlockKind(block.kind)) {
|
||||
for (let ii = 0; ii < block.instructions.length; ii++) {
|
||||
const instr = block.instructions[ii];
|
||||
switch (instr.value.kind) {
|
||||
case 'FunctionExpression': {
|
||||
if (instr.lvalue.identifier.name === null) {
|
||||
functions.set(instr.lvalue.identifier.id, instr.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'CallExpression': {
|
||||
if (instr.value.args.length !== 0) {
|
||||
continue;
|
||||
case 'CallExpression': {
|
||||
if (instr.value.args.length !== 0) {
|
||||
continue;
|
||||
}
|
||||
const body = functions.get(instr.value.callee.identifier.id);
|
||||
if (body === undefined) {
|
||||
continue;
|
||||
}
|
||||
if (body.loweredFunc.func.params.length > 0 ||
|
||||
body.loweredFunc.func.async ||
|
||||
body.loweredFunc.func.generator) {
|
||||
continue;
|
||||
}
|
||||
inlinedFunctions.add(instr.value.callee.identifier.id);
|
||||
const continuationBlockId = fn.env.nextBlockId;
|
||||
const continuationBlock = {
|
||||
id: continuationBlockId,
|
||||
instructions: block.instructions.slice(ii + 1),
|
||||
kind: block.kind,
|
||||
phis: new Set(),
|
||||
preds: new Set(),
|
||||
terminal: block.terminal,
|
||||
};
|
||||
fn.body.blocks.set(continuationBlockId, continuationBlock);
|
||||
block.instructions.length = ii;
|
||||
const newTerminal = {
|
||||
block: body.loweredFunc.func.body.entry,
|
||||
id: makeInstructionId(0),
|
||||
kind: 'label',
|
||||
fallthrough: continuationBlockId,
|
||||
loc: block.terminal.loc,
|
||||
};
|
||||
block.terminal = newTerminal;
|
||||
const result = instr.lvalue;
|
||||
declareTemporary(fn.env, block, result);
|
||||
promoteTemporary(result.identifier);
|
||||
for (const [id, block] of body.loweredFunc.func.body.blocks) {
|
||||
block.preds.clear();
|
||||
rewriteBlock(fn.env, block, continuationBlockId, result);
|
||||
fn.body.blocks.set(id, block);
|
||||
}
|
||||
queue.push(continuationBlock);
|
||||
continue queue;
|
||||
}
|
||||
const body = functions.get(instr.value.callee.identifier.id);
|
||||
if (body === undefined) {
|
||||
continue;
|
||||
}
|
||||
if (body.loweredFunc.func.params.length > 0 ||
|
||||
body.loweredFunc.func.async ||
|
||||
body.loweredFunc.func.generator) {
|
||||
continue;
|
||||
}
|
||||
inlinedFunctions.add(instr.value.callee.identifier.id);
|
||||
const continuationBlockId = fn.env.nextBlockId;
|
||||
const continuationBlock = {
|
||||
id: continuationBlockId,
|
||||
instructions: block.instructions.slice(ii + 1),
|
||||
kind: block.kind,
|
||||
phis: new Set(),
|
||||
preds: new Set(),
|
||||
terminal: block.terminal,
|
||||
};
|
||||
fn.body.blocks.set(continuationBlockId, continuationBlock);
|
||||
block.instructions.length = ii;
|
||||
const newTerminal = {
|
||||
block: body.loweredFunc.func.body.entry,
|
||||
id: makeInstructionId(0),
|
||||
kind: 'label',
|
||||
fallthrough: continuationBlockId,
|
||||
loc: block.terminal.loc,
|
||||
};
|
||||
block.terminal = newTerminal;
|
||||
const result = instr.lvalue;
|
||||
declareTemporary(fn.env, block, result);
|
||||
promoteTemporary(result.identifier);
|
||||
for (const [id, block] of body.loweredFunc.func.body.blocks) {
|
||||
block.preds.clear();
|
||||
rewriteBlock(fn.env, block, continuationBlockId, result);
|
||||
fn.body.blocks.set(id, block);
|
||||
}
|
||||
queue.push(continuationBlock);
|
||||
continue queue;
|
||||
}
|
||||
default: {
|
||||
for (const place of eachInstructionValueOperand(instr.value)) {
|
||||
functions.delete(place.identifier.id);
|
||||
default: {
|
||||
for (const place of eachInstructionValueOperand(instr.value)) {
|
||||
functions.delete(place.identifier.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "eslint-plugin-react-hooks",
|
||||
"description": "ESLint rules for React Hooks",
|
||||
"version": "0.0.0-experimental-75e78d24-20250616",
|
||||
"version": "0.0.0-experimental-e1dc0349-20250617",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/react.git",
|
||||
|
||||
Reference in New Issue
Block a user