GeezerVison is showing github.com — Land enableSetImmediate feature flag (#20906) · react/react@d857f9e
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/scheduler/src/SchedulerFeatureFlags.js -3Lines changed: 0 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | export const enableSchedulerDebugging = false; | 10 | 10 | export const enableIsInputPending = false; | 11 | 11 | export const enableProfiling = __VARIANT__; | 12 | | - | 13 | | -// TODO: enable to fix https://github.com/facebook/react/issues/20756. | 14 | | -export const enableSetImmediate = __VARIANT__; |
Collapse file Copy file name to clipboardExpand all lines: packages/scheduler/src/__tests__/SchedulerDOMSetImmediate-test.js -8Lines changed: 0 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -143,7 +143,6 @@ describe('SchedulerDOMSetImmediate', () => { | 143 | 143 | }; | 144 | 144 | } | 145 | 145 |
| 146 | | - // @gate enableSchedulerSetImmediate | 147 | 146 | it('task that finishes before deadline', () => { | 148 | 147 | scheduleCallback(NormalPriority, () => { | 149 | 148 | runtime.log('Task'); | @@ -153,7 +152,6 @@ describe('SchedulerDOMSetImmediate', () => { | 153 | 152 | runtime.assertLog(['setImmediate Callback', 'Task']); | 154 | 153 | }); | 155 | 154 |
| 156 | | - // @gate enableSchedulerSetImmediate | 157 | 155 | it('task with continuation', () => { | 158 | 156 | scheduleCallback(NormalPriority, () => { | 159 | 157 | runtime.log('Task'); | @@ -179,7 +177,6 @@ describe('SchedulerDOMSetImmediate', () => { | 179 | 177 | runtime.assertLog(['setImmediate Callback', 'Continuation']); | 180 | 178 | }); | 181 | 179 |
| 182 | | - // @gate enableSchedulerSetImmediate | 183 | 180 | it('multiple tasks', () => { | 184 | 181 | scheduleCallback(NormalPriority, () => { | 185 | 182 | runtime.log('A'); | @@ -192,7 +189,6 @@ describe('SchedulerDOMSetImmediate', () => { | 192 | 189 | runtime.assertLog(['setImmediate Callback', 'A', 'B']); | 193 | 190 | }); | 194 | 191 |
| 195 | | - // @gate enableSchedulerSetImmediate | 196 | 192 | it('multiple tasks with a yield in between', () => { | 197 | 193 | scheduleCallback(NormalPriority, () => { | 198 | 194 | runtime.log('A'); | @@ -213,7 +209,6 @@ describe('SchedulerDOMSetImmediate', () => { | 213 | 209 | runtime.assertLog(['setImmediate Callback', 'B']); | 214 | 210 | }); | 215 | 211 |
| 216 | | - // @gate enableSchedulerSetImmediate | 217 | 212 | it('cancels tasks', () => { | 218 | 213 | const task = scheduleCallback(NormalPriority, () => { | 219 | 214 | runtime.log('Task'); | @@ -223,7 +218,6 @@ describe('SchedulerDOMSetImmediate', () => { | 223 | 218 | runtime.assertLog([]); | 224 | 219 | }); | 225 | 220 |
| 226 | | - // @gate enableSchedulerSetImmediate | 227 | 221 | it('throws when a task errors then continues in a new event', () => { | 228 | 222 | scheduleCallback(NormalPriority, () => { | 229 | 223 | runtime.log('Oops!'); | @@ -241,7 +235,6 @@ describe('SchedulerDOMSetImmediate', () => { | 241 | 235 | runtime.assertLog(['setImmediate Callback', 'Yay']); | 242 | 236 | }); | 243 | 237 |
| 244 | | - // @gate enableSchedulerSetImmediate | 245 | 238 | it('schedule new task after queue has emptied', () => { | 246 | 239 | scheduleCallback(NormalPriority, () => { | 247 | 240 | runtime.log('A'); | @@ -259,7 +252,6 @@ describe('SchedulerDOMSetImmediate', () => { | 259 | 252 | runtime.assertLog(['setImmediate Callback', 'B']); | 260 | 253 | }); | 261 | 254 |
| 262 | | - // @gate enableSchedulerSetImmediate | 263 | 255 | it('schedule new task after a cancellation', () => { | 264 | 256 | const handle = scheduleCallback(NormalPriority, () => { | 265 | 257 | runtime.log('A'); | |
Collapse file Copy file name to clipboardExpand all lines: packages/scheduler/src/forks/SchedulerDOM.js +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 11 | 11 | import { | 12 | 12 | enableSchedulerDebugging, | 13 | 13 | enableProfiling, | 14 | | - enableSetImmediate, | 15 | 14 | } from '../SchedulerFeatureFlags'; | 16 | 15 |
| 17 | 16 | import {push, pop, peek} from '../SchedulerMinHeap'; | @@ -553,7 +552,7 @@ const performWorkUntilDeadline = () => { | 553 | 552 | }; | 554 | 553 |
| 555 | 554 | let schedulePerformWorkUntilDeadline; | 556 | | -if (enableSetImmediate && typeof setImmediate === 'function') { | | 555 | +if (typeof setImmediate === 'function') { | 557 | 556 | // Node.js and old IE. | 558 | 557 | // There's a few reasons for why we prefer setImmediate. | 559 | 558 | // | |
Collapse file Copy file name to clipboardExpand all lines: packages/scheduler/src/forks/SchedulerFeatureFlags.www.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,6 @@ export const { | 10 | 10 | enableIsInputPending, | 11 | 11 | enableSchedulerDebugging, | 12 | 12 | enableProfiling: enableProfilingFeatureFlag, | 13 | | - enableSetImmediate, | 14 | 13 | } = require('SchedulerFeatureFlags'); | 15 | 14 |
| 16 | 15 | export const enableProfiling = __PROFILE__ && enableProfilingFeatureFlag; |
Collapse file Copy file name to clipboardExpand all lines: scripts/jest/TestFlags.js -5Lines changed: 0 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -55,7 +55,6 @@ function getTestFlags() { | 55 | 55 | // These are required on demand because some of our tests mutate them. We try | 56 | 56 | // not to but there are exceptions. | 57 | 57 | const featureFlags = require('shared/ReactFeatureFlags'); | 58 | | - const schedulerFeatureFlags = require('scheduler/src/SchedulerFeatureFlags'); | 59 | 58 |
| 60 | 59 | // TODO: This is a heuristic to detect the release channel by checking a flag | 61 | 60 | // that is known to only be enabled in www. What we should do instead is set | @@ -90,10 +89,6 @@ function getTestFlags() { | 90 | 89 | // tests, Jest doesn't expose the API correctly. Fix then remove | 91 | 90 | // this override. | 92 | 91 | enableCache: __EXPERIMENTAL__, | 93 | | - | 94 | | - // This is from SchedulerFeatureFlags. Needed because there's no equivalent | 95 | | - // of ReactFeatureFlags-www.dynamic for it. Remove when enableSetImmediate is gone. | 96 | | - enableSchedulerSetImmediate: schedulerFeatureFlags.enableSetImmediate, | 97 | 92 | }, | 98 | 93 | { | 99 | 94 | get(flags, flagName) { | |
|