Skip to content

Commit 6170f49

Browse files
authored
Add mention of resolving component elements to solid-usage.md
1 parent 508bc73 commit 6170f49

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

solid-usage.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ By node I mean any solid internal object, like owners, signals, roots, store-nod
6262

6363
- Reads `owner.owner` and `owner.owned` to walk the tree in both directions
6464

65+
### Components
66+
67+
- Component functions are wrapped with `devComponent` when called.
68+
- To get component elements, I read `owner.value` of a component and walk the recieved arrays or functions to get to the elements. This is the only way to map elements to components, which is important for the [locator feature](https://github.com/thetarnav/solid-devtools/tree/main/packages/debugger#using-component-locator).
69+
- [source code](https://github.com/thetarnav/solid-devtools/blob/508bc73783c049478a629960ee353219a4b9a953/packages/debugger/src/main/utils.ts#L154-L172)
70+
71+
#### Issues
72+
73+
- Calling signals to get to the elements is bad. I might call it before it's supposed to be read causing side effects. And there is no way of knowing when the elements might have changed without subscribing to the read signals, or invalidating the results on every reactive update.
74+
6575
### Owner disposing
6676

6777
- Writing to `owner.cleanups` to listen to cleanup of any owner — [source code](https://github.com/thetarnav/solid-devtools/blob/main/packages/debugger/src/main/utils.ts#L205-L227)

0 commit comments

Comments
 (0)