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 [8cb6a1c](8cb6a1c)
  • Loading branch information
josephsavona committed Apr 2, 2024
1 parent 385c181 commit 8a319a6
Show file tree
Hide file tree
Showing 31 changed files with 49 additions and 261 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
48ec17b865f439754fcdaa289ef0aa98f15a05c2
8cb6a1c0347a69ad4c580c5cf5f28d8be544d6d4
24 changes: 1 addition & 23 deletions compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "19.0.0-www-classic-da16f573";
var ReactVersion = "19.0.0-www-classic-c27d3e58";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -2976,27 +2976,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 @@ -3670,7 +3649,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
24 changes: 1 addition & 23 deletions compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "19.0.0-www-modern-f04454d4";
var ReactVersion = "19.0.0-www-modern-5ccfe516";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -2976,27 +2976,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 @@ -3669,7 +3648,6 @@ if (__DEV__) {
exports.unstable_Scope = REACT_SCOPE_TYPE;
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
exports.unstable_getCacheForType = getCacheForType;
exports.unstable_getCacheSignal = getCacheSignal;
exports.unstable_useCacheRefresh = useCacheRefresh;
exports.unstable_useMemoCache = useMemoCache;
exports.use = use;
Expand Down
14 changes: 1 addition & 13 deletions compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,18 +576,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 @@ -658,4 +646,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "19.0.0-www-classic-6c6f69ff";
exports.version = "19.0.0-www-classic-091663c2";
14 changes: 1 addition & 13 deletions compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,18 +574,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 @@ -656,4 +644,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "19.0.0-www-modern-763d5ed6";
exports.version = "19.0.0-www-modern-f4b5ac1e";
14 changes: 1 addition & 13 deletions compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,18 +580,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 @@ -662,7 +650,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "19.0.0-www-classic-1734cffd";
exports.version = "19.0.0-www-classic-1eaf4ddd";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
14 changes: 1 addition & 13 deletions compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,18 +578,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 @@ -660,7 +648,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "19.0.0-www-modern-1bb0db64";
exports.version = "19.0.0-www-modern-2111cb84";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
8 changes: 1 addition & 7 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}

var ReactVersion = "19.0.0-www-classic-9edd2970";
var ReactVersion = "19.0.0-www-classic-cbebd2c1";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -25722,11 +25722,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 @@ -25740,7 +25735,6 @@ if (__DEV__) {
}

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

Expand Down
8 changes: 1 addition & 7 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (__DEV__) {
return self;
}

var ReactVersion = "19.0.0-www-modern-5aabb0c4";
var ReactVersion = "19.0.0-www-modern-62398be5";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -25381,11 +25381,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 @@ -25399,7 +25394,6 @@ if (__DEV__) {
}

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

Expand Down
7 changes: 2 additions & 5 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -8882,9 +8882,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 @@ -10600,7 +10597,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "19.0.0-www-classic-8f84997a",
version: "19.0.0-www-classic-aebe0d0d",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1314 = {
Expand Down Expand Up @@ -10631,7 +10628,7 @@ var internals$jscomp$inline_1314 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-classic-8f84997a"
reconcilerVersion: "19.0.0-www-classic-aebe0d0d"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1315 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
7 changes: 2 additions & 5 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -8583,9 +8583,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 @@ -10257,7 +10254,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "19.0.0-www-modern-d9e4c872",
version: "19.0.0-www-modern-ee94f26b",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1294 = {
Expand Down Expand Up @@ -10288,7 +10285,7 @@ var internals$jscomp$inline_1294 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-www-modern-d9e4c872"
reconcilerVersion: "19.0.0-www-modern-ee94f26b"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1295 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
8 changes: 1 addition & 7 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -31245,11 +31245,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 @@ -31263,7 +31258,6 @@ if (__DEV__) {
}

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

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

var ReactVersion = "19.0.0-www-classic-fd4e175d";
var ReactVersion = "19.0.0-www-classic-6e35fd06";

function createPortal$1(
children,
Expand Down
8 changes: 1 addition & 7 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -31102,11 +31102,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 @@ -31120,7 +31115,6 @@ if (__DEV__) {
}

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

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

var ReactVersion = "19.0.0-www-modern-0973d70b";
var ReactVersion = "19.0.0-www-modern-e8cb623a";

function createPortal$1(
children,
Expand Down
Loading

0 comments on commit 8a319a6

Please sign in to comment.