angular/packages/core/test
Doug Parker 75f2cb8f56 feat(core): implement Angular DI graph in-page AI tool
This creates a new `angular:di-graph` in-page tool which returns the entire dependency injection graph for the application.

We use the following rough algorithm for discovering all element injectors:
1. Find all root `LView` objects by querying for `[ng-version]`.
2. Walk all the transitive `LView` descendants of the roots.
3. Filter these `LView` objects to just directives.
4. Find the injector for a given directive and walk up its ancestors to find all element injectors.

Discovering environment injectors works mostly the same way, just following the environment injector graph instead.

This approach has a few known limitations which are out of scope for the moment:
1. Any given component typically has both an element injector *and* an environment injector. The relationship of "component -> environment injector" is not expressed in the result as of now, meaning the AI doesn't really have any insight into _which_ environment injector is being used for a particular component, though the injector will be one of the returned values.
2. The implementation does not support MFE use cases of multiple applications on the page at the same time.
3. The performance is not ideal, as we walk `LView` descendants twice and walk up the injector tree for every directive, repeatedly covering the same scope (ideally we'd just walk up every *leaf* directive, which would cover the same result for less effort). However for a debug tool, this is likely fine for now and we can optimize later if/when it becomes necessary.

I did consider reusing more of the existing implementation in `global_utils` which exists to support Angular DevTools (we are already using some of it), however the existing support in `@angular/core` is actually fairly limited, returning very primitive data structures and relying on Angular DevTools to do the heavier lifting of collapsing the code into a usable graph representation. There's a potential path in the future to converge these implementations and potentially have `global_utils` use some of this code instead, but I will leave that for a future cleanup effort.
2026-04-14 18:35:51 +03:00
..
acceptance feat(core): enhance profiling with documentation URLs 2026-04-13 22:37:11 +03:00
animation refactor(core): Update determineLongestAnimation to account for playback rate 2026-03-12 17:36:50 -06:00
animation_utils refactor(core): dispatch enter and leave animations at the right times (#63450) 2025-09-10 22:24:00 +00:00
authoring feat(core): make SimpleChanges generic (#64535) 2025-10-20 17:49:39 +00:00
bundling refactor(core): simplifying the ComponentFactory usage 2026-04-13 22:24:18 +03:00
change_detection build: update Jasmine to 6.0.0 2026-02-09 12:15:57 -08:00
compiler refactor(compiler): remove zone-based testing utilities 2026-02-09 07:55:12 -08:00
debug feat(core): implement Angular DI graph in-page AI tool 2026-04-14 18:35:51 +03:00
di docs: add new debugging and troubleshooting di guide 2026-02-20 10:01:11 -08:00
dom build: migrate all ts_library in packages/core/test (#61472) 2025-05-20 10:00:43 +00:00
hydration fix(core): catch hydration marker with implicit body tag (#60429) 2025-03-19 15:51:36 +01:00
i18n refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
legacy_animation feat(core): Set default Component changeDetection strategy to OnPush 2026-03-24 16:25:02 -07:00
linker refactor(core): remove ComponentFactoryResolver usages 2026-04-13 16:00:03 +03:00
metadata refactor(core): improve resource loading with async/await 2025-11-11 12:50:16 -08:00
reflection refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
render3 refactor(core): add walkLViewDirectives 2026-04-14 18:35:51 +03:00
resource feat(core): allow debouncing signals 2026-03-09 13:21:52 -07:00
sanitization fix(core): prevent binding unsafe attributes on SVG animation elements (#67797) 2026-04-01 11:43:58 +02:00
signals fix(core): run linked signal equality check without reactive consumer 2026-03-17 13:59:38 -06:00
strict_types build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
testability refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
util build: update Jasmine to 6.0.0 2026-02-09 12:15:57 -08:00
zone ci: reformat files 2025-12-16 14:44:19 -08:00
application_config_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
application_init_spec.ts test(core): refactors test to use timeout utility 2026-04-01 20:46:00 +02:00
application_module_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
application_ref_integration_spec.ts feat(core): Set default Component changeDetection strategy to OnPush 2026-03-24 16:25:02 -07:00
application_ref_spec.ts feat(core): bootstrap via ApplicationRef with config 2026-04-07 12:48:53 -07:00
BUILD.bazel build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
change_detection_scheduler_spec.ts feat(core): Set default Component changeDetection strategy to OnPush 2026-03-24 16:25:02 -07:00
component_fixture_spec.ts feat(core): Set default Component changeDetection strategy to OnPush 2026-03-24 16:25:02 -07:00
defer_fixture_spec.ts ci: reformat files 2025-12-16 14:44:19 -08:00
dev_mode_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
directive_lifecycle_integration_spec.ts feat(core): Set default Component changeDetection strategy to OnPush 2026-03-24 16:25:02 -07:00
error_handler_spec.ts test(core): refactors test to use timeout utility 2026-04-01 20:46:00 +02:00
event_emitter_spec.ts refactor(core): Update tests for zoneless by default (#63668) 2025-09-09 14:41:56 -07:00
fake_async_spec.ts refactor(core): convert scripts within packages/core/test to relative imports (#60227) 2025-03-25 10:58:00 -07:00
forward_ref_integration_spec.ts ci: reformat files 2025-12-16 14:44:19 -08:00
runtime_error_spec.ts refactor(core): update error message links to versioned docs (#66374) 2026-01-09 22:33:51 +00:00
test_bed_effect_spec.ts feat(core): Set default Component changeDetection strategy to OnPush 2026-03-24 16:25:02 -07:00
test_bed_spec.ts feat(core): Set default Component changeDetection strategy to OnPush 2026-03-24 16:25:02 -07:00
transfer_state_spec.ts fix(core): escape forward slashes in transfer state to prevent crawler indexing 2026-04-13 13:54:55 +03:00