feat: print inner value in Debug
impls
#2384
Closed
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.
When developing websites in
leptos
it's very useful to be able to quickly debug-print various signals and see what's inside them. Accessing them is already an option, but it's verbose during a critical point in the iteration cycle and doesn't work well for nested signals.No subscription happens when debug-printing.
The main issue here is that this means that debug-printing can panic if the signal is disposed of. We can partially work around that by using the
try_
versions of the access methods, but we can't work around it for signals accessed within derived signals as far as I can tell.We didn't expect this to be a problem, so internally we opted for consistency (every signal panics when accessed after disposal), but I can change it if preferred.
Finally, the added bounds are a breaking change. We didn't have any issues, but depending on the plan for future versions it might make sense to just close this and consider it in the future reactive system.