Skip to content

Commit

Permalink
[be] Remove unused, experimental getCacheSignal API (#28706)
Browse files Browse the repository at this point in the history
Similar to #28698, this removes the `unstable_getCacheSignal()` API
since we don't intend to ship this to stable.

DiffTrain build for commit 8cb6a1c.
  • Loading branch information
josephsavona committed Apr 2, 2024
1 parent cc4e126 commit 94f98fd
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<42436c5e972cb03b026adac4f26b9197>>
* @generated SignedSource<<9f9d8986c9c03351ab1c1fe7b1b2c49a>>
*/

"use strict";
Expand Down Expand Up @@ -22505,11 +22505,6 @@ if (__DEV__) {
}
}

function getCacheSignal() {
var cache = readContext(CacheContext);
return cache.controller.signal;
}

function getCacheForType(resourceType) {
var cache = readContext(CacheContext);
var cacheForType = cache.data.get(resourceType);
Expand All @@ -22523,7 +22518,6 @@ if (__DEV__) {
}

var DefaultCacheDispatcher = {
getCacheSignal: getCacheSignal,
getCacheForType: getCacheForType
};

Expand Down Expand Up @@ -26809,7 +26803,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-canary-4a355ff9";
var ReactVersion = "19.0.0-canary-b7882942";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<7ac197948521e47e5a2da9b0dae35269>>
* @generated SignedSource<<e4701c4b1e7e4760d099380352d197f6>>
*/

"use strict";
Expand Down Expand Up @@ -7405,9 +7405,6 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
}
}
var DefaultCacheDispatcher = {
getCacheSignal: function () {
return readContext(CacheContext).controller.signal;
},
getCacheForType: function (resourceType) {
var cache = readContext(CacheContext),
cacheForType = cache.data.get(resourceType);
Expand Down Expand Up @@ -9201,7 +9198,7 @@ var devToolsConfig$jscomp$inline_992 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-canary-b78d8890",
version: "19.0.0-canary-88ad4c2a",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1180 = {
Expand Down Expand Up @@ -9232,7 +9229,7 @@ var internals$jscomp$inline_1180 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-b78d8890"
reconcilerVersion: "19.0.0-canary-88ad4c2a"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1181 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<a70ea58db09502275f7ba43d5cdee6ae>>
* @generated SignedSource<<ad89a1ac37c132044f425e22b31f19c8>>
*/

"use strict";
Expand Down Expand Up @@ -7877,9 +7877,6 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
}
}
var DefaultCacheDispatcher = {
getCacheSignal: function () {
return readContext(CacheContext).controller.signal;
},
getCacheForType: function (resourceType) {
var cache = readContext(CacheContext),
cacheForType = cache.data.get(resourceType);
Expand Down Expand Up @@ -9819,7 +9816,7 @@ var devToolsConfig$jscomp$inline_1076 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-canary-4e13c867",
version: "19.0.0-canary-153a5857",
rendererPackageName: "react-test-renderer"
};
(function (internals) {
Expand Down Expand Up @@ -9863,7 +9860,7 @@ var devToolsConfig$jscomp$inline_1076 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-4e13c867"
reconcilerVersion: "19.0.0-canary-153a5857"
});
exports._Scheduler = Scheduler;
exports.act = act;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<f6c84bf1921e7e8ae7d4eac966e4e55f>>
* @generated SignedSource<<81a3185ee1038a29c67be8ea0fa5da53>>
*/

"use strict";
Expand All @@ -26,7 +26,7 @@ if (__DEV__) {
}
var dynamicFlagsUntyped = require("ReactNativeInternalFeatureFlags");

var ReactVersion = "19.0.0-canary-c952bafb";
var ReactVersion = "19.0.0-canary-45dc54bd";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -2944,27 +2944,6 @@ if (__DEV__) {
return dispatcher;
}

function getCacheSignal() {
var dispatcher = ReactCurrentCache.current;

if (!dispatcher) {
// If we have no cache to associate with this call, then we don't know
// its lifetime. We abort early since that's safer than letting it live
// for ever. Unlike just caching which can be a functional noop outside
// of React, these should generally always be associated with some React
// render but we're not limiting quite as much as making it a Hook.
// It's safer than erroring early at runtime.
var controller = new AbortController();
var reason = new Error(
"This CacheSignal was requested outside React which means that it is " +
"immediately aborted."
);
controller.abort(reason);
return controller.signal;
}

return dispatcher.getCacheSignal();
}
function getCacheForType(resourceType) {
var dispatcher = ReactCurrentCache.current;

Expand Down Expand Up @@ -3640,7 +3619,6 @@ if (__DEV__) {
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
exports.unstable_getCacheForType = getCacheForType;
exports.unstable_getCacheSignal = getCacheSignal;
exports.unstable_useCacheRefresh = useCacheRefresh;
exports.unstable_useMemoCache = useMemoCache;
exports.use = use;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<4d62414ddfd6f7eb3ca9d918bf686921>>
* @generated SignedSource<<a0c5e9721f01c57ba5fae0bcf2a88296>>
*/

"use strict";
Expand Down Expand Up @@ -571,18 +571,6 @@ exports.unstable_getCacheForType = function (resourceType) {
var dispatcher = ReactCurrentCache.current;
return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();
};
exports.unstable_getCacheSignal = function () {
var dispatcher = ReactCurrentCache.current;
return dispatcher
? dispatcher.getCacheSignal()
: ((dispatcher = new AbortController()),
dispatcher.abort(
Error(
"This CacheSignal was requested outside React which means that it is immediately aborted."
)
),
dispatcher.signal);
};
exports.unstable_useCacheRefresh = function () {
return ReactCurrentDispatcher.current.useCacheRefresh();
};
Expand Down Expand Up @@ -655,4 +643,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "19.0.0-canary-6446e904";
exports.version = "19.0.0-canary-d7125c20";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<849c048328a890d86bad5a8956d27c43>>
* @generated SignedSource<<b5c3bd06cefe8e8c6b930dcaaef5f86a>>
*/

"use strict";
Expand Down Expand Up @@ -573,18 +573,6 @@ exports.unstable_getCacheForType = function (resourceType) {
var dispatcher = ReactCurrentCache.current;
return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();
};
exports.unstable_getCacheSignal = function () {
var dispatcher = ReactCurrentCache.current;
return dispatcher
? dispatcher.getCacheSignal()
: ((dispatcher = new AbortController()),
dispatcher.abort(
Error(
"This CacheSignal was requested outside React which means that it is immediately aborted."
)
),
dispatcher.signal);
};
exports.unstable_useCacheRefresh = function () {
return ReactCurrentDispatcher.current.useCacheRefresh();
};
Expand Down Expand Up @@ -657,7 +645,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "19.0.0-canary-2f767b28";
exports.version = "19.0.0-canary-e9e47b60";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7319c61b18274ee7e7c20bd2e533b93c922d8fe0
8cb6a1c0347a69ad4c580c5cf5f28d8be544d6d4
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<3e3ed9765dda9f3c6023ab53e91bd9f2>>
* @generated SignedSource<<f5c4ec68410b21b678043b63f0d988dc>>
*/

"use strict";
Expand Down Expand Up @@ -26043,11 +26043,6 @@ to return true:wantsResponderID| |
}
}

function getCacheSignal() {
var cache = readContext(CacheContext);
return cache.controller.signal;
}

function getCacheForType(resourceType) {
var cache = readContext(CacheContext);
var cacheForType = cache.data.get(resourceType);
Expand All @@ -26061,7 +26056,6 @@ to return true:wantsResponderID| |
}

var DefaultCacheDispatcher = {
getCacheSignal: getCacheSignal,
getCacheForType: getCacheForType
};

Expand Down Expand Up @@ -30579,7 +30573,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "19.0.0-canary-187f2f09";
var ReactVersion = "19.0.0-canary-0f204b29";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<53f0c6b6504a10433786b5f29d2fd80a>>
* @generated SignedSource<<7d726b31ddcda58c8e9067319a1c0ba0>>
*/

"use strict";
Expand Down Expand Up @@ -8954,9 +8954,6 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
}
}
var DefaultCacheDispatcher = {
getCacheSignal: function () {
return readContext(CacheContext).controller.signal;
},
getCacheForType: function (resourceType) {
var cache = readContext(CacheContext),
cacheForType = cache.data.get(resourceType);
Expand Down Expand Up @@ -10620,7 +10617,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1094 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "19.0.0-canary-e039c15e",
version: "19.0.0-canary-62b40297",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10663,7 +10660,7 @@ var internals$jscomp$inline_1331 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-e039c15e"
reconcilerVersion: "19.0.0-canary-62b40297"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1332 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<8c624a39a5ea9b24da7b85bd960521b9>>
* @generated SignedSource<<b30b8c3c0bc975f939a4c8ff85041129>>
*/

"use strict";
Expand Down Expand Up @@ -9483,9 +9483,6 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
}
}
var DefaultCacheDispatcher = {
getCacheSignal: function () {
return readContext(CacheContext).controller.signal;
},
getCacheForType: function (resourceType) {
var cache = readContext(CacheContext),
cacheForType = cache.data.get(resourceType);
Expand Down Expand Up @@ -11327,7 +11324,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1176 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "19.0.0-canary-56dfcbcb",
version: "19.0.0-canary-f31d9db0",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -11383,7 +11380,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-56dfcbcb"
reconcilerVersion: "19.0.0-canary-f31d9db0"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5e46c43de7b093e049773ab4bc4628fb>>
* @generated SignedSource<<b4fc5df79fb17a2da678b5f79de50f7e>>
*/

"use strict";
Expand Down Expand Up @@ -26481,11 +26481,6 @@ to return true:wantsResponderID| |
}
}

function getCacheSignal() {
var cache = readContext(CacheContext);
return cache.controller.signal;
}

function getCacheForType(resourceType) {
var cache = readContext(CacheContext);
var cacheForType = cache.data.get(resourceType);
Expand All @@ -26499,7 +26494,6 @@ to return true:wantsResponderID| |
}

var DefaultCacheDispatcher = {
getCacheSignal: getCacheSignal,
getCacheForType: getCacheForType
};

Expand Down Expand Up @@ -31019,7 +31013,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "19.0.0-canary-e3c7b66e";
var ReactVersion = "19.0.0-canary-753ddd75";

function createPortal$1(
children,
Expand Down
Loading

0 comments on commit 94f98fd

Please sign in to comment.