jmp
Using SolidJS Playground in custom docs
I'd like to use the solidjs playground for interactive documentation of my library. (Should I use sandpack instead?) I noticed that an old version of
solid-repl
has been published to npm, but it hasn't been updated in a year. Meanwhile solid-playground
seems to be chugging along, but it's not published.
How can I use solidjs playground (or an equivalent live code editor) for my documentation? Thanks in advance!4 replies
What's the best way to make a docs website?
I'm building a SolidJS library and want to make a simple docs website for it. I'm hoping to leverage an existing library (not necessarily specific to Solid) for the scaffolding so I can focus on writing the contents of the docs. What do people recommend currently? Docusaurus? Vitepress? If so, how do I go about using Solid with these libraries?
Thanks!
1 replies
Coordinating Signals in a Layout System
Hi all, I'm trying to implement a layout system in SolidJS that works similarly to mobile frameworks like Jetpack Compose and SwiftUI. In my system, you write things like this:
And each of those components internally calls a special
<Layout>
component, e.g.:
Layout
roughly looks like this:
Note that props.layout
should be idempotent so I can safely call it more than once, even though it sets signals inside updateBBox
. I need to cache/memoize props.layout
since it is expensive to compute. According to the docs, it sounds like I shouldn't use createMemo
since layout does have side effects.
The problem I'm having is that in Parent
's layout
function, it needs to ensure that its children's layout
functions have been run so their bboxes are up to date. E.g.:
The problem is that the parent effect runs before the child effect. What's the best way to accomplish ensure that the child layout is up to date when getBBox
is called?
Thanks!33 replies