erquhart
erquhart2y ago

Hey all finally trying out Convex here

Hey all, finally trying out Convex here on a react native app that I'm moving toward launch. I've been on urql + graphql-codegen + Hasura + Neon/Heroku for a while now and it's really hitting me how much effort it's going to take to get to production, and then to maintain from there. The app is pretty reactive, fair amount of subscriptions, and a number of load bearing postgresql triggers. I have an "ephemeral staging" setup in CI that works really well. And Convex seems like it's at a place where it may be able to replace all of that. Here's hoping! My main question is, based on that short description, can you think of any blockers that I may run into? And finally a more specific question: your react native/expo quickstart says to install react-dom - guessing that's a typo, but just wanted to confirm.
9 Replies
sshader
sshader2y ago
To answer the specific question first: Not a mistake, but definitely a little weird. We're using unstable_batchedUpdates on ReactDOM (https://github.com/get-convex/convex-js/blob/5acc827a9c21e38f995d75222dd8d4a2d3fb7eb3/src/react/client.ts#L478) to support React 17 users even though actually using react-dom for the DOM stuff doesn't make sense in React Native. For your main question, it sounds like a lot of this would be a fit with Convex! Convex is fully reactive which makes it easy to support things like reactive subscriptions. We don't yet support the "ephemeral staging" setup, but likely want to in the future. We'd love to hear how this goes, and we're here for any questions!
GitHub
convex-js/src/react/client.ts at 5acc827a9c21e38f995d75222dd8d4a2d3...
TypeScript/JavaScript client library for Convex. Contribute to get-convex/convex-js development by creating an account on GitHub.
jamwt
jamwt2y ago
@erquhart hey! yep, convex is exactly designed to replace that stack with something much better. we have several people with react native apps in production, so have some experience we can tap into. I think you'd find convex a good fit
erquhart
erquhartOP2y ago
Awesome, thank you both! Convex has a few gaps compared to a traditional setup, but I don't see any blockers yet, just batteries included vs. not. I was already using Clerk, transitioning that over to Convex was simple. Overall, I'm pretty mindblown so far. @sshader thanks for the info - I'm on react 18 so trying w/o react-dom 🤞
ballingt
ballingt2y ago
Based on our source it looks like you are going to need react-dom https://github.com/get-convex/convex-js/blob/main/src/react/client.ts#L17-L33 but you can see the only thing we use it for is the batched updates https://github.com/get-convex/convex-js/blob/main/src/react/client.ts#L477-L489 If including react-dom is a problem we can address this, could be a separate entry point/build for React 17 or for react-native
erquhart
erquhartOP2y ago
I haven't seen any errors yet, but def no problem including it if you know it's load bearing 👍
ballingt
ballingt2y ago
if it works without, great! would mean the react-native bundler is craftier than I'm giving it credit for, hard to imagine what it's going to do with that one line of code where we use the api
erquhart
erquhartOP2y ago
I'll leave it out for now and find out 🙂
ballingt
ballingt2y ago
ah here's an example of how to make this a no-op for React Native, we can do this! https://gist.github.com/vincentriemer/1c761d9d31d85e9077cf82546ef62f5b
erquhart
erquhartOP2y ago
oooh nice!

Did you find this page helpful?