Skip to content

Commit b59af84

Browse files
author
Brian Vaughn
committed
Refactored how React/DevTools log Timeline performance data
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"
1 parent 2f26eb8 commit b59af84

25 files changed

+2262
-1678
lines changed

packages/react-devtools-shared/src/__tests__/setupTests.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,7 @@ env.afterEach(() => {
162162
// so that we don't disconnect the ReactCurrentDispatcher ref.
163163
jest.resetModules();
164164
});
165+
166+
expect.extend({
167+
...require('../../../../scripts/jest/matchers/schedulerTestMatchers'),
168+
});

0 commit comments

Comments
 (0)