GeezerVison is showing github.com — Remove flag that reverts #15650 (#16372) · react/react@3eeb645
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/ReactFiberClassComponent.js -10Lines changed: 0 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -55,7 +55,6 @@ import { | 55 | 55 | scheduleWork, | 56 | 56 | flushPassiveEffects, | 57 | 57 | } from './ReactFiberWorkLoop'; | 58 | | -import {revertPassiveEffectsChange} from 'shared/ReactFeatureFlags'; | 59 | 58 | import {requestCurrentSuspenseConfig} from './ReactFiberSuspenseConfig'; | 60 | 59 |
| 61 | 60 | const fakeInternalInstance = {}; | @@ -202,9 +201,6 @@ const classComponentUpdater = { | 202 | 201 | update.callback = callback; | 203 | 202 | } | 204 | 203 |
| 205 | | - if (revertPassiveEffectsChange) { | 206 | | - flushPassiveEffects(); | 207 | | - } | 208 | 204 | enqueueUpdate(fiber, update); | 209 | 205 | scheduleWork(fiber, expirationTime); | 210 | 206 | }, | @@ -229,9 +225,6 @@ const classComponentUpdater = { | 229 | 225 | update.callback = callback; | 230 | 226 | } | 231 | 227 |
| 232 | | - if (revertPassiveEffectsChange) { | 233 | | - flushPassiveEffects(); | 234 | | - } | 235 | 228 | enqueueUpdate(fiber, update); | 236 | 229 | scheduleWork(fiber, expirationTime); | 237 | 230 | }, | @@ -255,9 +248,6 @@ const classComponentUpdater = { | 255 | 248 | update.callback = callback; | 256 | 249 | } | 257 | 250 |
| 258 | | - if (revertPassiveEffectsChange) { | 259 | | - flushPassiveEffects(); | 260 | | - } | 261 | 251 | enqueueUpdate(fiber, update); | 262 | 252 | scheduleWork(fiber, expirationTime); | 263 | 253 | }, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberHooks.js -5Lines changed: 0 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -51,7 +51,6 @@ import warning from 'shared/warning'; | 51 | 51 | import getComponentName from 'shared/getComponentName'; | 52 | 52 | import is from 'shared/objectIs'; | 53 | 53 | import {markWorkInProgressReceivedUpdate} from './ReactFiberBeginWork'; | 54 | | -import {revertPassiveEffectsChange} from 'shared/ReactFeatureFlags'; | 55 | 54 | import {requestCurrentSuspenseConfig} from './ReactFiberSuspenseConfig'; | 56 | 55 | import {getCurrentPriorityLevel} from './SchedulerWithReactIntegration'; | 57 | 56 |
| @@ -1166,10 +1165,6 @@ function dispatchAction<S, A>( | 1166 | 1165 | lastRenderPhaseUpdate.next = update; | 1167 | 1166 | } | 1168 | 1167 | } else { | 1169 | | - if (revertPassiveEffectsChange) { | 1170 | | - flushPassiveEffects(); | 1171 | | - } | 1172 | | - | 1173 | 1168 | const currentTime = requestCurrentTime(); | 1174 | 1169 | const suspenseConfig = requestCurrentSuspenseConfig(); | 1175 | 1170 | const expirationTime = computeExpirationForFiber( | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberReconciler.js -14Lines changed: 0 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -70,7 +70,6 @@ import { | 70 | 70 | } from './ReactCurrentFiber'; | 71 | 71 | import {StrictMode} from './ReactTypeOfMode'; | 72 | 72 | import {Sync} from './ReactFiberExpirationTime'; | 73 | | -import {revertPassiveEffectsChange} from 'shared/ReactFeatureFlags'; | 74 | 73 | import {requestCurrentSuspenseConfig} from './ReactFiberSuspenseConfig'; | 75 | 74 | import { | 76 | 75 | scheduleRefresh, | @@ -167,9 +166,6 @@ function scheduleRootUpdate( | 167 | 166 | update.callback = callback; | 168 | 167 | } | 169 | 168 |
| 170 | | - if (revertPassiveEffectsChange) { | 171 | | - flushPassiveEffects(); | 172 | | - } | 173 | 169 | enqueueUpdate(current, update); | 174 | 170 | scheduleWork(current, expirationTime); | 175 | 171 |
| @@ -434,10 +430,6 @@ if (__DEV__) { | 434 | 430 | id--; | 435 | 431 | } | 436 | 432 | if (currentHook !== null) { | 437 | | - if (revertPassiveEffectsChange) { | 438 | | - flushPassiveEffects(); | 439 | | - } | 440 | | - | 441 | 433 | const newState = copyWithSet(currentHook.memoizedState, path, value); | 442 | 434 | currentHook.memoizedState = newState; | 443 | 435 | currentHook.baseState = newState; | @@ -455,9 +447,6 @@ if (__DEV__) { | 455 | 447 |
| 456 | 448 | // Support DevTools props for function components, forwardRef, memo, host components, etc. | 457 | 449 | overrideProps = (fiber: Fiber, path: Array<string | number>, value: any) => { | 458 | | - if (revertPassiveEffectsChange) { | 459 | | - flushPassiveEffects(); | 460 | | - } | 461 | 450 | fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value); | 462 | 451 | if (fiber.alternate) { | 463 | 452 | fiber.alternate.pendingProps = fiber.pendingProps; | @@ -466,9 +455,6 @@ if (__DEV__) { | 466 | 455 | }; | 467 | 456 |
| 468 | 457 | scheduleUpdate = (fiber: Fiber) => { | 469 | | - if (revertPassiveEffectsChange) { | 470 | | - flushPassiveEffects(); | 471 | | - } | 472 | 458 | scheduleWork(fiber, Sync); | 473 | 459 | }; | 474 | 460 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.js +3-6Lines changed: 3 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -24,7 +24,6 @@ import { | 24 | 24 | replayFailedUnitOfWorkWithInvokeGuardedCallback, | 25 | 25 | enableProfilerTimer, | 26 | 26 | enableSchedulerTracing, | 27 | | - revertPassiveEffectsChange, | 28 | 27 | warnAboutUnmockedScheduler, | 29 | 28 | flushSuspenseFallbacksInTests, | 30 | 29 | disableSchedulerTimeoutBasedOnReactExpirationTime, | @@ -621,11 +620,9 @@ export function flushDiscreteUpdates() { | 621 | 620 | return; | 622 | 621 | } | 623 | 622 | flushPendingDiscreteUpdates(); | 624 | | - if (!revertPassiveEffectsChange) { | 625 | | - // If the discrete updates scheduled passive effects, flush them now so that | 626 | | - // they fire before the next serial event. | 627 | | - flushPassiveEffects(); | 628 | | - } | | 623 | + // If the discrete updates scheduled passive effects, flush them now so that | | 624 | + // they fire before the next serial event. | | 625 | + flushPassiveEffects(); | 629 | 626 | } | 630 | 627 |
| 631 | 628 | function resolveLocksOnRoot(root: FiberRoot, expirationTime: ExpirationTime) { | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.internal.js -43Lines changed: 0 additions & 43 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2170,47 +2170,4 @@ describe('ReactHooksWithNoopRenderer', () => { | 2170 | 2170 | expect(Scheduler).toHaveYielded(['Step: 5, Shadow: 5']); | 2171 | 2171 | expect(ReactNoop).toMatchRenderedOutput('5'); | 2172 | 2172 | }); | 2173 | | - | 2174 | | - describe('revertPassiveEffectsChange', () => { | 2175 | | - it('flushes serial effects before enqueueing work', () => { | 2176 | | - jest.resetModules(); | 2177 | | - | 2178 | | - ReactFeatureFlags = require('shared/ReactFeatureFlags'); | 2179 | | - ReactFeatureFlags.debugRenderPhaseSideEffectsForStrictMode = false; | 2180 | | - ReactFeatureFlags.enableSchedulerTracing = true; | 2181 | | - ReactFeatureFlags.revertPassiveEffectsChange = true; | 2182 | | - React = require('react'); | 2183 | | - ReactNoop = require('react-noop-renderer'); | 2184 | | - Scheduler = require('scheduler'); | 2185 | | - SchedulerTracing = require('scheduler/tracing'); | 2186 | | - useState = React.useState; | 2187 | | - useEffect = React.useEffect; | 2188 | | - act = ReactNoop.act; | 2189 | | - | 2190 | | - let _updateCount; | 2191 | | - function Counter(props) { | 2192 | | - const [count, updateCount] = useState(0); | 2193 | | - _updateCount = updateCount; | 2194 | | - useEffect(() => { | 2195 | | - Scheduler.unstable_yieldValue(`Will set count to 1`); | 2196 | | - updateCount(1); | 2197 | | - }, []); | 2198 | | - return <Text text={'Count: ' + count} />; | 2199 | | - } | 2200 | | - | 2201 | | - act(() => { | 2202 | | - ReactNoop.render(<Counter count={0} />, () => | 2203 | | - Scheduler.unstable_yieldValue('Sync effect'), | 2204 | | - ); | 2205 | | - expect(Scheduler).toFlushAndYieldThrough(['Count: 0', 'Sync effect']); | 2206 | | - expect(ReactNoop.getChildren()).toEqual([span('Count: 0')]); | 2207 | | - // Enqueuing this update forces the passive effect to be flushed -- | 2208 | | - // updateCount(1) happens first, so 2 wins. | 2209 | | - act(() => _updateCount(2)); | 2210 | | - expect(Scheduler).toHaveYielded(['Will set count to 1']); | 2211 | | - expect(Scheduler).toFlushAndYield(['Count: 2']); | 2212 | | - expect(ReactNoop.getChildren()).toEqual([span('Count: 2')]); | 2213 | | - }); | 2214 | | - }); | 2215 | | - }); | 2216 | 2173 | }); |
Collapse file Copy file name to clipboardExpand all lines: packages/shared/ReactFeatureFlags.js -2Lines changed: 0 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -71,8 +71,6 @@ export const enableJSXTransformAPI = false; | 71 | 71 | // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?) | 72 | 72 | // Till then, we warn about the missing mock, but still fallback to a sync mode compatible version | 73 | 73 | export const warnAboutUnmockedScheduler = false; | 74 | | -// Temporary flag to revert the fix in #15650 | 75 | | -export const revertPassiveEffectsChange = false; | 76 | 74 |
| 77 | 75 | // For tests, we flush suspense fallbacks in an act scope; | 78 | 76 | // *except* in some of our own tests, where we test incremental loading states. | |
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 |
|---|
@@ -35,7 +35,6 @@ export const enableFlareAPI = false; | 35 | 35 | export const enableFundamentalAPI = false; | 36 | 36 | export const enableJSXTransformAPI = false; | 37 | 37 | export const warnAboutUnmockedScheduler = true; | 38 | | -export const revertPassiveEffectsChange = false; | 39 | 38 | export const flushSuspenseFallbacksInTests = true; | 40 | 39 | export const enableUserBlockingEvents = false; | 41 | 40 | export const enableSuspenseCallback = false; | |
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 |
|---|
@@ -30,7 +30,6 @@ export const enableFlareAPI = false; | 30 | 30 | export const enableFundamentalAPI = false; | 31 | 31 | export const enableJSXTransformAPI = false; | 32 | 32 | export const warnAboutUnmockedScheduler = false; | 33 | | -export const revertPassiveEffectsChange = false; | 34 | 33 | export const flushSuspenseFallbacksInTests = true; | 35 | 34 | export const enableUserBlockingEvents = false; | 36 | 35 | export const enableSuspenseCallback = false; | |
Collapse file Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.persistent.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,7 +30,6 @@ export const enableFlareAPI = false; | 30 | 30 | export const enableFundamentalAPI = false; | 31 | 31 | export const enableJSXTransformAPI = false; | 32 | 32 | export const warnAboutUnmockedScheduler = true; | 33 | | -export const revertPassiveEffectsChange = false; | 34 | 33 | export const flushSuspenseFallbacksInTests = true; | 35 | 34 | export const enableUserBlockingEvents = false; | 36 | 35 | export const enableSuspenseCallback = false; | |
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 |
|---|
@@ -30,7 +30,6 @@ export const enableFlareAPI = false; | 30 | 30 | export const enableFundamentalAPI = false; | 31 | 31 | export const enableJSXTransformAPI = false; | 32 | 32 | export const warnAboutUnmockedScheduler = false; | 33 | | -export const revertPassiveEffectsChange = false; | 34 | 33 | export const flushSuspenseFallbacksInTests = true; | 35 | 34 | export const enableUserBlockingEvents = false; | 36 | 35 | export const enableSuspenseCallback = false; | |
|