Reactive context in built-in components
I've looked into the source code of the core components, like: https://github.com/solidjs/solid/blob/fff8aed62b4bff78a0016c3c08ba644652ccac18/packages/solid/src/server/rendering.ts#L291
My question is: why are these components reactive at all? :]
I mean they seem to be simple JS functions, their code is not wrapped by the usual "reactive context" providers like JSX,
createMemo()
, etc.
Thanks.5 Replies
this is solid's server code where reactivity is not that useful
they simply need to function according to their logic to get the final result
Ohh, thanks. Then I looked at the wrong files, I was interested in the reactive variants... š
Maybe I found them?
https://github.com/solidjs/solid/blob/fff8aed62b4bff78a0016c3c08ba644652ccac18/packages/solid/src/render/flow.ts#L102
š
This is rocket science š
https://github.com/solidjs/solid/blob/main/packages/solid/src/reactive/signal.ts core
https://github.com/solidjs/solid/blob/main/packages/solid/src/reactive/array.ts core functions for
For
and Index
https://github.com/solidjs/solid/blob/main/packages/solid/src/render/flow.ts all the control flows
https://github.com/solidjs/solid/blob/main/packages/solid/web/src/index.ts portal and dynamic
missing pieces are here
https://github.com/ryansolid/dom-expressions/tree/main/packages/babel-plugin-jsx-dom-expressions compiler
https://github.com/ryansolid/dom-expressions/tree/main/packages/dom-expressions renderer runtimeThanks š¤Æ
I hope I will understand these one day š„¹ š
posting the last bits because it took me (a lot of us actually š¤£) some amount of time to figure out