Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup unused unstable_startTransition, unstable_useTransition, unstable_useDeferredValue exports from fb packages #27056

Merged
merged 3 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fixtures/concurrent/time-slicing/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {PureComponent, unstable_startTransition} from 'react';
import React, {PureComponent, startTransition} from 'react';
import {createRoot} from 'react-dom/client';
import _ from 'lodash';
import Charts from './Charts';
Expand Down Expand Up @@ -64,7 +64,7 @@ class App extends PureComponent {
}
this._ignoreClick = true;

unstable_startTransition(() => {
startTransition(() => {
this.setState({showDemo: true}, () => {
this._ignoreClick = false;
});
Expand Down Expand Up @@ -103,7 +103,7 @@ class App extends PureComponent {
break;
case 'async':
// TODO: useTransition hook instead.
unstable_startTransition(() => {
startTransition(() => {
this.setState({value});
});
break;
Expand Down
4 changes: 0 additions & 4 deletions packages/react/index.classic.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export {
StrictMode,
Suspense,
SuspenseList,
SuspenseList as unstable_SuspenseList, // TODO: Remove once call sights updated to SuspenseList
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one technically isn't stable yet, despite being used at Meta ("Stage 2.5"). If anything I'd remove the unprefixed one and keep the unstable one. You can move the alias to the wrapper module in Meta's repo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the main React package be exporting this as unstable_SuspenseList as well then?

https://github.com/facebook/react/blob/main/packages/react/src/React.js#L133

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll follow up with a separate PR for SuspenseList changes – if i remove just the SuspenseList export here without other changes we get CI failures

cloneElement,
createContext,
createElement,
Expand All @@ -32,7 +31,6 @@ export {
memo,
cache,
startTransition,
startTransition as unstable_startTransition, // TODO: Remove once call sights updated to startTransition
unstable_Cache,
unstable_TracingMarker,
unstable_DebugTracingMode,
Expand All @@ -48,7 +46,6 @@ export {
useContext,
useDebugValue,
useDeferredValue,
useDeferredValue as unstable_useDeferredValue, // TODO: Remove once call sights updated to useDeferredValue
useEffect,
experimental_useEffectEvent,
useImperativeHandle,
Expand All @@ -61,7 +58,6 @@ export {
useState,
useSyncExternalStore,
useTransition,
useTransition as unstable_useTransition, // TODO: Remove once call sights updated to useTransition
version,
} from './src/React';
export {jsx, jsxs, jsxDEV} from './src/jsx/ReactJSX';
4 changes: 0 additions & 4 deletions packages/react/index.modern.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export {
StrictMode,
Suspense,
SuspenseList,
SuspenseList as unstable_SuspenseList, // TODO: Remove once call sights updated to SuspenseList
cloneElement,
createContext,
createElement,
Expand All @@ -31,7 +30,6 @@ export {
memo,
cache,
startTransition,
startTransition as unstable_startTransition, // TODO: Remove once call sights updated to startTransition
unstable_Cache,
unstable_DebugTracingMode,
unstable_LegacyHidden,
Expand All @@ -46,7 +44,6 @@ export {
useContext,
useDebugValue,
useDeferredValue,
useDeferredValue as unstable_useDeferredValue, // TODO: Remove once call sights updated to useDeferredValue
useEffect,
experimental_useEffectEvent,
useImperativeHandle,
Expand All @@ -59,7 +56,6 @@ export {
useState,
useSyncExternalStore,
useTransition,
useTransition as unstable_useTransition, // TODO: Remove once call sights updated to useTransition
version,
} from './src/React';
export {jsx, jsxs, jsxDEV} from './src/jsx/ReactJSX';