ian
CCConvex Community
•Created by reggieofarrell on 12/17/2024 in #support-community
local dev environment?
It will be cloud hosted, but talk to your local instance from browser <-> instance iiuc, so your local data wouldn't go through the cloud.
6 replies
CCConvex Community
•Created by reggieofarrell on 12/17/2024 in #support-community
local dev environment?
There's a few options here.
1. By default each developer on a project has their own "dev" deployment in addition to the shared "prod" deployment. So you have a browser GUI and an app that will behave like prod, by default.
2. You can run Convex locally using the open source binary, but it doesn't have a dashboard UI.
3. We are working on / have a working prototype of running a local backend, and connecting that to the browser dashboard, so the dashboard can let you browse and interact with local data. I can't recall when that will ship though.
6 replies
CCConvex Community
•Created by wess on 12/16/2024 in #support-community
debouncing
also https://stack.convex.dev/throttling-requests-by-single-flighting
But there's a possibly better version here: https://discord.com/channels/1019350475847499849/1227833156237791252/1228066992624238613
13 replies
CCConvex Community
•Created by noob saibot on 12/13/2024 in #support-community
Help me better understand paginated queries
not sure if this is a typo, but
.order("descr")
isn't a thing I know of. .order("desc")
is the way to reverse the ordering. I'm not sure why you're seeing different results with different orders, maybe to do with the typo, but ordering shouldn't affect anything. If you have a repro of that it'd be great to get to the bottom of. Glad the pagination is working for you!8 replies
CCConvex Community
•Created by noob saibot on 12/13/2024 in #support-community
Help me better understand paginated queries
ah yeah, the code for paginate in the filter helper is just applying the filter to the paginated results: https://github.com/get-convex/convex-helpers/blob/main/packages/convex-helpers/server/filter.ts#L55
8 replies
CCConvex Community
•Created by noob saibot on 12/13/2024 in #support-community
Help me better understand paginated queries
To most efficiently fetch this data, paginate over the members table, then do a
db.get
for all the associated campaigns. As is, it's walking the entire campaigns table and applying the filter to each row, so it might be getting exhausted in how many rows it can fetch before it just returns what it's found so far.8 replies
CCConvex Community
•Created by nikhildhoka on 12/12/2024 in #support-community
corsHttpRouter
Shipped in
convex-helpers@0.1.67
https://www.npmjs.com/package/convex-helpers#cors-support-for-httprouter14 replies
CCConvex Community
•Created by CabalDAO on 11/1/2024 in #support-community
Errors importing dayjs plugins
Hey this is very late, but I was deep in the CORS spec last night working on a
corsRouter
that wraps httpRouter
. The problem you were seeing I believe is that to pass credentials, you need Access-Control-Allow-Credentials: true
but in order to do that, you can't return *
: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#credentialed_requests_and_wildcards
You can use my helper and it will automatically reply with the origin that made the request (when you have * or a matching domain), the methods that you defined, and a default set of headers you can extend if you need. It's out in alpha, and will launch in the next patch release of convex-helpers
`https://github.com/get-convex/convex-helpers/pull/19723 replies
CCConvex Community
•Created by nikhildhoka on 12/12/2024 in #support-community
corsHttpRouter
Once I get another pair of eyes to sanity check the CORS spec I'll publish it in the next patch release
14 replies
CCConvex Community
•Created by nikhildhoka on 12/12/2024 in #support-community
corsHttpRouter
@nikhildhoka I published it in
convex-helpers@0.1.67-alpha.0
14 replies
CCConvex Community
•Created by nikhildhoka on 12/12/2024 in #support-community
corsHttpRouter
how soon is ASAP? I could get you a fast version to work with (with an alpha release) but then maybe need to make some breaking changes.
14 replies
CCConvex Community
•Created by nikhildhoka on 12/12/2024 in #support-community
corsHttpRouter
I'm specifically referring to configuring how it handles specifying this header, and the implications on other configs when doing so: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials
14 replies
CCConvex Community
•Created by nikhildhoka on 12/12/2024 in #support-community
corsHttpRouter
Tom Redman isn't working at Convex anymore, but I'm chatting with another engineer about approaches so hopefully it can land in earnest.
14 replies
CCConvex Community
•Created by nikhildhoka on 12/12/2024 in #support-community
corsHttpRouter
The PR stalled out: https://github.com/get-convex/convex-helpers/pull/191
Sorry we haven't followed up here, but the code is currently there. I have some lingering hopes for refactoring & supporting credentials configuration, which is why I've hesitated landing it as-is.
14 replies
CCConvex Community
•Created by David Alonso on 12/11/2024 in #support-community
Debounce calls to a mutation without doing so for the optimistic update
The current example reflects all changes locally immediately and single-flights the updates. So there isn't one mutation per keystroke, the updates are batched. At fastest it will be in a constant loop of rebasing & submitting changes since the last submission. The comment on configurable debouncing means:
- The first keystroke when the system is idle will trigger the first update, vs. always waiting at least a little time for multiple changes to accumulate.
- It doesn't have configuration for how often snapshots are submitted. I could see usecases for (a) on every submission, (b) every N operations, (c) after editing has died down - maybe N seconds after the latest keystroke, or (d) dynamic based on the size of the document and size of deltas (automerge chooses to compact when the binary size of the deltas exceeds the binary size of the last compaction, so it writes bigger documents less frequently)
You can see my single flighting logic here, and an old article on implementing single flighting here (though a Discord user made a much simplified version here I haven't verified but seems right)
10 replies
CCConvex Community
•Created by too_easy on 11/25/2024 in #support-community
ConvexAuthNextjsServerProvider not exported
run
npx @convex-dev/auth@latest
to run the latest version I believe12 replies
CCConvex Community
•Created by jordan on 12/7/2024 in #support-community
Any idea why `NEXT_PUBLIC_CONVEX_URL` is required in a vercel deployment of using convex auth?
In local dev maybe
.env.local
has the NEXT_PUBLIC_CONVEX_URL set, or maybe they're setting storageNamespace
You can also call code that defaults to it in nextjs, such as fetchQuery
or preloadQuery
, if you don't pass in a custom url
10 replies
CCConvex Community
•Created by jordan on 12/7/2024 in #support-community
Any idea why `NEXT_PUBLIC_CONVEX_URL` is required in a vercel deployment of using convex auth?
The auth provider defaults to that env variable name unless you override it, for a few things like the storageNamespace https://github.com/search?q=repo:get-convex/convex-auth%20NEXT_PUBLIC_CONVEX_URL&type=code
10 replies
CCConvex Community
•Created by Tiago Freitas on 12/4/2024 in #support-community
CRDT for text editors
Yeah Yjs would replace the OT implementation. So you'd use Convex to sync YJS, which could replace the OT approach. It may come with some caveats which come up when building with it. The OT approach would then be the simpler approach for folks who don't want to go with yjs / prefer the OT model
38 replies
CCConvex Community
•Created by Tiago Freitas on 12/4/2024 in #support-community
CRDT for text editors
Yeah I'm going to push this one through to do OT-only and then look at Yjs. I agree that avoiding that complexity sounds good, but if syncing Yjs is a transparent layer, then maybe it won't be much for end users to worry about. they'll just set up the extension, let my component do the syncing, and just have a similar API to read document snapshots, make changes, have authorization logic on the server, etc. TipTap and BlockNote use Yjs directly for their collab features, so yeah it'd be something more custom to build with Convex (and I really don't want to add & support custom UI presence elements if I don't have to, would like to just support a small well defined syncing layer)
38 replies