FormidableLabs / groqd

A schema-unaware, runtime and type-safe query builder for GROQ.
https://commerce.nearform.com/open-source/groqd
MIT License
230 stars 16 forks source link

groq-builder: zod compatibility #257

Closed scottrippey closed 9 months ago

scottrippey commented 10 months ago

What

Ensures full compatibility with Zod.
Ditches the "lite validation" that I had implemented. If Zod is not used, it can still be tree-shaken with this approach, so it's still an "optional" dependency.

Additional changes:

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **groqd** | ⬜️ Ignored ([Inspect](https://vercel.com/formidable-labs/groqd/8TBu27V4PbztqxbWkibMDBuQn3AL)) | [Visit Preview](https://groqd-git-zod-again-formidable-labs.vercel.app) | | Feb 4, 2024 0:52am |
scottrippey commented 9 months ago

I added like a hundred more commits :) I had a lot of things on the mind to fix and improve!

heggemsnes commented 9 months ago

@scottrippey not sure if this is the right format but using Zod for all validation will certainly slow down the editors and possibly noticable runtime validations as queries become complex.

Added a bit context in #261 but after using Groqd for >10 production projects we are scrambling for an option as developer experience has become intolerable.

scottrippey commented 9 months ago

I'd love to discuss! For our next major release, we've made zod optional, so maybe that will help with your performance issues. However, we've added a lot more TypeScript in order to enable auto completion too.

I'd love to hear more about the kind of performance issues you've experienced. Are these run time issues? Or TypeScript + IDE performance issues?