Change behavior of prop tracing to avoid evaluating lazy values #2072
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.
The issue is #1952: Passing a lazy type like a derived
Signal
or aMemo
as a component property now causes them to be eagerly evaluated before they're actually used. This is because theSerialize
implementation for signals/memos reads their value. This is surprising because users do not expect these values to be read simply by passing through a component, and it changes the behavior/execution order of the program.Switching to
Debug
, which doesn't read the inner value of a memo/signal, resolves the issue, but changes exactly what is logged by this tracing integration.@luoxiaozero I'd be curious to hear your thoughts on this, since it was your contribution initially. Is switching to
Debug
here compatible with your use case, or do we need to try some further autoref specialization to create a special implementation for reactive types that doesn't useSerialize
?