[Reconciler] Set ProfileMode for Host Root Fiber by default in dev (#34432)

Requiring DevTools to be present for dev builds seems like an overkill,
let's enable the instrumentation by default.

Nothing changes for profiling or production artifacts.
This commit is contained in:
Ruslan Lesiutin authored and GitHub committed 2025-09-12 12:20:39 +01:00
1 parent 0c813c528d
commit 0e10ee906e
2 files changed
+5 -4

No files matched your search

+4 -4
View File
@@ -532,10 +532,10 @@ export function createHostRootFiber(
mode = NoMode;
}
if (enableProfilerTimer && isDevToolsPresent) {
// Always collect profile timings when DevTools are present.
// This enables DevTools to start capturing timing at any point–
// Without some nodes in the tree having empty base times.
if (__DEV__ || (enableProfilerTimer && isDevToolsPresent)) {
// dev: Enable profiling instrumentation by default.
// profile: enabled if DevTools is present or subtree is wrapped in <Profiler>.
// production: disabled.
mode |= ProfileMode;
}
@@ -125,6 +125,7 @@ describe(`onRender`, () => {
expect(callback).toHaveBeenCalledTimes(1);
});
// @gate !__DEV__
it('does not record times for components outside of Profiler tree', async () => {
// Mock the Scheduler module so we can track how many times the current
// time is read