perf(aria): drop debugName from signals#32904
Conversation
The `debugName` would always be assigned into a reactive node, incurring the overhead of an additional property in each signal-like instance _and_ introducing additional hidden classes for the JS VM to deal with.
| export function computed<T>(computation: () => T): SignalLike<T> { | ||
| const computed = createComputed(computation); | ||
| // TODO: Remove the `toString` after https://github.com/angular/angular/pull/65948 is merged. | ||
| computed.toString = () => `[Computed: ${computed()}]`; |
There was a problem hiding this comment.
I removed the toString because the linked issue has been merged, but I realized this isn't identical; computed() picks up a reactive dependency whereas the primitives' toString() implementation would not.
Depending on how angular/angular#67511 gets resolved this may need to change here as well, as I think it's beneficial to keep this behavior identical to Angular's primary signal behaviors.
|
The debugName setters are still necessary to correctly work in our internal Wiz library which expects signals to have |
|
One option would be to guard this with an ngDevMode guard as is the case with Angular signals, but I don't quite know how that would interact with Wiz |
The
debugNamewould always be assigned into a reactive node, incurring the overhead of an additional property in each signal-like instance and introducing additional hidden classes for the JS VM to deal with.I noticed this in heap snapshots:
which is now:
Since the name was assigned the empty string, I decided to remove it altogether.