Solid.js integration
I noticed that the frontend library integration was limited to React. My team prefers using Solid because of how similar it looks to react while giving fine grained reactivity (signals ftw). I would be open to make PRs for the Solid.js integration. Is that something you guys would care for or does that increase the maintanence burden too much?
8 Replies
We're absolutely interested! We'd want to keep it as a separate repo at least initially, but if you've got something working we can talk about who keeps it updated. We'd want something to be in use first, but happy to help maintain or potentially take ownership of it if that's what would work best for you.
I'm working on a Svelte integration right now, and our CEO Jamie wrote a proof of concept Solid.js integration a while ago https://github.com/jamwt/solid-convex
GitHub
GitHub - jamwt/solid-convex: A simple app demonstrating using Solid...
A simple app demonstrating using SolidJS with Convex - jamwt/solid-convex
Also if in this work you find you need access to some convex-js internals let us know, we try to be conservative about what we make public for API guarantees but can expose helpers, utils, and types experimentally or even make them public if it makes building libraries easier.
@aadit I'd love to chat about fine-grained reactivity, I was asking around in the Svelte Discord about whether a nested reactive object or a new object each time would be preferred as the Convex value by default and was surprised to hear that a nonreactive value might be preferred.
That's awesome! I would like to start hacking away at this on the weekend. I'll take a look at that too. Should I just share progress and questions here or do you prefer somewhere else?
I thought with svelte 5 it had to be fine-grained, since svelte 5 is also moving to signals.
Here's great, or feel free to DM but for a lot of this I think it might be interesting to others
@aadit I just posted https://github.com/get-convex/convex-svelte, it uses signals but isn't particularly fine-grained
https://github.com/get-convex/convex-svelte/blob/d5185a3adcfbc9f43e6c4d52077d26959a989167/src/lib/client.svelte.ts#L50-L52 is a comment about it, I could imagine a query result that had 100 posts in it and when the query result updates there are 101 and only the new one has to render
but I think what I have here would still rerender them all. I'm still learning Svelte though, I'm not sure.
I think it depends. I'm also not hugely familiar with svelte but my understanding is that the for-loop in their template will auto-memoise and reconcile changes to avoid re-renders.
Similar to the <For/> component in solid
The docs also say that all objects are deeply reactive. So any mutation should also have fine grained propagation.
Cool, I'm used to these techniques in React but need to understand them better in Svelte and others. I plan to get something out and then listen to Svelte experts for this one 😛
Good idea. Frankly, a lot of svelte ecosystem stuff is still not using runes since Svelte 5 is going to remain backwards compatible, so there aren't many references to go off.