stcobbe
stcobbe
CCConvex Community
Created by stcobbe on 10/15/2024 in #support-community
Recommended pattern for initializing useQuery with server loaded value
That sounds great, @ballingt! I know you're all super busy so I don't expect much here but any sense of when y'all might be able to get around to exposing such a promise?
23 replies
CCConvex Community
Created by stcobbe on 10/15/2024 in #support-community
Recommended pattern for initializing useQuery with server loaded value
@ballingt: Yea it's a little bit niche: my desired behavior is that the initial page load be preloaded with data that is fetched server side and waited on, and then resumes live after client side render (no loading UI in this case). However, for my use case, after client side render, certain actions can be taken that will result in fetching new data. It's in response to these client side actions that I want to display loading UI. I'm able to do this with result === undefined checks, but I prefer the Suspense / Boundary patterns, so I was hoping to have the option to somehow use usePreloadedQuery to achieve this. To summarize, I want the following behavior: 1. Preload data server side with await preloadQuery (no loading UI necessary) 2. Resume live client side with usePreloadedQuery 3. Support subsequent client side actions that refetch all data (display loading UI using Suspense ideally) To make it more concrete, I made a Loom video of the UI I'm working on: https://www.loom.com/share/05feb91800354a0396be12a0793a4d1a. In the video, the chat messages are initially preloaded with no loading state. But I want to display loading state when you select a new chat from the dropdown. Please let me know if I can provide any additional context. Appreciate the help here!
23 replies
CCConvex Community
Created by stcobbe on 10/15/2024 in #support-community
Recommended pattern for initializing useQuery with server loaded value
Minor follow up question: any pointers (maybe a community implementation?) on how to implement a wrapper around usePreloadedQuery to support using React Suspense for implementing loading states? I'm struggling to adapt the useQuery example wrapper for Suspense for usePreloadedQuery . See: https://discord.com/channels/1019350475847499849/1295933266200891452
23 replies
CCConvex Community
Created by stcobbe on 10/15/2024 in #support-community
Recommended pattern for initializing useQuery with server loaded value
This is exactly what I was looking for @jamwt. Appreciate the reply and sorry I missed this. Loving Convex, keep up the great work!
23 replies
CCConvex Community
Created by stcobbe on 7/8/2024 in #support-community
Self-reference in validators
Got it, thank you @ballingt
3 replies
CCConvex Community
Created by stcobbe on 1/15/2024 in #support-community
Self-hosted support
I think the main consideration is selling the security / compliance of the cloud providers is easier than selling that of Convex (as it's still a relatively new company) rather than functionality
12 replies
CCConvex Community
Created by stcobbe on 1/15/2024 in #support-community
Self-hosted support
The latter. We're running on GCP. You're right that in both cases Convex is running on a major cloud provider but having more subprocessors complicates the sale for us (and in theory introduces more attack surface)
12 replies
CCConvex Community
Created by stcobbe on 1/15/2024 in #support-community
Self-hosted support
Thanks @lee and @Michal Srb. Data ownership is the primary reason. We're building a security product with sensitive access to customer systems, so we want to limit the number of data subprocessors we have. Based on the above post, though, it sounds it's not Convex' intention to support our use case. We want to able to support single tenant production deployments hosted exclusively in our cloud.
12 replies