Skip to content
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

Add a way to inspect reactive dependency graph #3466

Open
mscofield0 opened this issue Jan 9, 2025 · 2 comments
Open

Add a way to inspect reactive dependency graph #3466

mscofield0 opened this issue Jan 9, 2025 · 2 comments

Comments

@mscofield0
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Debugging use-after-dispose issues without a way to definitively know the reactive chain is insane.

Describe the solution you'd like
I would like to see the reactive dependency graph in some way, the rendering part doesn't have to be a part of this PR, or a part of Leptos at all, ever, but just give us the underlying graph object so we can inspect and render it ourselves.

Describe alternatives you've considered
None that come to mind, I'm all ears if there's already a way to debug such issues well.

@gbj
Copy link
Collaborator

gbj commented Jan 11, 2025

See also discussion in #1378. IMO using tracing to hook into the many tracing events the library provides is the most useful way to build a general solution here.

Alternately, if you only want to provide the dependency graph itself, this can probably be done by piggybacking on the various subscriber traits.

On the other hand, the statement of the problem is actually about ownership, not about the reactive dependency graph at all. There are some simple ownership debugging tools built in as the debug_id() and ancestry() methods on Owner, which can help with seeing what the chain of ownership is at any given location.

@mscofield0
Copy link
Contributor Author

mscofield0 commented Jan 11, 2025

There are some simple ownership debugging tools built in as the debug_id() and ancestry() methods on Owner, which can help with seeing what the chain of ownership is at any given location.

My main problem with that API is that I can't query the defined_at information from the debug_id. I would want information on each signals' exact definition location and usage location across the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants