Skip to content
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

[Feature] Replace zod with typeschema for a less opinionated api #353

Open
riordanpawley opened this issue Oct 10, 2023 · 2 comments
Open
Labels
⬆️ improvement Performance, reliability, or usability improvements 📦 inngest Affects the `inngest` package

Comments

@riordanpawley
Copy link

riordanpawley commented Oct 10, 2023

Is your feature request related to a problem? Please describe.
I don’t use zod but I do use a schema library. It shouldn’t matter which one.

Describe the solution you'd like
I want to get typeschema into the inngest api before the potential changes proposed by Theo bake zod in further. (I like what I saw in that video btw)
https://github.com/decs/typeschema

Describe alternatives you've considered
Just using the types with inngest EventSchema - works for now but…

@riordanpawley riordanpawley added the ✨ new New features, integrations, or exports label Oct 10, 2023
@riordanpawley riordanpawley changed the title Replace zod with typeschema for a less opinionated api [Feature] Replace zod with typeschema for a less opinionated api Oct 10, 2023
@jpwilliams
Copy link
Member

Hi, @riordanpawley! 👋

Thanks for this. We definitely want the types to feel open-ended, hence having our EventSchemas class for stacking them and providing them from different sources. We also want to make sure we're not tighly coupled with any one library (or worse, a particular version of a library - see #350).

We're looking at pretty ways to define event types centrally, most likely allowing co-locating with a function but encouraging separating them out as your usage grows. Right now this is just our EventSchemas class which can feel a bit clunky, as well as some annoyances around allowing users to type multiple fields (data, user, name transforms, etc.) in a single schema.

We're playing at the moment with encouraging serialized types (read: not pure TS types) which allows a much greater scope of freedom, especially for projects like this.

decs/typeschema looks like a great project that would take some of the custom shims we're writing off our hands! I'd love to know how it would deal with incompatible minor versions when validating. Even if it doesn't, this would be a nice problem to work on open source anyway.

@riordanpawley
Copy link
Author

We're playing at the moment with encouraging serialized types (read: not pure TS types) which allows a much greater scope of freedom, especially for projects like this.

Serialized types as in types that can be sent over network with usecase of something like: https://docs.confluent.io/platform/current/schema-registry/index.html ?

decs/typeschema looks like a great project that would take some of the custom shims we're writing off our hands! I'd love to know how it would deal with incompatible minor versions when validating. Even if it doesn't, this would be a nice problem to work on open source anyway.

I'm not sure what the deal with versioning is going to be but I think if it needs work its probably better done in the typeschema library than starting from scratch :)

@jpwilliams jpwilliams added 📦 inngest Affects the `inngest` package ⬆️ improvement Performance, reliability, or usability improvements and removed ✨ new New features, integrations, or exports labels Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ improvement Performance, reliability, or usability improvements 📦 inngest Affects the `inngest` package
Projects
None yet
Development

No branches or pull requests

2 participants