fix(core): include signal debug names in their toString() represent…#67511
Open
JoostK wants to merge 1 commit intoangular:mainfrom
Open
fix(core): include signal debug names in their toString() represent…#67511JoostK wants to merge 1 commit intoangular:mainfrom
toString() represent…#67511JoostK wants to merge 1 commit intoangular:mainfrom
Conversation
…ation The `toString()` implementations in the primitives package intended to include the debug name, yet the debug name was evaluated during construction before it could ever have been assigned. This commit fixes that. The Angular wrappers override the `toString()` representation to evaluate signals ad-hoc instead of showing their internal state, and this commit aligns their behavior to include the debug name in `toString` as well.
JoostK
commented
Mar 8, 2026
| if (typeof ngDevMode !== 'undefined' && ngDevMode) { | ||
| const debugName = options?.debugName; | ||
| node.debugName = debugName; | ||
| signalFn.toString = () => `[Signal${debugName ? ' (' + debugName + ')' : ''}: ${signalFn()}]`; |
Member
Author
There was a problem hiding this comment.
This wouldn't necessarily have to override toString cause it outputs the same, but I noticed an interesting difference that is likely unintentional: the primitives toString impls are non-reactive yet the Angular wrappers are reactive.
I think it would make sense to align their behavior, but which behavior to use??
JeanMeche
approved these changes
Mar 9, 2026
mturco
approved these changes
Mar 10, 2026
Contributor
mturco
left a comment
There was a problem hiding this comment.
Reviewer-for: primitives-shared
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ation
The
toString()implementations in the primitives package intended to include the debug name, yet the debug name was evaluated during construction before it could ever have been assigned. This commit fixes that.The Angular wrappers override the
toString()representation to evaluate signals ad-hoc instead of showing their internal state, and this commit aligns their behavior to include the debug name intoStringas well.