angular icon indicating copy to clipboard operation
angular copied to clipboard

Visualization of dependency injection

Open oschlegel opened this issue 2 years ago • 4 comments

Which @angular/* package(s) are relevant/related to the feature request?

core

Description

It's sometimes not so easy to unterstand what dependency injection is doing. It would be very helpful if there would be a possibility to better understand which instances of a injectable exist, how the dependency injection tree of a application looks and how the injector / injection hierarchy of a component looks.

Proposed solution

Extend the chrome dev tools plugin for angular with a visualization for the dependency injection tree.

Alternatives considered

Currently i don't have any idea for alternatives.

oschlegel avatar Apr 25 '22 07:04 oschlegel

That's something we're exploring currently. @AleksanderBodurri is working with @AndrewKushnir on plugging into the runtime to figure out the dependency graph and provider declarations. Assigning to @AleksanderBodurri.

mgechev avatar May 04 '22 23:05 mgechev

That's great to hear. This will be a helpful feature for alot of people.

oschlegel avatar May 06 '22 06:05 oschlegel

This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.

You can find more details about the feature request process in our documentation.

angular-robot[bot] avatar May 17 '22 14:05 angular-robot[bot]

In the meantime are there any lifehacks on how we can currently debug the DI?

Something like console.log'ing all instantiated services for a module will be helpful

Den-dp avatar Aug 03 '22 12:08 Den-dp

I have just installed the Angular dev tool extension and there's no injector tree visualization yet, right?

aalbericio avatar May 09 '23 13:05 aalbericio

@aalbericio Not yet !

JeanMeche avatar May 09 '23 14:05 JeanMeche

It would be a quite interesting and useful tool, imho

aalbericio avatar May 09 '23 14:05 aalbericio

This is absolutely a great idea. I'm really looking forward to it. As inspiration, I'm attaching screenshots from Vue and Nest. image image

zygarios avatar May 29 '23 08:05 zygarios

I think this issue is related to https://github.com/angular/angular/pull/51719.

KathrinShpigel avatar Sep 11 '23 03:09 KathrinShpigel

Great news !

zygarios avatar Sep 11 '23 06:09 zygarios

Dear Everybody, shouldn't this one be closed by now? We've got injectors hierarchy in the devtools shipped already

image

... along with the providers:

image

sounds like it fulfills the "visualization of dependency injection"

(my suggestion: close this one) @AleksanderBodurri

ducin avatar Nov 29 '23 00:11 ducin

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.