solid-devtools icon indicating copy to clipboard operation
solid-devtools copied to clipboard

debugger: track component props

Open thetarnav opened this issue 3 years ago • 0 comments

~~The debugger needs a way to track component props. Since they do not exist as an instance in the reactive graph, a special hook is necessary to track them. Later to be automatically injected by a babel transform.~~

~~The tricky part here is not necessarily getting to the props object—it'll be done one way or another—but "subscribing" to the properties without interfering with the reactive graph.~~

The props object could probably be added to the owner object when the component is created in dev. (so no babel plugin for this one) Then the props object would be mapped for the selected component every time the walker executes—instead of tracking the props signals with computations. This is to avoid interfering with the reactive graph by reading memos/signals in a tracking context. Lazy memos would over-execute, and the new pull-push mechanic in 1.5 would be messed with here as well. Parsing the props outside of the queue and untracked should reduce any potential issues.

TODO:

  • [ ] modify solid's code to attach props object to the component's owner object
  • [ ] parse the props in the tree walker
  • [ ] store, reconcile and display the props in the extension

thetarnav avatar Aug 06 '22 12:08 thetarnav