Content-Length: 333310 | pFad | http://github.com/angular/angular/pull/61541

A1 feat(devtools): update getSignalGraph by milomg · Pull Request #61541 · angular/angular · GitHub
Skip to content

feat(devtools): update getSignalGraph #61541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

milomg
Copy link
Contributor

@milomg milomg commented May 20, 2025

add a function that we can inspect to jump to the source of a signal, and give every signal a unique id that devtools can use to match signals across calls to getSignalGraph

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

signals are now given a unique ID using a weakmap, and if they have a user function, we pass that through to the caller so they can call inspect(debuggableFn) to get chrome to jump to the source of the signal (see #61540 for usage)

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@pullapprove pullapprove bot requested a review from kirjs May 20, 2025 21:33
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: devtools labels May 20, 2025
@ngbot ngbot bot added this to the Backlog milestone May 20, 2025
@milomg milomg mentioned this pull request May 21, 2025
14 tasks
add a function that we can inspect to jump to the source of a signal, and give every signal a unique id
that devtools can use to match signals across calls to getSignalGraph
let id = signalDebugMap.get(consumer);
if (!id) {
counter++;
id = `${consumer.debugName}-${counter}`;
Copy link
Member

Choose a reason for hiding this comment

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

Is there a possibility this becomes undefined-0 or something similar?

Copy link
Contributor Author

@milomg milomg May 21, 2025

Choose a reason for hiding this comment

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

Yes, unnamed signals will become undefined-0 (but will still have a unique ID)

Copy link
Member

Choose a reason for hiding this comment

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

should we maybe use a nullish coalescing and have unnamed instead of undefined ?

Copy link
Member

@JeanMeche JeanMeche left a comment

Choose a reason for hiding this comment

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

Baside the suggestion, LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: devtools detected: feature PR contains a feature commit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/angular/angular/pull/61541

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy