dillon1000/react

Commit

Reset profiler timer correctly after errors (#13123)

* Reset ReactProfilerTimer's DEV-only Fiber stack after an error

* Added ReactNoop functionality to error during "complete" phase

* Added failing profiler stack unwinding test

* Potential fix for unwinding time bug

* Renamed test

* Don't record time until complete phase succeeds. Simplifies unwinding.

* Expanded ReactProfilerDevToolsIntegration-test coverage a bit

* Added unstable_flushWithoutCommitting method to noop renderer

* Added failing multi-root/batch test to ReactProfiler-test

* Beefed up tests a bit and added some TODOs

* Profiler timer differentiates between batched commits and in-progress async work

This was a two-part change:
1) Don't count time spent working on a batched commit against yielded async work.
2) Don't assert an empty stack after processing a batched commit (because there may be yielded async work)

This is kind of a hacky solution, and may have problems that I haven't thought of yet. I need to commit this so I can mentally clock out for a bit without worrying about it. I will think about it more when I'm back from PTO. In the meanwhile, input is welcome.

* Removed TODO

* Replaced FiberRoot map with boolean

* Removed unnecessary whitespace edit
Browse files
Changed paths9 files
First-parent comparison
M packages/react-noop-renderer/src/createReactNoop.js ModifiedM packages/react-reconciler/src/ReactFiberCompleteWork.js ModifiedM packages/react-reconciler/src/ReactFiberScheduler.js ModifiedM packages/react-reconciler/src/ReactFiberUnwindWork.js ModifiedM packages/react-reconciler/src/ReactProfilerTimer.js ModifiedM packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js ModifiedM packages/react-reconciler/src/__tests__/ReactIncrementalErrorReplay-test.js ModifiedM packages/react/src/__tests__/ReactProfiler-test.internal.js ModifiedM packages/react/src/__tests__/ReactProfilerDevToolsIntegration-test.internal.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…