QuietRocket
QuietRocket4w ago

Community Library for Nordcraft (ex-Toddle)

Hi there! I'm an ex-React/Next.js fullstack dev migrating my stack over to Convex and Nordcraft (ex "Toddle"). I am currently building a community package for Convex so that the Nordcraft community and myself can benefit from Convex. I am inspiring my implementation off of https://github.com/get-convex/convex-svelte My question is: In order to benefit from "The Zen of Convex", it seems like the client library has to do a lot of heavy lifting for caching etc. What is the bare minimum implementation needed so that users of my Nordcraft package can experience "The Zen of Convex"? Perhaps in terms of high level functionality. Please let me know if my question isn't clear, thanks 🙂
Nordcraft — The Web Development Engine
Create AAA web apps that delight your users
GitHub
GitHub - get-convex/convex-svelte
Contribute to get-convex/convex-svelte development by creating an account on GitHub.
9 Replies
jamwt
jamwt4w ago
hi! the convex-js library will do most of the heavy lifting for you
jamwt
jamwt4w ago
that's normally what other frameworks wrap
QuietRocket
QuietRocketOP4w ago
Thanks for your response Jamie! I noticed that the svelte library uses ConvexClient instead of BaseConvexClient. It seems like ConvexClient is higher level compared to BaseConvexClient. Would you still recommend using the base variant?
jamwt
jamwt4w ago
it probably depends on what level you need to attach in your environment as you probably would guess, ConvexClient is built on top of BaseConvexClient so you could start there, and then tear away to the lower level if you need more control
QuietRocket
QuietRocketOP2w ago
Hi @jamwt ! I wanted to update stating that the integration for Convex in Nordcraft was very easy. I just made a provider with a ConvexClient instance, then implemented convenient wrappers around query, mutation and action. In order to have a complete package user experience, I need to implement auth. I find Convex Auth to be a great DX despite being in beta, and it will probably fit 90% of use cases for Nordcraft. In this case, it seems like a lot of heavy lifting is done inside the next and react packages themselves rather than a separate Convex core package. In order to implement Convex Auth, what is the span for a minimal implementation assuming I follow the react one? I'd like to keep it simple and maintainable, so wondering what you think about cutting corners like only supporting local storage. And I'm not quite sure if I need to implement the mutexes etc. Thanks for your guidance 🙏
QuietRocket
QuietRocketOP2w ago
Here's the instructions Gemini gave me for the implementation based on the code for the react implementation. If you agree with it I can just follow that. Note how it doesn't mention mutxes.
jamwt
jamwt2w ago
nice to hear! when it comes to convex auth, I'm out of my depth. this is a good question for @erquhart
erquhart
erquhart2w ago
I'd say try a stripped down version and see how it goes. The mutex was introduced to address race conditions with token fetching. I don't know for certain what cases were or weren't addressed by it, but you could always add it back if you run into issues.

Did you find this page helpful?