Skip to content

Conversation

@AleksanderBodurri
Copy link
Member

@AleksanderBodurri AleksanderBodurri commented Jul 22, 2024

Depends on #57073

Creates a debug api that returns an arrays of nodes and edges that represents a signal graph in the context of a particular injector.

Starts by discovering the consumer nodes for each injector, and then traverses their dependencies to discover each producer.

@pullapprove pullapprove bot added the requires: TGP This PR requires a passing TGP before merging is allowed label Jul 22, 2024
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: core Issues related to the framework runtime labels Jul 22, 2024
@ngbot ngbot bot added this to the Backlog milestone Jul 22, 2024
@AleksanderBodurri AleksanderBodurri requested review from dgp1130 and removed request for Jesse-Good, crisbeto and thePunderWoman July 22, 2024 06:44
Copy link
Contributor

@dgp1130 dgp1130 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together! I really like the approach you came up with here and how it uses a Map. I have a number of small readability suggestions, but the main thing is probably to make sure we're fully defining and thinking through the nodes and edges data structure we're creating here.

assertLView(lView);
const templateLView = lView[tNode.index];
if (templateLView) {
const templateConsumer = templateLView[REACTIVE_TEMPLATE_CONSUMER];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per @alxhub, there may be multiple template consumers for a component (one per view), so we need to keep those as well.

It seems that for the current moment we generally only use a single template effect per-component, but a template effect per-view is the direction we'd like to move for signal components and want to make sure DevTools is compatible with that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alxhub, we discussed this issues a little while back, but it seems like Angular still uses only one consumer per component as we don't yet have different consumers per-view? @AleksanderBodurri and I were thinking it would make sense to stick with the current implementation for now and maybe revisit the one-consumer-per-view issue as we get closer to true @Component({ signal: true })? Is that the right approach or is there more we can/should do today in this space?

@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Sep 24, 2024
Copy link
Contributor

@dgp1130 dgp1130 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great @AleksanderBodurri! I don't have any major concerns, just a handful of readability improvements and some file suggestions.

I'll defer to @alxhub and other FW folks on the nuances of DI usage though.

assertLView(lView);
const templateLView = lView[tNode.index];
if (templateLView) {
const templateConsumer = templateLView[REACTIVE_TEMPLATE_CONSUMER];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alxhub, we discussed this issues a little while back, but it seems like Angular still uses only one consumer per component as we don't yet have different consumers per-view? @AleksanderBodurri and I were thinking it would make sense to stick with the current implementation for now and maybe revisit the one-consumer-per-view issue as we get closer to true @Component({ signal: true })? Is that the right approach or is there more we can/should do today in this space?

@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Oct 21, 2024
@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 10, 2024
@ngbot ngbot bot removed this from the Backlog milestone Dec 10, 2024
@AleksanderBodurri AleksanderBodurri changed the title feat(core): implement getSignalGraph debug API refactor(core): implement getSignalGraph debug API Dec 10, 2024
@ngbot ngbot bot added this to the Backlog milestone Dec 10, 2024
@AleksanderBodurri AleksanderBodurri changed the title refactor(core): implement getSignalGraph debug API refactor(core): implement experimental getSignalGraph debug API Dec 10, 2024
@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 10, 2024
Creates a debug api that returns an arrays of nodes and edges that represents a signal graph in the context of a particular injector.

Starts by discovering the consumer nodes for each injector, and then traverses their dependencies to discover each producer.
@angular-robot angular-robot bot added area: core Issues related to the framework runtime and removed area: core Issues related to the framework runtime labels Dec 10, 2024
@ngbot ngbot bot modified the milestone: Backlog Dec 10, 2024
@dgp1130
Copy link
Contributor

dgp1130 commented Dec 10, 2024

CARETAKER NOTE: g3 tests are passing with a single flake which can be ignored.

http://test/OCL:704492061:BASE:704783405:1733858591915:66403176

@dgp1130 dgp1130 added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release labels Dec 10, 2024
@ngbot
Copy link

ngbot bot commented Dec 10, 2024

I see that you just added the action: merge label, but the following checks are still failing:
    failure status "google-internal-tests" is failing

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken main, please try rebasing to main and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@dgp1130 dgp1130 added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Dec 10, 2024
@alxhub
Copy link
Member

alxhub commented Dec 10, 2024

This PR was merged into the repository by commit 33167d9.

The changes were merged into the following branches: main

@alxhub alxhub closed this in 33167d9 Dec 10, 2024
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 10, 2025
PrajaktaB27 pushed a commit to PrajaktaB27/angular that referenced this pull request Feb 7, 2025
…lar#57074)

Creates a debug api that returns an arrays of nodes and edges that represents a signal graph in the context of a particular injector.

Starts by discovering the consumer nodes for each injector, and then traverses their dependencies to discover each producer.

PR Close angular#57074
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants