GeezerVison is showing github.com — Land warnOnSubscriptionInsideStartTransition flag (#23353) · react/react@b3f3da2
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberHooks.new.js +1-6Lines changed: 1 addition & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -109,7 +109,6 @@ import { | 109 | 109 | entangleTransitions as entangleLegacyQueueTransitions, | 110 | 110 | } from './ReactUpdateQueue.new'; | 111 | 111 | import {pushInterleavedQueue} from './ReactFiberInterleavedUpdates.new'; | 112 | | -import {warnOnSubscriptionInsideStartTransition} from 'shared/ReactFeatureFlags'; | 113 | 112 | import {getTreeId} from './ReactFiberTreeContext.new'; | 114 | 113 |
| 115 | 114 | const {ReactCurrentDispatcher, ReactCurrentBatchConfig} = ReactSharedInternals; | @@ -1992,11 +1991,7 @@ function startTransition(setPending, callback) { | 1992 | 1991 |
| 1993 | 1992 | ReactCurrentBatchConfig.transition = prevTransition; | 1994 | 1993 | if (__DEV__) { | 1995 | | - if ( | 1996 | | - prevTransition === null && | 1997 | | - warnOnSubscriptionInsideStartTransition && | 1998 | | - currentTransition._updatedFibers | 1999 | | - ) { | | 1994 | + if (prevTransition === null && currentTransition._updatedFibers) { | 2000 | 1995 | const updatedFibersCount = currentTransition._updatedFibers.size; | 2001 | 1996 | if (updatedFibersCount > 10) { | 2002 | 1997 | console.warn( | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberHooks.old.js +1-6Lines changed: 1 addition & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -109,7 +109,6 @@ import { | 109 | 109 | entangleTransitions as entangleLegacyQueueTransitions, | 110 | 110 | } from './ReactUpdateQueue.old'; | 111 | 111 | import {pushInterleavedQueue} from './ReactFiberInterleavedUpdates.old'; | 112 | | -import {warnOnSubscriptionInsideStartTransition} from 'shared/ReactFeatureFlags'; | 113 | 112 | import {getTreeId} from './ReactFiberTreeContext.old'; | 114 | 113 |
| 115 | 114 | const {ReactCurrentDispatcher, ReactCurrentBatchConfig} = ReactSharedInternals; | @@ -1992,11 +1991,7 @@ function startTransition(setPending, callback) { | 1992 | 1991 |
| 1993 | 1992 | ReactCurrentBatchConfig.transition = prevTransition; | 1994 | 1993 | if (__DEV__) { | 1995 | | - if ( | 1996 | | - prevTransition === null && | 1997 | | - warnOnSubscriptionInsideStartTransition && | 1998 | | - currentTransition._updatedFibers | 1999 | | - ) { | | 1994 | + if (prevTransition === null && currentTransition._updatedFibers) { | 2000 | 1995 | const updatedFibersCount = currentTransition._updatedFibers.size; | 2001 | 1996 | if (updatedFibersCount > 10) { | 2002 | 1997 | console.warn( | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.new.js +1-6Lines changed: 1 addition & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -31,7 +31,6 @@ import { | 31 | 31 | disableSchedulerTimeoutInWorkLoop, | 32 | 32 | enableStrictEffects, | 33 | 33 | enableUpdaterTracking, | 34 | | - warnOnSubscriptionInsideStartTransition, | 35 | 34 | enableCache, | 36 | 35 | } from 'shared/ReactFeatureFlags'; | 37 | 36 | import ReactSharedInternals from 'shared/ReactSharedInternals'; | @@ -397,11 +396,7 @@ export function requestUpdateLane(fiber: Fiber): Lane { | 397 | 396 |
| 398 | 397 | const isTransition = requestCurrentTransition() !== NoTransition; | 399 | 398 | if (isTransition) { | 400 | | - if ( | 401 | | - __DEV__ && | 402 | | - warnOnSubscriptionInsideStartTransition && | 403 | | - ReactCurrentBatchConfig.transition !== null | 404 | | - ) { | | 399 | + if (__DEV__ && ReactCurrentBatchConfig.transition !== null) { | 405 | 400 | const transition = ReactCurrentBatchConfig.transition; | 406 | 401 | if (!transition._updatedFibers) { | 407 | 402 | transition._updatedFibers = new Set(); | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.old.js +1-6Lines changed: 1 addition & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -31,7 +31,6 @@ import { | 31 | 31 | disableSchedulerTimeoutInWorkLoop, | 32 | 32 | enableStrictEffects, | 33 | 33 | enableUpdaterTracking, | 34 | | - warnOnSubscriptionInsideStartTransition, | 35 | 34 | enableCache, | 36 | 35 | } from 'shared/ReactFeatureFlags'; | 37 | 36 | import ReactSharedInternals from 'shared/ReactSharedInternals'; | @@ -397,11 +396,7 @@ export function requestUpdateLane(fiber: Fiber): Lane { | 397 | 396 |
| 398 | 397 | const isTransition = requestCurrentTransition() !== NoTransition; | 399 | 398 | if (isTransition) { | 400 | | - if ( | 401 | | - __DEV__ && | 402 | | - warnOnSubscriptionInsideStartTransition && | 403 | | - ReactCurrentBatchConfig.transition !== null | 404 | | - ) { | | 399 | + if (__DEV__ && ReactCurrentBatchConfig.transition !== null) { | 405 | 400 | const transition = ReactCurrentBatchConfig.transition; | 406 | 401 | if (!transition._updatedFibers) { | 407 | 402 | transition._updatedFibers = new Set(); | |
Collapse file Copy file name to clipboardExpand all lines: packages/react/src/ReactStartTransition.js +1-6Lines changed: 1 addition & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | */ | 9 | 9 |
| 10 | 10 | import ReactCurrentBatchConfig from './ReactCurrentBatchConfig'; | 11 | | -import {warnOnSubscriptionInsideStartTransition} from 'shared/ReactFeatureFlags'; | 12 | 11 |
| 13 | 12 | export function startTransition(scope: () => void) { | 14 | 13 | const prevTransition = ReactCurrentBatchConfig.transition; | @@ -24,11 +23,7 @@ export function startTransition(scope: () => void) { | 24 | 23 | ReactCurrentBatchConfig.transition = prevTransition; | 25 | 24 |
| 26 | 25 | if (__DEV__) { | 27 | | - if ( | 28 | | - prevTransition === null && | 29 | | - warnOnSubscriptionInsideStartTransition && | 30 | | - currentTransition._updatedFibers | 31 | | - ) { | | 26 | + if (prevTransition === null && currentTransition._updatedFibers) { | 32 | 27 | const updatedFibersCount = currentTransition._updatedFibers.size; | 33 | 28 | if (updatedFibersCount > 10) { | 34 | 29 | console.warn( | |
Collapse file Copy file name to clipboardExpand all lines: packages/react/src/__tests__/ReactStartTransition-test.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,6 @@ describe('ReactStartTransition', () => { | 27 | 27 | useTransition = React.useTransition; | 28 | 28 | }); | 29 | 29 |
| 30 | | - // @gate warnOnSubscriptionInsideStartTransition || !__DEV__ | 31 | 30 | it('Warns if a suspicious number of fibers are updated inside startTransition', () => { | 32 | 31 | const subs = new Set(); | 33 | 32 | const useUserSpaceSubscription = () => { | |
Collapse file Copy file name to clipboardExpand all lines: packages/shared/ReactFeatureFlags.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 | // Flags that can likely be deleted or landed without consequences | 14 | 14 | // ----------------------------------------------------------------------------- | 15 | 15 |
| 16 | | -export const warnOnSubscriptionInsideStartTransition = false; | 17 | 16 | export const enableSuspenseServerRenderer = true; | 18 | 17 | export const enableSelectiveHydration = true; | 19 | 18 | export const warnAboutDeprecatedLifecycles = true; | |
Collapse file Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.native-fb.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -49,7 +49,6 @@ export const disableTextareaChildren = false; | 49 | 49 | export const disableModulePatternComponents = false; | 50 | 50 | export const warnUnstableRenderSubtreeIntoContainer = false; | 51 | 51 | export const warnAboutSpreadingKeyToJSX = false; | 52 | | -export const warnOnSubscriptionInsideStartTransition = false; | 53 | 52 | export const enableSuspenseAvoidThisFallback = false; | 54 | 53 | export const enableSuspenseAvoidThisFallbackFizz = false; | 55 | 54 | export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true; | |
Collapse file Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.native-oss.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -40,7 +40,6 @@ export const disableTextareaChildren = false; | 40 | 40 | export const disableModulePatternComponents = false; | 41 | 41 | export const warnUnstableRenderSubtreeIntoContainer = false; | 42 | 42 | export const warnAboutSpreadingKeyToJSX = false; | 43 | | -export const warnOnSubscriptionInsideStartTransition = false; | 44 | 43 | export const enableSuspenseAvoidThisFallback = false; | 45 | 44 | export const enableSuspenseAvoidThisFallbackFizz = false; | 46 | 45 | export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true; | |
Collapse file Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.test-renderer.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -40,7 +40,6 @@ export const disableTextareaChildren = false; | 40 | 40 | export const disableModulePatternComponents = false; | 41 | 41 | export const warnUnstableRenderSubtreeIntoContainer = false; | 42 | 42 | export const warnAboutSpreadingKeyToJSX = false; | 43 | | -export const warnOnSubscriptionInsideStartTransition = false; | 44 | 43 | export const enableSuspenseAvoidThisFallback = false; | 45 | 44 | export const enableSuspenseAvoidThisFallbackFizz = false; | 46 | 45 | export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true; | |
|