Skip to content

Commit

Permalink
Refactored how React/DevTools log Timeline performance data
Browse files Browse the repository at this point in the history
Until now, DEV and PROFILING builds of React recorded Timeline profiling data using the User Timing V3 API. This commit changes things so that React records this data by calling methods on the DevTools hook. (For now, DevTools still records that data using the User Timing V3 API, to match previous behavior.)

This commit is mostly moving around a lot of things:
* New methods have been added to the DevTools hook (in "backend/profilingHooks") for recording the Timeline perfromance events.
* Reconciler's "ReactFiberDevToolsHook" has been updated to call these new methods (when they're present).
* User Timing method calls in "SchedulingProfiler" have been moved to DevTools "backend/profilingHooks" (to match previous behavior, for now).
* The old reconciler tests, "SchedulingProfiler-test" and "SchedulingProfilerLabels-test", have been moved into DevTools "TimelineProfiler-test".
* Two new methods have been added to the injected renderer interface: "injectProfilingHooks" and "getLaneLabelMap"
  • Loading branch information
Brian Vaughn committed Jan 12, 2022
1 parent 2f26eb8 commit b59af84
Show file tree
Hide file tree
Showing 25 changed files with 2,262 additions and 1,678 deletions.
4 changes: 4 additions & 0 deletions packages/react-devtools-shared/src/__tests__/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,7 @@ env.afterEach(() => {
// so that we don't disconnect the ReactCurrentDispatcher ref.
jest.resetModules();
});

expect.extend({
...require('../../../../scripts/jest/matchers/schedulerTestMatchers'),
});
Loading

0 comments on commit b59af84

Please sign in to comment.