dillon1000/react

Commit

flushSync: Exhaust queue even if something throws (#26366)

If something throws as a result of `flushSync`, and there's remaining
work left in the queue, React should keep working until all the work is
complete.

If multiple errors are thrown, React will combine them into an
AggregateError object and throw that. In environments where
AggregateError is not available, React will rethrow in an async task.
(All the evergreen runtimes support AggregateError.)

The scenario where this happens is relatively rare, because `flushSync`
will only throw if there's no error boundary to capture the error.
Browse files
Changed paths12 files
First-parent comparison
M packages/react-reconciler/src/ReactFiberSyncTaskQueue.js ModifiedM packages/react-reconciler/src/__tests__/ReactFlushSync-test.js ModifiedA packages/react-reconciler/src/__tests__/ReactFlushSyncNoAggregateError-test.js AddedM packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js ModifiedM packages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js ModifiedM scripts/flow/environment.js ModifiedM scripts/rollup/validate/eslintrc.cjs.js ModifiedM scripts/rollup/validate/eslintrc.cjs2015.js ModifiedM scripts/rollup/validate/eslintrc.esm.js ModifiedM scripts/rollup/validate/eslintrc.fb.js ModifiedM scripts/rollup/validate/eslintrc.rn.js ModifiedM scripts/rollup/validate/eslintrc.umd.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…