618 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 3d2581a77c refactor(devtools): remove unused permissions
Remove `scripting` and `activeTab` permissions since
it appears that they are no longer used by the extension.
2026-11-09 10:00:21 -08:00
Doug Parker 40e6911236 release: bump Angular DevTools version to 1.22.2 2026-11-04 14:46:45 -08: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
Shuaib Hasan Akib 5f47c3c972 fix(devtools): avoid mutating recorded frames when merging a frame range
When a later frame has a directive that the first selected frame doesn't,
`mergeFrames` added that frame's directive object to the merged result
by reference. Merging the next frame then added its timings into the
recorded frame, so selecting three or more frames inflated the stored
change detection and lifecycle times, and they grew each time the range
was selected again.

Copy the directive before adding it to the merged result.

Tested by adding a spec that merges three frames and checks that the
input frames are unchanged.
2026-10-28 11:41:50 -07:00
Alan Agius e679366361 release: bump Angular DevTools version to 1.22.1 2026-10-28 11:17:00 +01: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
Georgi Serev b1375e48a0 fix(devtools): directive explorer breadcrumbs height
- Fix a regression caused by #70688.
- Move `breadcrumbs/` one dir up where it should belong.
2026-10-12 15:29:25 -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 d60ee5e27b refactor(devtools): replace deprecated tree APIs in the component tree
`FlatTreeControl` from `@angular/cdk/tree` and `MatTreeFlattener` from
`@angular/material/tree` are deprecated in favor of the tree's
`levelAccessor`/`childrenAccessor` APIs.

The component tree (directive forest) isn't rendered with a CDK tree but
as a flat list in a virtual scroll viewport. It only used
`FlatTreeControl` to track which nodes are expanded, and
`MatTreeFlattener` to flatten the forest and compute the visible nodes.

Replace them with:
- An `ExpansionModel` that tracks expanded nodes with a
  `SelectionModel`, like `FlatTreeControl` did internally, and exposes
  the `expand`, `collapse`, `toggle`, `isExpanded` and `changed` members
  used by devtools.
- Local helpers in `ComponentDataSource` that flatten the forest in
  depth-first order and return the nodes whose ancestors are all
  expanded, matching the previous behavior.

Also add a spec covering which nodes are visible as nodes are expanded
and collapsed.
2026-10-02 10:59:10 -04: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
Shuaib Hasan Akib 46c37e50b4 fix(devtools): clean up profiler component subscriptions on destroy
Cleans up `uploadedData` and message bus subscriptions when the profiler
is destroyed to prevent duplicate error dialogs and stale profiler results
from accumulating across profiler instances.

Adds coverage for subscription cleanup on destroy.
2026-10-01 13:37:45 -04:00
Andrew Scott 03795a9f5d fix(devtools): use MouseEvent for mouseover and mouseout listeners in tree visualizer
In @types/d3-selection >= 3.0.12, listener callbacks for mouseover and mouseout
events are strongly typed to receive MouseEvent. Because PointerEvent is a
subtype of MouseEvent, typing the listener parameter as PointerEvent causes
a TypeScript compilation error.

Update nodeMouseoverListeners and nodeMouseoutListeners in GraphRenderer and the
corresponding D3 event handlers in TreeVisualizer to use MouseEvent.
2026-09-29 15:35:57 -07: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
Edu 36a0ab6ed8 fix(devtools): sync breakpoint UI state and allow removal after debugger detach
When a user cancels Chrome's debugging infobar while a signal breakpoint is active, `chrome.debugger.onDetach` clears the active breakpoints map in the background service worker. Previously, the DevTools panel UI was not notified of this event, leaving the breakpoint icon displayed as active, and subsequently clicking to disable it threw an error because the entry was already absent from `activeBreakpoints`.

This change:
1. Broadcasts a `signalBreakpointsCleared` message from `BreakpointManager` when `chrome.debugger.onDetach` fires so `SignalGraphPaneComponent` immediately clears its active breakpoints state.
2. Makes `BreakpointManager.removeBreakpoint` return early as a no-op if the breakpoint or tab entry is already absent.

Fixes #70949
2026-09-29 12:20:46 -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
Doug Parker 28ad39af24 release: bump Angular DevTools version to 1.22.0 2026-09-23 13:03:15 -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
Alan Agius c0c5d452c3 test(devtools): assert on eval spy in chrome-application-operations spec
Avoid asserting on chrome.devtools.inspectedWindow.eval directly via
Jasmine matchers, as TypeScript picks up the 3-argument overload
signature from @types/chrome, causing a TS2554 compilation error when
only 2 arguments are provided. Instead, assert directly on the
evalSpy instance.
2026-09-22 14:00:51 -07:00
Максим Иванов c2143bb240 refactor(devtools): type message bus listeners
Use explicit listener function types for the Chrome and iframe message
buses instead of storing callbacks as `any[]`.
2026-09-21 09:36:23 -07:00
Georgi Serev 86f4c88a43 refactor(devtools): use responsive split for the components tab
Drop the `ResizeObserver` in favor of `NgResponsiveSplit`;
Extend `NgResponsiveSplit` functionality to include width breakpoints;
2026-09-21 09:33:46 -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
Aleksander Bodurri 463cbea4fa test(devtools): remove unnecessary TestBed imports in directive forest spec
Remove the explicit 'imports' configuration in TestBed since the
component is resolved automatically. Simplify beforeEach accordingly.
2026-09-17 10:09:24 -07:00
Aleksander Bodurri 950603097b perf(devtools): stop Map copying in handleFilter
Before: handleFilter cloned the entire matchedNodes Map on every match inside the iteration loop.

After: handleFilter accumulates matches in a local Map and performs a single atomic update to matchedNodes at the end of the loop in O(n) time.
2026-09-17 10:09:24 -07:00
Alan Agius 06ffb35fb1 release: bump Angular DevTools version to 1.21.1 2026-09-16 15:17:31 +02:00
Georgi Serev 1750003024 fix(devtools): make tab buttons visually accessible on small viewports
Reuse breadcrumbs scroll behavior (in the form of a reusable component)
for the main tabs bar.
2026-09-16 15:05:53 +02:00
Edu e02c4d89bc fix(devtools): harden message sender validation and expand property shape tests
Explicitly validate sender.origin and sender.url, guard against non-object
or missing sender properties, and add comprehensive unit test coverage
for all optional property permutations of chrome.runtime.MessageSender.
2026-09-16 14:56:37 +02:00