-
Notifications
You must be signed in to change notification settings - Fork 26.2k
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
base: main
Are you sure you want to change the base?
Conversation
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}`; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
?
There was a problem hiding this 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
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?
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?
Other information