690 Commits

Author SHA1 Message Date
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
Georgi Serev f48d2769db refactor(devtools): add static nodes for html-only block content in the component tree
Add `<html_content>` static nodes to the component tree for control flow blocks that render only HTML content.
2026-07-10 14:27:03 -07:00
hawkgs 5ff14e9915 fix(devtools): bump settings z-index due to overlapping elements
Fixes the bug where the Transfer State table header is overlapping the settings window.
2026-07-09 12:19:39 -07:00
hawkgs 3685755333 refactor(devtools): stop component inspector on esc press
Stop the component inspector when Escape is pressed similarly to Chrome DevTools.
2026-07-09 12:13:05 -07:00
Aleksander Bodurri 56847dc77a fix(devtools): highlight SVG and directive hosts correctly
Before SVG hosts could be skipped because the highlighter checked for HTMLElement. A case like <foreignObject appSvgDemo> would not get a proper overlay. The highlighter now works with Element so SVG hosts can be found and measured.

Before Directive only hosts could be skipped because the inspected-page lookup and directive explorer matched component hosts and component ids only. A case like <a routerLink="/todos">Todos</a> could highlight the parent component instead of the anchor, and the RouterLink only tree node could fail to select, highlight, or request an overlay. Id 0 could also miss the highlighted state because the tree treated it as absent. The lookup now stops at the nearest component or directive host, and tree matching accepts component and directive ids using null as the absent state.

Selected overlays could fail to reappear for the same element because unhighlighting removed the overlay but left the selected element cached. selected-element cache is now reused only while its overlay is still connected, and unhighlighting clears the cached element.

Overlay geometry used integer coercion. An SVG or transformed element with a 0.5px bounding box could get a 0px overlay. Overlay positioning now preserves fractional DOMRect values.
2026-07-07 10:18:37 -07:00
Aleksander Bodurri 910557d062 docs(devtools): document how the extension connects to a tab
Add an architecture doc tracing how the Angular DevTools panel, background worker, content scripts, and backend connect per tab and relay messages, with diagrams for the topology and boot sequence.
2026-07-07 09:12:32 -07:00
Angular Robot 731d665a86 build: update babel monorepo to v8
See associated pull request for more information.
2026-07-06 14:05:15 -07:00
SkyZeroZx 95f56d33fe feat(devtools): Adds deep linking from Chrome Performance panel
Enables direct navigation to Angular components from the Chrome Performance panel's flame graph.

This feature integrates Angular DevTools with Chrome's `setOpenResourceHandler` by registering a custom URL scheme (`angular-devtools://component/{instanceId}`).

Closes #63960
2026-07-06 13:32:32 -07:00
hawkgs ff115925e7 refactor(devtools): restructure profiler and directive forest code
- Rename `DirectiveForestHooks` to `DirectiveForestManager`
- Keep profiler reference standalone; move it out from `DirectiveForestHooks`/`DirectiveForestManager`
- Convert profiler-specific `IdentityTracker` behavior to a more generalized one
- Separate timing API functionality from the `DirectiveForestHooks`/`DirectiveForestManager` initialization fn
- Reorganize files; rename `/hooks` to `/profiling`
- Use concrete types for directive and component instances (incomplete coverage; based on `any` at the moment)
- Other more minor changes
2026-06-24 10:57:08 -04:00
Kam aa7d9fcc61 fix(devtools): restore build under stricter ts_project deps
The rules_angular bump in #69410 made ts_project require every `deps`
entry to provide the JsInfo provider. `esbuild_base` listed
`//packages:package_json` in its deps, but `esbuild-base.config.mts` never
imports or reads package.json, so the dependency is unnecessary and now
breaks analysis (`//packages:package_json` is a `copy_to_bin` target that
provides only DefaultInfo). Remove it.
2026-06-19 11:37:17 +02:00
Cameron Smick ae6d8dae75 refactor(core): add childSignalProp to ReactiveNodeKind
Add `childSignalProp` to `ReactiveNodeKind` in order to consolidate `ReactiveNodeKind` types and enable Client-Only Wiz to use it.
2026-06-17 13:03:13 -07:00
Matthieu Riegler 74fa0588b1 refactor(devtools): ensure code is escaped
By stringifying twice we ensure the code is escape before building the string template.
2026-06-16 08:25:35 -07:00
Aleksander Bodurri 985fd78818 docs(devtools): document the injector tree visualization
Add an internals doc covering how the injector tree is built from the directive forest's resolution paths, rendered with d3, and how injector data is read from the DI debug APIs.
2026-06-11 13:07:08 -07:00
hawkgs 78b12b3dd7 refactor(devtools): minor improvements of the transfer state UI
The change can be treated as a continuation of #68535.

- Make the table header sticky
- Reduce slightly the table density in order to equalize it with the rest of the UI
- Reduce the font size of the type pills
- Change the position of the filter clear button to match with the rest of the filter inputs
- Add a "No such key" label when there are no data rows as a result of filtering
2026-06-11 09:30:15 -07:00
hawkgs fd33b6e4e9 refactor(devtools): improve public API naming of the visualizers
Improve the name of the public methods of the visualizers by using common terms like "highlighted". This should, hopefully, clear up some ambiguities that came with the term "selected". Additionally, clean up some CSS class names.
2026-06-11 09:29:28 -07:00
Edu 6b3e46a872 refactor(devtools): rename element to tagName and keep nativeElement flat
This refactoring renames the 'element' (tagName string) property of DevToolsNode to 'tagName' for clarity, as 'element' was ambiguous.
It also restores 'nativeElement' as a flat property (undoing the nesting introduced previously) because there are cases (like control flow blocks) where a tag name is present without an associated DOM node, making nesting inappropriate.
2026-06-11 09:22:55 -07:00
Doug Parker daadb3863e release: bump Angular DevTools version to 1.16.0 2026-06-10 12:55:42 -07:00
Edu 781cc84db0 refactor(devtools): convert router details panel to description list
Convert the router details panel in DevTools to use a description list (<dl>) instead of a table. This is semantically more correct for key-value metadata and improves accessibility.
2026-06-10 10:23:23 -07:00
Aleksander Bodurri 06db706238 feat(devtools): improve transfer state tab
- promote to default-on (remove opt-in setting and gear-menu toggle)
- replace the <pre> value cell with a collapsible JSON tree
- add key filter and column sort (size sorts by raw bytes)
- show an educational empty state when the app has no transfer state
- iterate every root in the directive forest and merge their state
- guard size calculation against undefined and circular references
- register listener once with DestroyRef cleanup; add a loading timeout
- distinguish array/string badge colors via theme-aware tokens
- responsive value cell width; flex-based table scroll
- add a component spec; seed the harness fixture with more demo data
2026-06-08 12:47:13 -07:00
Georgi Serev fe50a7ea94 perf(devtools): optimize signal graph nodes value inspection
This change is based on the presumption that a signal graph can be significantly large memory-wise sometimes. This is the reason why we don't send the full graph to the FE but rather serialize its values and then lazy load them when they are needed, that is, during value inspection.
2026-06-08 12:34:03 -07:00
hawkgs a7d684517f refactor(devtools): use ng-filter for the router tree search
Use the reusable `ng-filter` for the router tree search.
2026-06-08 11:19:47 -07:00
Georgi Serev 97be5f23fd feat(devtools): implement a signal graph nodes search
Implement singal graph nodes search for easier navigation within graphs with large sets of nodes. The search provides filtering by node type via `type:<SIGNAL_TYPE>` syntax.
2026-06-05 11:08:52 -07:00
Matthieu Riegler 7896e74222 refactor(devtools): Prevent cross-tab privilege escalation
The background script must not rely on the user-controllable `port.name` to authenticate DevTools panel connections.
2026-06-03 15:47:34 -07:00
bravesasha a28604be02 refactor(devtools): remove unnecessary async from serializeTransferState
Remove unnecessary `async`/`Promise<void>` from `serializeTransferState` and the
redundant `async () =>` wrapper in `provideAppInitializer` — the function contains
no async operations, so this is a zero behavior change cleanup.
2026-06-03 15:42:21 -07:00
Matthieu Riegler 752fb476eb refactor(devtools): Harden props navigation
To prevent any unwanted access/changes to some props like the `prototype` or `constructor`
2026-06-03 18:55:00 +02:00
Matthieu Riegler 66cbfee57b refactor(devtools): harden console invocations
We ensure that no prototype polution would affect console calls.
2026-06-03 18:52:31 +02:00
Alan Agius 27e8fc27cb release: bump Angular DevTools version to 1.15.1 2026-06-03 16:13:17 +02:00
Cameron Smick d069c55ab4 refactor(core): Split the ng global into internal and external objects
Split the `ng` global interface into two interfaces:
* `ExternalCoreGlobalUtils` includes all the functionality which has been shipped in a long-lived Angular version externally and which is subject to the versioning constraints described above.
* `InternalCoreGlobalUtils` includes internal-only functionality which has **not** been shipped in a long-lived Angular version.

This split means that all APIs in `InternalCoreGlobalUtils` can be iterated and evolved at a much faster pace. Angular DevTools can support those features, and we can make breaking changes more-or-less whenever we want. The downside is that external Angular developers cannot take advantage of those APIs or else we would be subject to the same versioning constraint we're trying to avoid here.

This means we can use `InternalCoreGlobalUtils` as a kind of "beta" channel for new DevTools APIs. Once that functionality is validated and the design is stabilized, the feature can be moved into `ExternalCoreGlobalUtils` and made available for external Angular developers when we're ready to commit to the long-lived version constraint. This will hopefully help us strike a better balance between iterating on new APIs quickly and maintaining stable APIs for external Angular users.
2026-05-27 16:37:30 -07:00
Cameron Smick 23f3894c40 refactor(devtools): make the hydration property of DevToolsNode optional
Make the `hydration`` property of `DevToolsNode`` optional as frameworks like Client-Only Wiz don't have the same hydration concept as Angular and will not set one for nodes returned from `getComponentForest`.
2026-05-27 10:54:31 -07:00
Matthieu Riegler d7161fd431 fix(devtools): Add support for null-prototype objects
null-prototype don't inherite from the Object prototype and thus don't have constructors.

fixes #68798
2026-05-27 10:53:32 -07:00
Georgi Serev 116b4cd936 fix(devtools): cluster-to-cluster relationships in signal graph
The PR addresses a missing step in the clustering phase of the signal graph processing on the DevTools frontend. Cluster-to-cluster relationship were missing from the graph, so the change fixes that.
2026-05-19 13:06:37 -07:00
Cameron Smick dbceef6221 refactor(devtools): make the DevToolsNode element property optional
The Angular DevTools Extension doesn't use the `element` property in Client-Only Wiz apps. Once the new `ng.getComponentForest`` function is implemented, Client-Only Wiz could provide `ComponentTreeNode`s without an `element` property. This change supports that case by making the `element` property optional.
2026-05-19 13:04:49 -07:00
Cameron Smick 3c255bccc1 refactor(devtools): Modify buildDirectiveForest to set default values for properties that will not be included in the forest returned by non-Angular frameworks.
Set default values for the `directives`, `element`, `hydration`, and `component.isElement` properties of every `ComponentTreeNode` returned by `ng.getComponentForest` for non-Angular apps.
2026-05-19 13:04:15 -07:00
Cameron Smick 0cf8a61e58 refactor(devtools): add optional injector property to DevToolsNode and IndexedNode types
Add an optional injector property to the DevToolsNode and IndexedNode types. Features that require an injector use the injector stored on the node, if it exists, and fall back to getInjectorFromElementNode if it doesn't.
2026-05-19 13:04:15 -07:00
Cameron Smick 50c0ce8275 refactor(devtools): Modify buildDirectiveForest to call ng.getComponentForest if it exists.
A new ng global function, ng.getComponentForest, is being added to allow the framework to provide the component forest without writing metadata to the DOM. This will allow devtools to display components that don't render any DOM.
2026-05-19 13:04:15 -07:00
Alan Agius 739bd37b0a release: bump Angular DevTools version to 1.15.0 2026-05-13 15:28:49 +02:00
Aleksander Bodurri 84d757446b refactor(devtools): use WeakRef in idToInjector map for injector cleanup
Replace the manual injectorsSeen cleanup mechanism with WeakRef and FinalizationRegistry. The old approach worked but coupled cleanup to the UI change detection and required tracking seen injectors across traversal. WeakRef lets the browser handle this naturally, removing the injectorsSeen set and the manual cleanup loop.
2026-05-12 11:37:07 -07:00
hawkgs 1cb2e6bf5b feat(devtools): improve value highlighting in object previews
Introduce a more fine-grained value preview highlighting based on the property type in the `ng-object-tree-explorer`.
2026-05-05 17:06:41 -07:00
hawkgs f8045272b5 refactor(devtools): update object value previews
Improve BigInt, function and object/class instance value previews during state serialization.
2026-05-05 17:06:41 -07:00
hawkgs 93b5496ee8 refactor(devtools): minor improvements of the resolution path UI
Change the string representation of `InjectionToken`s; Add an explanatory label to the visualization.
2026-05-05 09:34:57 -07:00
Matthieu Riegler d91070ee4f refactor(devtools): cleanup
This are not the droids you are looking for.
2026-05-01 15:59:40 -07:00
Georgi Serev 9d803c51f4 feat(devtools): create a new settings menu
Create a new settings menu with more available space for new options and better organization and classification.
2026-05-01 15:54:26 -07:00
Matthieu Riegler ef38017418 build: move devtools only deps out of the workspace
This reduces the clutering of the workspace package.
2026-04-28 13:05:33 -07:00
Matthieu Riegler 4ad3a1fe37 refactor(core): Don't throw when there are not async metadata
In the context of AOT tests, component with defer blocks no longer throw on instanciation if the component is not overridden (with `overrideComponent`)

