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 — Enable eager listeners in open source (#19716) · react/react@b754caa

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • react-dom/src/__tests__
      • ReactDOMFiber-test.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-dynamic.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-dom/src/__tests__/ReactDOMFiber-test.js‎

Copy file name to clipboardExpand all lines: packages/react-dom/src/__tests__/ReactDOMFiber-test.js
+13-5Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,8 @@ describe('ReactDOMFiber', () => {
10971097
});
10981098

10991099
it('should not update event handlers until commit', () => {
1100+
spyOnDev(console, 'error');
1101+
11001102
let ops = [];
11011103
const handlerA = () => ops.push('A');
11021104
const handlerB = () => ops.push('B');
@@ -1129,11 +1131,7 @@ describe('ReactDOMFiber', () => {
11291131
class Click extends React.Component {
11301132
constructor() {
11311133
super();
1132-
expect(() => {
1133-
node.click();
1134-
}).toErrorDev(
1135-
'Warning: unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.',
1136-
);
1134+
node.click();
11371135
}
11381136
render() {
11391137
return null;
@@ -1183,6 +1181,16 @@ describe('ReactDOMFiber', () => {
11831181
// Any click that happens after commit, should invoke A.
11841182
click();
11851183
expect(ops).toEqual(['A']);
1184+
1185+
if (__DEV__) {
1186+
// TODO: this warning shouldn't be firing in the first place if user didn't call it.
1187+
const errorCalls = console.error.calls.count();
1188+
for (let i = 0; i < errorCalls; i++) {
1189+
expect(console.error.calls.argsFor(i)[0]).toMatch(
1190+
'unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering.',
1191+
);
1192+
}
1193+
}
11861194
});
11871195

11881196
it('should not crash encountering low-priority tree', () => {
Collapse file

‎packages/shared/ReactFeatureFlags.js‎

Copy file name to clipboardExpand all lines: packages/shared/ReactFeatureFlags.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ export const enableDiscreteEventFlushingChange = false;
137137
export const enablePassiveEventIntervention = true;
138138
export const disableOnScrollBubbling = true;
139139

140-
export const enableEagerRootListeners = false;
140+
export const enableEagerRootListeners = true;
Collapse file

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

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.native-fb.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const deferRenderPhaseUpdateToNextBatch = true;
5151
export const decoupleUpdatePriorityFromScheduler = false;
5252
export const enableDiscreteEventFlushingChange = false;
5353
export const enablePassiveEventIntervention = true;
54-
export const enableEagerRootListeners = false;
54+
export const enableEagerRootListeners = true;
5555

5656
// Flow magic to verify the exports of this file match the original version.
5757
// eslint-disable-next-line no-unused-vars
Collapse file

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

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.native-oss.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const deferRenderPhaseUpdateToNextBatch = true;
5050
export const decoupleUpdatePriorityFromScheduler = false;
5151
export const enableDiscreteEventFlushingChange = false;
5252
export const enablePassiveEventIntervention = true;
53-
export const enableEagerRootListeners = false;
53+
export const enableEagerRootListeners = true;
5454

5555
// Flow magic to verify the exports of this file match the original version.
5656
// eslint-disable-next-line no-unused-vars
Collapse file

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

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.test-renderer.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const deferRenderPhaseUpdateToNextBatch = true;
5050
export const decoupleUpdatePriorityFromScheduler = false;
5151
export const enableDiscreteEventFlushingChange = false;
5252
export const enablePassiveEventIntervention = true;
53-
export const enableEagerRootListeners = false;
53+
export const enableEagerRootListeners = true;
5454

5555
// Flow magic to verify the exports of this file match the original version.
5656
// eslint-disable-next-line no-unused-vars
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
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const deferRenderPhaseUpdateToNextBatch = true;
4949
export const decoupleUpdatePriorityFromScheduler = false;
5050
export const enableDiscreteEventFlushingChange = false;
5151
export const enablePassiveEventIntervention = true;
52-
export const enableEagerRootListeners = false;
52+
export const enableEagerRootListeners = true;
5353

5454
// Flow magic to verify the exports of this file match the original version.
5555
// eslint-disable-next-line no-unused-vars
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
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const deferRenderPhaseUpdateToNextBatch = true;
5050
export const decoupleUpdatePriorityFromScheduler = false;
5151
export const enableDiscreteEventFlushingChange = false;
5252
export const enablePassiveEventIntervention = true;
53-
export const enableEagerRootListeners = false;
53+
export const enableEagerRootListeners = true;
5454

5555
// Flow magic to verify the exports of this file match the original version.
5656
// eslint-disable-next-line no-unused-vars
Collapse file

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

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.testing.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const deferRenderPhaseUpdateToNextBatch = true;
5050
export const decoupleUpdatePriorityFromScheduler = false;
5151
export const enableDiscreteEventFlushingChange = false;
5252
export const enablePassiveEventIntervention = true;
53-
export const enableEagerRootListeners = false;
53+
export const enableEagerRootListeners = true;
5454

5555
// Flow magic to verify the exports of this file match the original version.
5656
// eslint-disable-next-line no-unused-vars
Collapse file

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

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.testing.www.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const deferRenderPhaseUpdateToNextBatch = true;
5050
export const decoupleUpdatePriorityFromScheduler = false;
5151
export const enableDiscreteEventFlushingChange = true;
5252
export const enablePassiveEventIntervention = true;
53-
export const enableEagerRootListeners = false;
53+
export const enableEagerRootListeners = true;
5454

5555
// Flow magic to verify the exports of this file match the original version.
5656
// eslint-disable-next-line no-unused-vars
Collapse file

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

Copy file name to clipboardExpand all lines: packages/shared/forks/ReactFeatureFlags.www-dynamic.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const decoupleUpdatePriorityFromScheduler = __VARIANT__;
2121
export const skipUnmountedBoundaries = __VARIANT__;
2222
export const enablePassiveEventIntervention = __VARIANT__;
2323
export const disableOnScrollBubbling = __VARIANT__;
24-
export const enableEagerRootListeners = __VARIANT__;
24+
export const enableEagerRootListeners = !__VARIANT__;
2525

2626
// Enable this flag to help with concurrent mode debugging.
2727
// It logs information to the console about React scheduling, rendering, and commit phases.

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.