GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Delete enableDiscreteEventFlushingChange (#21110) · react/react@a77dd13

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • react-dom/src/events
      • ReactDOMUpdateBatching.js
    • shared
      • ReactFeatureFlags.js
      • forks
        • ReactFeatureFlags.native-fb.js
        • ReactFeatureFlags.native-oss.js
        • ReactFeatureFlags.test-renderer.js
        • ReactFeatureFlags.test-renderer.native.js
        • ReactFeatureFlags.test-renderer.www.js
        • ReactFeatureFlags.testing.js
        • ReactFeatureFlags.testing.www.js
        • ReactFeatureFlags.www.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-dom/src/events/ReactDOMUpdateBatching.js‎

Copy file name to clipboardExpand all lines: packages/react-dom/src/events/ReactDOMUpdateBatching.js
+4-26Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
needsStateRestore,
1010
restoreStateIfNeeded,
1111
} from './ReactDOMControlledComponent';
12-
import {enableDiscreteEventFlushingChange} from 'shared/ReactFeatureFlags';
1312

1413
// Used as a way to call batchedUpdates when we don't have a reference to
1514
// the renderer. Such as when we're dispatching events or if third party
@@ -75,6 +74,7 @@ export function batchedEventUpdates(fn, a, b) {
7574
}
7675
}
7776

77+
// TODO: Replace with flushSync
7878
export function discreteUpdates(fn, a, b, c, d) {
7979
const prevIsInsideEventHandler = isInsideEventHandler;
8080
isInsideEventHandler = true;
@@ -88,32 +88,10 @@ export function discreteUpdates(fn, a, b, c, d) {
8888
}
8989
}
9090

91-
let lastFlushedEventTimeStamp = 0;
91+
// TODO: Replace with flushSync
9292
export function flushDiscreteUpdatesIfNeeded(timeStamp: number) {
93-
if (enableDiscreteEventFlushingChange) {
94-
// event.timeStamp isn't overly reliable due to inconsistencies in
95-
// how different browsers have historically provided the time stamp.
96-
// Some browsers provide high-resolution time stamps for all events,
97-
// some provide low-resolution time stamps for all events. FF < 52
98-
// even mixes both time stamps together. Some browsers even report
99-
// negative time stamps or time stamps that are 0 (iOS9) in some cases.
100-
// Given we are only comparing two time stamps with equality (!==),
101-
// we are safe from the resolution differences. If the time stamp is 0
102-
// we bail-out of preventing the flush, which can affect semantics,
103-
// such as if an earlier flush removes or adds event listeners that
104-
// are fired in the subsequent flush. However, this is the same
105-
// behaviour as we had before this change, so the risks are low.
106-
if (
107-
!isInsideEventHandler &&
108-
(timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)
109-
) {
110-
lastFlushedEventTimeStamp = timeStamp;
111-
flushDiscreteUpdatesImpl();
112-
}
113-
} else {
114-
if (!isInsideEventHandler) {
115-
flushDiscreteUpdatesImpl();
116-
}
93+
if (!isInsideEventHandler) {
94+
flushDiscreteUpdatesImpl();
11795
}
11896
}
11997

Collapse file

‎packages/shared/ReactFeatureFlags.js‎

Copy file name to clipboardExpand all lines: packages/shared/ReactFeatureFlags.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ export const enableLegacyFBSupport = false;
155155
// new behavior.
156156
export const deferRenderPhaseUpdateToNextBatch = true;
157157

158-
export const enableDiscreteEventFlushingChange = false;
159-
160158
export const enableUseRefAccessWarning = false;
161159

162160
export const enableRecursiveCommitTraversal = false;
Collapse file

‎packages/shared/forks/ReactFeatureFlags.native-fb.js‎

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.native-fb.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export const deletedTreeCleanUpLevel = 1;
5050

5151
export const enableNewReconciler = false;
5252
export const deferRenderPhaseUpdateToNextBatch = true;
53-
export const enableDiscreteEventFlushingChange = false;
5453

5554
export const enableStrictEffects = false;
5655
export const createRootStrictEffectsByDefault = false;
Collapse file

‎packages/shared/forks/ReactFeatureFlags.native-oss.js‎

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.native-oss.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deletedTreeCleanUpLevel = 1;
4949

5050
export const enableNewReconciler = false;
5151
export const deferRenderPhaseUpdateToNextBatch = true;
52-
export const enableDiscreteEventFlushingChange = false;
5352

5453
export const enableStrictEffects = false;
5554
export const createRootStrictEffectsByDefault = false;
Collapse file

‎packages/shared/forks/ReactFeatureFlags.test-renderer.js‎

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.test-renderer.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deletedTreeCleanUpLevel = 1;
4949

5050
export const enableNewReconciler = false;
5151
export const deferRenderPhaseUpdateToNextBatch = true;
52-
export const enableDiscreteEventFlushingChange = false;
5352

5453
export const enableStrictEffects = false;
5554
export const createRootStrictEffectsByDefault = false;
Collapse file

‎packages/shared/forks/ReactFeatureFlags.test-renderer.native.js‎

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.test-renderer.native.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deletedTreeCleanUpLevel = 1;
4949

5050
export const enableNewReconciler = false;
5151
export const deferRenderPhaseUpdateToNextBatch = true;
52-
export const enableDiscreteEventFlushingChange = false;
5352

5453
export const enableStrictEffects = false;
5554
export const createRootStrictEffectsByDefault = false;
Collapse file

‎packages/shared/forks/ReactFeatureFlags.test-renderer.www.js‎

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deletedTreeCleanUpLevel = 1;
4949

5050
export const enableNewReconciler = false;
5151
export const deferRenderPhaseUpdateToNextBatch = true;
52-
export const enableDiscreteEventFlushingChange = false;
5352

5453
export const enableStrictEffects = true;
5554
export const createRootStrictEffectsByDefault = false;
Collapse file

‎packages/shared/forks/ReactFeatureFlags.testing.js‎

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.testing.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deletedTreeCleanUpLevel = 1;
4949

5050
export const enableNewReconciler = false;
5151
export const deferRenderPhaseUpdateToNextBatch = true;
52-
export const enableDiscreteEventFlushingChange = false;
5352

5453
export const enableStrictEffects = false;
5554
export const createRootStrictEffectsByDefault = false;
Collapse file

‎packages/shared/forks/ReactFeatureFlags.testing.www.js‎

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.testing.www.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export const deletedTreeCleanUpLevel = 1;
4949

5050
export const enableNewReconciler = false;
5151
export const deferRenderPhaseUpdateToNextBatch = true;
52-
export const enableDiscreteEventFlushingChange = true;
5352

5453
export const enableStrictEffects = false;
5554
export const createRootStrictEffectsByDefault = false;
Collapse file

‎packages/shared/forks/ReactFeatureFlags.www.js‎

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.www.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ export const disableTextareaChildren = __EXPERIMENTAL__;
8383

8484
export const warnUnstableRenderSubtreeIntoContainer = false;
8585

86-
export const enableDiscreteEventFlushingChange = true;
87-
8886
// Enable forked reconciler. Piggy-backing on the "variant" global so that we
8987
// don't have to add another test dimension. The build system will compile this
9088
// to the correct value.

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.