panzacoderP
Convex Communityโ€ข2y agoโ€ข
7 replies
panzacoder

Hello world! ๐Ÿ‘‹

Hello world! ๐Ÿ‘‹

I recently started using Convex for two different NextJS projects and been really enjoying it so far.

One thing that has been a little confusing the deeper in I get is the convex-helpers package. It's really helpful at reducing duplication, but it feels odd that it's not deeply referenced/built into the docs. It actually introduces some new patterns for defining schemas/building functions that aren't really talked about at all int he docs.

One of the things I like the most about Convex is how complete, cohesive, and straightforward the docs are. So to now have a second source of truth to reference when building out my convex-functions is not as great for me.

I know it's not all that different, but here's an example that I don't love.

Defining Tables
Docs
export default defineSchema({
  users: defineTable({
    name: v.string(),
    tokenIdentifier: v.string(),
  }).index("by_token", ["tokenIdentifier"]),


Helpers
import { Table } from "convex-helpers/server";

export const Users = Table("users", { 
  name: string,
  tokenIdentifier: string,
});

export default defineSchema({
  users: Users.table.index("tokenIdentifier", ["tokenIdentifier"]),
});


So, there's a whole separate set of tools and syntax for defining tables available in the helpers, I found that only by reading the code referenced by an example referenced by the withUser hook. And now I have like 2-3 blog posts to read to find out what the most up-to-date best practice is.

I kind of loved the simplicity of the docs, but now I'm afraid that I don't know what is up to date and what's not. Any thoughts about my take here? Should I take convex-helpers/Stack posts with a grain of salt because they aren't evergreen, or should I be looking there for the best approach to new problems?
Was this page helpful?