Skip to content

PoC: Make zod optional #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 of 4 tasks
scottrippey opened this issue Sep 25, 2023 · 1 comment
Closed
3 of 4 tasks

PoC: Make zod optional #202

scottrippey opened this issue Sep 25, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request investigate

Comments

@scottrippey
Copy link
Member

scottrippey commented Sep 25, 2023

GroqD is a query builder with 2 main features: strong output types, and runtime validation of input types.

This PoC is to determine if we can make runtime validation optional.
Reasons:

  • If we were able to add strong input types, then it's reasonable to say that runtime validation would be redundant
  • Eliminates Zod dependency (majority of this package currently)
  • Allows any "runtime validation" library to be used, or none if the schema is trusted
  • This would need to be a major version bump

Task list:

  • Create new API with similar structure to existing API
  • Eliminate Zod validations
  • Introduce "generic" validation types that are compatible with Zod (eg with signature like { parse<T>(input: unknown): T })
  • Ensure "inferred schema" can be compiled to a *.d.ts file, to alleviate perf issues
    • Update: this cannot be accomplished
    • Possible alternatives include manually-typing the schema (and performing a cross-check against inferred types) or finding a performant alternative
@scottrippey scottrippey self-assigned this Sep 25, 2023
@scottrippey scottrippey added enhancement New feature or request investigate labels Sep 25, 2023
@scottrippey
Copy link
Member Author

Update: this will be completed as part of groqd with the groq-builder package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request investigate
Projects
None yet
Development

No branches or pull requests

1 participant