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

Improve displaying values of getters #109

Closed
thetarnav opened this issue Sep 6, 2022 · 0 comments · Fixed by #202
Closed

Improve displaying values of getters #109

thetarnav opened this issue Sep 6, 2022 · 0 comments · Fixed by #202
Labels
enhancement New feature or request solid Changes to solid are required

Comments

@thetarnav
Copy link
Owner

#107 added support for component props, but only the static props have their values displayed. This is because we don't want the debugger to read the getters, those—if not memorized—will over execute their function. This is mainly important for passing JSX as props—executing them will create dom nodes every time.

There needs to be a way to solve it though. Seeing the values of getters could be very important in some cases.
Preact devtools showed that they can do it. Their signal API design puts them at an advantage here, but to some degree, the same patterns could be implemented here.

The key to the solution might be a way to proxy the props object before providing it as a function argument and intercept property reads, saving and displaying the last read value.
This way we would display without executing them outself.
The problems here are stale values. getter not yet read won't have it's value, and getter that is not currently "subscribed to" by the user, might be stale. Showing those values to the user without any indication of possibly stale values could be misleading.
Using getListener() while intercepting the read might be useful here.

@thetarnav thetarnav added the enhancement New feature or request label Sep 6, 2022
@thetarnav thetarnav added the solid Changes to solid are required label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request solid Changes to solid are required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant