191 Commits
Author SHA1 Message Date
hawkgs 1e67af2a64 refactor(devtools): improve canvas highlighter by reducing memory usage (#71046)
Previously, the canvas highlighter spanned across the whole document.
That resulted in a high memory usage since empty canvases still take
memory. This refactor converts the canvas to a `fixed` one, which covers
only the viewport/visible part of the screen.

PR Close #71046
2026-11-11 19:18:27 +00:00
hawkgs 8844e89b9f perf(devtools): use HTML canvas for the highlighter (#71046)
The existing highlighting mechanism relies on DOM elements.
This has some implications like introducing layout thrashing
since each highlight adds/removes elements to and from the tree.
This change converts the higlighter to HTML canvas renderer which
should introduce minimal performance overhead when inspecting the app.

PR Close #71046
2026-11-11 19:18:27 +00:00
hawkgs 7c8c8d177b refactor(devtools): split component-tree logic into other modules
Split the `directive-forest/component-tree` logic into other modules and
utilities. `component-tree` was the only remnant of the legacy BE code
organization. The refactor doesn't change any logic, but converts some
remaining arrow functions to standard functions and performs a few renames.
2026-11-03 16:30:00 -08:00
Naveed Khan ad9058ad87 fix(devtools): merge transfer state into a null-prototype object
The transfer state backend merges the per-root `ɵgetTransferState` results
into a plain object literal with `Object.assign`. A key such as `__proto__`
assigns through the inherited setter, dropping the entry and reparenting the
merged object. Use a null-prototype object as the merge target so the key is
kept as an ordinary entry.
2026-10-20 00:43:27 -07:00
hawkgs 500d8709b7 refactor(devtools): remove leading underscores of private class members
Remove all prefixes of private members to match the currently followed convention.
Remaining places that still use underscores (excluded from the refactor):
- `tab-update/index.ts`
- `splitArea.directive.ts` (part of the old vendor code)
2026-10-09 17:14:37 -07:00
Shuaib Hasan Akib a36155d9ef refactor(devtools): import rxjs operators from the rxjs entry point
Since RxJS 7.2, all operators are exported from the main `rxjs` entry
point, and RxJS recommends importing them from there. `rxjs/operators`
is only kept for backward compatibility and is expected to be removed in
a future major version.

Switch the remaining `rxjs/operators` imports in devtools to `rxjs`,
merging them into the existing `rxjs` import where there is one. Unlike
the framework packages, which still support RxJS 6 through their peer
dependency range, devtools is bundled with the repository's RxJS 7, so
this is safe.

No runtime or bundle size changes: both entry points expose the same
tree-shakable operators.
2026-10-02 09:45:36 -04:00
Aleksander Bodurri 8d1204a1de perf(devtools): track cycle count and latest duration directly in CD analyzer
The CD analyzer previously kept an unbounded array of durations for
each component. Since DevTools only displays the total cycle count and
the latest duration, track the count and latest duration directly as
numbers instead of accumulating an array.
2026-09-29 13:47:53 -07:00
Luca ad548b9c00 fix(devtools): hide watch signal button when not supported by application
Hide the watch signal button in signal details when the host application
does not support `window.ng.toggleWatchSignal` (e.g. applications running
on Angular versions prior to the introduction of signal watch debugging).

Fixes #70948
2026-09-29 13:14:06 -07:00
hawkgs 4086dad0c6 refactor(devtools): add onValue to the backend config
Add an `onValue` method to the config that emits immediately
the current value and then listen for changes similarly to `onChange`.
2026-09-28 11:58:55 -07:00
Aleksander Bodurri 3eaae88e5d fix(devtools): recurse correctly when finding hydration error nodes
findErrorNodesForHydrationOverlay recursed into
findNodesForHydrationOverlay, which stops descending at the first node
with any hydration status. Mismatched nodes nested under a hydrated or
skipped node were therefore never found and never highlighted on the
page. Recurse into the error-node finder itself so nested mismatches
are highlighted.
2026-09-28 11:41:30 -07:00
Georgi Serev 1881f9dc0d feat(devtools): add ability to toggle control flow and defer blocks
Add options for toggling @for and @defer blocks in the settings.
2026-09-23 08:48:31 -07:00
hawkgs bceb2fef72 refactor(devtools): drop inspect element highlight TTL
A leftover that I forgot from `82882fa` that snuck into.
2026-09-18 09:32:11 -07:00
Georgi Serev fe94aae034 refactor(devtools): introduce a global backend config
- Unify the multiple scattered feature-specific flags into a single
global backend config
- Fix initial settings data exchange between the fe and be on prod
2026-09-16 14:12:42 +02:00
Edu ef09d108f2 fix(devtools): safely handle foreign root elements in feature detection
Prevent Angular DevTools from crashing when elements matching [ng-version] in the DOM do not belong to the host application (such as third-party custom elements or browser extensions). ng.getComponent returns null for these elements, which previously caused ng.getDirectiveMetadata to throw.
2026-09-09 22:26:00 +02:00
hawkgs 635ef1bd80 refactor(devtools): contain hydration overlays functionality on the be
Move the refresh mechanism of the hydration overlays to the backend,
delegating only the feature toggling to the frontend.
2026-09-09 16:10:25 +02:00
Kam 3dfc855381 test(devtools): run the orphaned supported-apis spec
`supported-apis.spec.ts` was added in #60585, in a commit that also edited the
`ts_test_library` three lines below the `srcs` it was left out of. No revision
of that BUILD file has ever listed it, so it has not run since March 2025. The
target goes from 12 specs to 14.

Wiring it up alone would not have worked. Every `*IsSupported` helper calls
`ngDebugClient()`, which throws when `window.ng` is undefined, and the old
`expect(supported).toBeTruthy()` set no `ng` at all. It now stubs `ng` and
checks the flag set and that each flag tracks its own debug API.

`ng-debug-api.spec.ts` adds an `[ng-version]` root and did not remove it, which
`getAppRoots()` then picks up in the other file under jasmine's random
ordering, so it now clears the DOM in its own `afterEach`.

`glob` matches the sibling `directive-forest/component-tree` target and keeps
the next spec in this directory from being dropped the same way.
2026-09-04 07:46:46 -07:00
hawkgs c1ac4b750a refactor(devtools): convert remaining console calls to the custom log
Convert the remaining calls introduced by the #70254.
2026-08-26 15:38:33 -07:00
hawkgs 07605ba793 feat(devtools): implement CD analyzer (#70254)
Implement component highlighting on change detection cycles along with embedding
the component-specific data to the directive/component tree explorer.

Closes #59057

PR Close #70254
2026-08-25 10:35:42 -07:00
hawkgs 82882fae51 refactor(devtools): add TTL and outline style to the highlighting mechanism (#70254)
Add the ability to automatically destroy created highlights by a provided TTL;
Add the option for outline style of the highlight overlays;
Add `prefer-inset` label position;

PR Close #70254
2026-08-25 10:35:42 -07:00
Georgi Serev 1371c946aa refactor(devtools): use a custom logger and error
Use a custom logger that prefixes the messages with `[Angular DevTools]`;
Add ability for dev-only log messages;
Add Angular-DevTools-specific `Error`;
2026-08-25 09:55:04 -07:00
Cameron Smick 82a767535e feat(devtools): add "Watch signal" button to signal-details component
Add a "Watch signal" button to the signal-details component to allow users to "watch" changes to the associated signal.
2026-08-24 15:35:44 -07:00
hawkgs 023a63df8c refactor(devtools): unsubs from profiler when the perf track is disabled
Avoid the leak by unsubscribing from the profiler when the performance track is disabled.
Additionally, drop the duplicated performance track state flag.
2026-08-19 08:26:01 -07:00
Kristiyan Kostadinov 732e505018 fix(core): replace all hasOwnProperty usages with Object.hasOwn
We keep getting PRs that target single usages of `hasOwnProperty` and we have ~100 of them. These changes aim to address the issue centrally by swapping out all the instances and adding a lint rule against introducing new ones.
2026-08-18 09:17:18 -07:00
Matthieu Riegler 03f1758e2a fix(devtools): fix regression for node serialization.
This fixes a regression introduced by #69309 where the format of `serializedId` from a coma separated string, to a JSON representation of an array.

fixes #70104
2026-08-07 16:30:22 -07:00
splincode 1a2bcb2295 fix(devtools): avoid initializing profiler in production mode
Defer the timing hook subscription until the timing API is explicitly enabled. Keep production module loading and development initialization covered by isolated browser test targets.
2026-07-29 16:51:09 -07:00
Georgi Serev 184c4797b8 refactor(devtools): rename timing API to performance track
Rename Timing API to Performance Track to better reflect the purpose of the actual feature;
Migrate the settings data object to match the new name and drop some redundant keys.
2026-07-29 08:38:39 -07:00
hawkgs a7ebf1cd69 refactor(devtools): reorganize backend code
Organize code into domain/feature-specific folders and a shared API folder.
2026-07-20 11:15:53 +02:00
hawkgs 2aecfb0f38 refactor(devtools): format code
Format DevTools TypeScript files.
2026-07-20 10:48:28 +02:00
Georgi Serev 98115e8137 refactor(devtools): revamp highlighter
Revamp the highlighter by introducing a completely new mechanism.
2026-07-15 11:59:04 -07:00
Cameron Smick d997a96b47 refactor(core): move signal debug graph interfaces to primitives/devtools
Move the DebugSignalGraph, DebugSignalGraphEdge, and DebugSignalGraphNode interfaces from packages/core/src/render3/util/signal_debug.ts into the packages/core/primitives/devtools/src package. This decouples the signal graph debug types from runtime render3 utilities and allows devtools and internal core tooling to import them directly from primitives as type-only exports.
2026-07-14 11:09:22 -07:00