Prior to this change, all components with a `@defer` block would throw if `compileComponents` was not invoked.

In none-JIT apps, this change makes `compileComponents()` uneccesary.
2026-04-27 17:04:09 -07:00
Matthieu Riegler 789cbd58b8 refactor(devtools): drop the semver-dsl page
We can use the semver package directly.
2026-04-23 11:37:30 -07:00
Cameron Smick e96673ff64 refactor(devtools): make the DevToolsNode directives property optional
Client-Only Wiz doesn't have the concept of a directive. Once the new ng.getComponentForest function is implemented, Client-Only Wiz cowilluld provide `ComponentTreeNode`s without a `directives`` property. This change supports that case by making the `directives` property optional.
2026-04-23 11:36:00 -07:00
Matthieu Riegler c77f16de93 refactor(devtools): Use @Service instead of @Injectable
Dogfooding is always a good idea.
2026-04-23 11:30:12 -07:00
Doug Parker 51c3a11d69 release: bump Angular DevTools version to 1.14.1 2026-04-08 12:15:55 -07:00
Cameron Smick 236d6d4946 refactor(devtools): pass node to logValue to log the appropriate prop to the console
The "Log to console" button in the prop-actions-menu component incorrectly logs the entire props object rather than the value of the individual prop with which the button is associated. Passing the `node` to the logValue function fixes the prop lookup logic and logs the appropriate prop value to the console.
2026-04-07 09:35:12 -07:00
Aleksander Bodurri 33b001d478 fix(devtools): clean up removed directive entries in IdentityTracker to prevent memory leak
The IdentityTracker singleton never deleted entries from its internal
  maps (_currentDirectiveId, _currentDirectivePosition, isComponent) for
  destroyed directives. This caused the maps to grow monotonically for
  the entire DevTools session, retaining references to destroyed component
  instances and preventing garbage collection.

  The cleanup was intentionally commented out because the profiler needs
  to resolve IDs and positions of removed components during recording.

  Introduce `setProfilingActive()` to gate cleanup: when profiling is
  inactive, removed entries are deleted immediately during `index()`.
  When profiling is active, removals are deferred into a `_pendingRemovals`
  set and flushed once profiling stops via `capture.ts` start/stop calls.
2026-04-06 11:36:07 -07:00