Skip to content

Commit

Permalink
Cleanup unused unstable_startTransition, unstable_useTransition, unst…
Browse files Browse the repository at this point in the history
…able_useDeferredValue exports from fb packages (#27056)

## Summary

came across these TODOs – an internal grep indicated that remaining
callsites have been cleaned up, so these can now be removed.

## How did you test this change?

```
yarn flow dom-browser
yarn test
```

DiffTrain build for [e91142d](e91142d)
  • Loading branch information
noahlemen committed Jul 5, 2023
1 parent f35b3c7 commit 446d798
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 139 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7118f5dd7bf5f1c44d0d2944ef8ad58e423909ad
e91142dd69b0454e0d4e934c55dd541344fe32ca
5 changes: 1 addition & 4 deletions compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-classic-cc85cd34";
var ReactVersion = "18.3.0-www-classic-739b12ac";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -4180,11 +4180,8 @@ exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
exports.unstable_act = act;
exports.unstable_getCacheForType = getCacheForType;
exports.unstable_getCacheSignal = getCacheSignal;
exports.unstable_startTransition = startTransition;
exports.unstable_useCacheRefresh = useCacheRefresh;
exports.unstable_useDeferredValue = useDeferredValue;
exports.unstable_useMemoCache = useMemoCache;
exports.unstable_useTransition = useTransition;
exports.use = use;
exports.useCallback = useCallback;
exports.useContext = useContext;
Expand Down
5 changes: 1 addition & 4 deletions compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-modern-01767f27";
var ReactVersion = "18.3.0-www-modern-d09ac638";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -4143,11 +4143,8 @@ exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
exports.unstable_act = act;
exports.unstable_getCacheForType = getCacheForType;
exports.unstable_getCacheSignal = getCacheSignal;
exports.unstable_startTransition = startTransition;
exports.unstable_useCacheRefresh = useCacheRefresh;
exports.unstable_useDeferredValue = useDeferredValue;
exports.unstable_useMemoCache = useMemoCache;
exports.unstable_useTransition = useTransition;
exports.use = use;
exports.useCallback = useCallback;
exports.useContext = useContext;
Expand Down
56 changes: 25 additions & 31 deletions compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,37 +282,17 @@ function createCacheRoot() {
function createCacheNode() {
return { s: 0, v: void 0, o: null, p: null };
}
var ReactCurrentDispatcher = { current: null };
function useTransition() {
return ReactCurrentDispatcher.current.useTransition();
}
function useDeferredValue(value) {
return ReactCurrentDispatcher.current.useDeferredValue(value);
}
var ReactCurrentBatchConfig = { transition: null },
var ReactCurrentDispatcher = { current: null },
ReactCurrentBatchConfig = { transition: null },
ReactSharedInternals = {
ReactCurrentDispatcher: ReactCurrentDispatcher,
ReactCurrentCache: ReactCurrentCache,
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
ReactCurrentOwner: ReactCurrentOwner$1,
ContextRegistry: {}
},
ContextRegistry = ReactSharedInternals.ContextRegistry;
function startTransition(scope, options) {
var prevTransition = ReactCurrentBatchConfig.transition;
ReactCurrentBatchConfig.transition = {};
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
scope();
} finally {
ReactCurrentBatchConfig.transition = prevTransition;
}
}
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner,
ContextRegistry = ReactSharedInternals.ContextRegistry,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner,
RESERVED_PROPS = { key: !0, ref: !0, __self: !0, __source: !0 };
function jsx$1(type, config, maybeKey) {
var propName,
Expand Down Expand Up @@ -544,7 +524,20 @@ exports.memo = function (type, compare) {
compare: void 0 === compare ? null : compare
};
};
exports.startTransition = startTransition;
exports.startTransition = function (scope, options) {
var prevTransition = ReactCurrentBatchConfig.transition;
ReactCurrentBatchConfig.transition = {};
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
scope();
} finally {
ReactCurrentBatchConfig.transition = prevTransition;
}
};
exports.unstable_Cache = REACT_CACHE_TYPE;
exports.unstable_DebugTracingMode = REACT_DEBUG_TRACING_MODE_TYPE;
exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE;
Expand All @@ -571,15 +564,12 @@ exports.unstable_getCacheSignal = function () {
),
dispatcher.signal);
};
exports.unstable_startTransition = startTransition;
exports.unstable_useCacheRefresh = function () {
return ReactCurrentDispatcher.current.useCacheRefresh();
};
exports.unstable_useDeferredValue = useDeferredValue;
exports.unstable_useMemoCache = function (size) {
return ReactCurrentDispatcher.current.useMemoCache(size);
};
exports.unstable_useTransition = useTransition;
exports.use = function (usable) {
return ReactCurrentDispatcher.current.use(usable);
};
Expand All @@ -590,7 +580,9 @@ exports.useContext = function (Context) {
return ReactCurrentDispatcher.current.useContext(Context);
};
exports.useDebugValue = function () {};
exports.useDeferredValue = useDeferredValue;
exports.useDeferredValue = function (value) {
return ReactCurrentDispatcher.current.useDeferredValue(value);
};
exports.useEffect = function (create, deps) {
return ReactCurrentDispatcher.current.useEffect(create, deps);
};
Expand Down Expand Up @@ -629,5 +621,7 @@ exports.useSyncExternalStore = function (
getServerSnapshot
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-classic-89dfcb69";
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-classic-80690551";
56 changes: 25 additions & 31 deletions compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,37 +249,17 @@ function createCacheRoot() {
function createCacheNode() {
return { s: 0, v: void 0, o: null, p: null };
}
var ReactCurrentDispatcher = { current: null };
function useTransition() {
return ReactCurrentDispatcher.current.useTransition();
}
function useDeferredValue(value) {
return ReactCurrentDispatcher.current.useDeferredValue(value);
}
var ReactCurrentBatchConfig = { transition: null },
var ReactCurrentDispatcher = { current: null },
ReactCurrentBatchConfig = { transition: null },
ReactSharedInternals = {
ReactCurrentDispatcher: ReactCurrentDispatcher,
ReactCurrentCache: ReactCurrentCache,
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
ReactCurrentOwner: ReactCurrentOwner$1,
ContextRegistry: {}
},
ContextRegistry = ReactSharedInternals.ContextRegistry;
function startTransition(scope, options) {
var prevTransition = ReactCurrentBatchConfig.transition;
ReactCurrentBatchConfig.transition = {};
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
scope();
} finally {
ReactCurrentBatchConfig.transition = prevTransition;
}
}
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner,
ContextRegistry = ReactSharedInternals.ContextRegistry,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner,
RESERVED_PROPS = { key: !0, ref: !0, __self: !0, __source: !0 };
function jsx$1(type, config, maybeKey) {
var propName,
Expand Down Expand Up @@ -537,7 +517,20 @@ exports.memo = function (type, compare) {
compare: void 0 === compare ? null : compare
};
};
exports.startTransition = startTransition;
exports.startTransition = function (scope, options) {
var prevTransition = ReactCurrentBatchConfig.transition;
ReactCurrentBatchConfig.transition = {};
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
scope();
} finally {
ReactCurrentBatchConfig.transition = prevTransition;
}
};
exports.unstable_Cache = REACT_CACHE_TYPE;
exports.unstable_DebugTracingMode = REACT_DEBUG_TRACING_MODE_TYPE;
exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE;
Expand All @@ -563,15 +556,12 @@ exports.unstable_getCacheSignal = function () {
),
dispatcher.signal);
};
exports.unstable_startTransition = startTransition;
exports.unstable_useCacheRefresh = function () {
return ReactCurrentDispatcher.current.useCacheRefresh();
};
exports.unstable_useDeferredValue = useDeferredValue;
exports.unstable_useMemoCache = function (size) {
return ReactCurrentDispatcher.current.useMemoCache(size);
};
exports.unstable_useTransition = useTransition;
exports.use = function (usable) {
return ReactCurrentDispatcher.current.use(usable);
};
Expand All @@ -582,7 +572,9 @@ exports.useContext = function (Context) {
return ReactCurrentDispatcher.current.useContext(Context);
};
exports.useDebugValue = function () {};
exports.useDeferredValue = useDeferredValue;
exports.useDeferredValue = function (value) {
return ReactCurrentDispatcher.current.useDeferredValue(value);
};
exports.useEffect = function (create, deps) {
return ReactCurrentDispatcher.current.useEffect(create, deps);
};
Expand Down Expand Up @@ -621,5 +613,7 @@ exports.useSyncExternalStore = function (
getServerSnapshot
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-modern-4c04bf5d";
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-modern-1670571e";
56 changes: 25 additions & 31 deletions compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,37 +293,17 @@ function createCacheRoot() {
function createCacheNode() {
return { s: 0, v: void 0, o: null, p: null };
}
var ReactCurrentDispatcher = { current: null };
function useTransition() {
return ReactCurrentDispatcher.current.useTransition();
}
function useDeferredValue(value) {
return ReactCurrentDispatcher.current.useDeferredValue(value);
}
var ReactCurrentBatchConfig = { transition: null },
var ReactCurrentDispatcher = { current: null },
ReactCurrentBatchConfig = { transition: null },
ReactSharedInternals = {
ReactCurrentDispatcher: ReactCurrentDispatcher,
ReactCurrentCache: ReactCurrentCache,
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
ReactCurrentOwner: ReactCurrentOwner$1,
ContextRegistry: {}
},
ContextRegistry = ReactSharedInternals.ContextRegistry;
function startTransition(scope, options) {
var prevTransition = ReactCurrentBatchConfig.transition;
ReactCurrentBatchConfig.transition = {};
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
scope();
} finally {
ReactCurrentBatchConfig.transition = prevTransition;
}
}
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner,
ContextRegistry = ReactSharedInternals.ContextRegistry,
ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner,
RESERVED_PROPS = { key: !0, ref: !0, __self: !0, __source: !0 };
function jsx$1(type, config, maybeKey) {
var propName,
Expand Down Expand Up @@ -555,7 +535,20 @@ exports.memo = function (type, compare) {
compare: void 0 === compare ? null : compare
};
};
exports.startTransition = startTransition;
exports.startTransition = function (scope, options) {
var prevTransition = ReactCurrentBatchConfig.transition;
ReactCurrentBatchConfig.transition = {};
enableTransitionTracing &&
void 0 !== options &&
void 0 !== options.name &&
((ReactCurrentBatchConfig.transition.name = options.name),
(ReactCurrentBatchConfig.transition.startTime = -1));
try {
scope();
} finally {
ReactCurrentBatchConfig.transition = prevTransition;
}
};
exports.unstable_Cache = REACT_CACHE_TYPE;
exports.unstable_DebugTracingMode = REACT_DEBUG_TRACING_MODE_TYPE;
exports.unstable_LegacyHidden = REACT_LEGACY_HIDDEN_TYPE;
Expand All @@ -582,15 +575,12 @@ exports.unstable_getCacheSignal = function () {
),
dispatcher.signal);
};
exports.unstable_startTransition = startTransition;
exports.unstable_useCacheRefresh = function () {
return ReactCurrentDispatcher.current.useCacheRefresh();
};
exports.unstable_useDeferredValue = useDeferredValue;
exports.unstable_useMemoCache = function (size) {
return ReactCurrentDispatcher.current.useMemoCache(size);
};
exports.unstable_useTransition = useTransition;
exports.use = function (usable) {
return ReactCurrentDispatcher.current.use(usable);
};
Expand All @@ -601,7 +591,9 @@ exports.useContext = function (Context) {
return ReactCurrentDispatcher.current.useContext(Context);
};
exports.useDebugValue = function () {};
exports.useDeferredValue = useDeferredValue;
exports.useDeferredValue = function (value) {
return ReactCurrentDispatcher.current.useDeferredValue(value);
};
exports.useEffect = function (create, deps) {
return ReactCurrentDispatcher.current.useEffect(create, deps);
};
Expand Down Expand Up @@ -640,8 +632,10 @@ exports.useSyncExternalStore = function (
getServerSnapshot
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-classic-5a120705";
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-www-classic-e0d9c072";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Loading

0 comments on commit 446d798

Please sign in to comment.