get-convex / convex-helpers

A collection of useful code to complement the official packages.
MIT License
93 stars 16 forks source link

Separation of examples implementation and the actual module ? #65

Closed abelcha closed 3 weeks ago

abelcha commented 7 months ago

It's a bit confusing that functions with path like lib/withUser in the "convex-helpers" repo are not part of the "convex-helpers" npm module.

now I know its written at the beginning of the readme, but coming here from the link on the article you go straight to the "withUser" part without understanding that the module readme is in package/convex-helpers

and then you can't understand why the import doesn't autocomplete and why its not even in the node_modules

Should this be a different repo like convex-functions ? or at least clearly put the demo code in a separate folder here like:

I don't mind doing the pr if you are ok with this

ianmacartney commented 7 months ago

Yeah the example/ is a good idea - I just updated the README a bit. We're currently in the mixed world where some of the helpers haven't been added to the convex-helpers npm package, and still live in lib. The withUser for example needs to be copy-pasted still. Great feedback, thanks!

abelcha commented 7 months ago

Appart from those details this might be the greatest onboarding experience i ever had. I stumbled upon the website on friday and basicaly trashed 2 months of zod/hono/bun/elysia/postgre/cloudflare/prisma insanity in a weekend. And even then i has to restrained myself not to use ent cause it might be a bit to early to put on a prod app everything just worked first try, this is amazing

ianmacartney commented 5 months ago

Just wanted to say I'm still thinking about this. My current plan is to eventually have three top-level directories: packages/ examples/ tests/

That should make it clear which go where - I can split out files meant to just exercise and test helpers from a demo (or multiple demo) apps that show how to use helpers in a real example.

Open to other ideas / feedback on what would help.

On Thu, Feb 22, 2024 at 1:30 PM Abel Chalier @.***> wrote:

Appart from those details this might be the greatest onboarding experience i ever had. I stumbled upon the website on friday and basicaly trashed 2 months of zod/hono/bun/elysia/postgre/cloudflare/prisma insanity in a weekend. And even then i has to restrained myself not to use ent cause it might be a bit to early to put on a prod app everything just worked first try, this is amazing

— Reply to this email directly, view it on GitHub https://github.com/get-convex/convex-helpers/issues/65#issuecomment-1960349772, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACZQW5QEV2OPKQWN272CHDYU62F3AVCNFSM6AAAAABDT4D6T2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRQGM2DSNZXGI . You are receiving this because you commented.Message ID: @.***>

mwarger commented 2 months ago

Appart from those details this might be the greatest onboarding experience i ever had. I stumbled upon the website on friday and basicaly trashed 2 months of zod/hono/bun/elysia/postgre/cloudflare/prisma insanity in a weekend. And even then i has to restrained myself not to use ent cause it might be a bit to early to put on a prod app everything just worked first try, this is amazing

This was EXACTLY my experience, as well, down to whether or not to use ent. 🚀 I couldn't stop thinking how I have so much I don't have to worry about anymore... "just use Convex".

ianmacartney commented 3 weeks ago

Closing this out - most of the example usage is in "fooExample" or "foo.test.ts" - and the convex/lib folder is gone. I moved to having separate directories, but the relative npm path linking was brittle, so I'm keeping the examples in the root for now. Open to more feedback / PRs that move it without losing the ability to install from another directory cleanly, let me know!