[Debug Tools] Always use includeHooksSource option (#28309)

This option was added defensively but it's not needed. There's no cost
to including it always.

I suspect this optional was added mainly to avoid needing to update
tests. That's not a reason to have an unnecessary public API though.

We have a praxis for dealing with source location in tests to avoid them
failing tests. I also ported them to inline snapshots so that additions
to the protocol isn't such a pain.
This commit is contained in:
Sebastian Markbåge
2024-02-14 11:07:35 -05:00
committed by GitHub
parent dc3178151b
commit f0e808e5bc
5 changed files with 2096 additions and 979 deletions
@@ -3301,7 +3301,6 @@ export function attach(
hooks = inspectHooksOfFiber(
fiber,
(renderer.currentDispatcherRef: any),
true, // Include source location info for hooks
);
} finally {
// Restore original console functionality.
@@ -98,7 +98,7 @@ describe('parseHookNames', () => {
});
async function getHookNamesForComponent(Component, props = {}) {
const hooksTree = inspectHooks(Component, props, undefined, true);
const hooksTree = inspectHooks(Component, props, undefined);
const hookNames = await parseHookNames(hooksTree);
return hookNames;
}
@@ -928,7 +928,7 @@ describe('parseHookNames worker', () => {
});
async function getHookNamesForComponent(Component, props = {}) {
const hooksTree = inspectHooks(Component, props, undefined, true);
const hooksTree = inspectHooks(Component, props, undefined);
const hookNames = await parseHookNames(hooksTree);
return hookNames;
}