You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support introspecting types, annotations, and more in macros. My main theoretical usecase is writing a zod-type library that doesn't require advanced conditional typescript, and can compile to the most performant version of serializers and deserializers. Very similar to Serde.
🤔 Expected Behavior
I don't know exactly the semantics of how this behavior might work, but here's an example of what I'd like to be able to do:
import{Serde,Field}from'serde'import{objectDeserialize,jsonDeserialize}from'serde'with{type: 'macro' }
@SerdeclassMyData{
@Field({minLength: 10})publicpassword: string
@Field({validateEmail: true})publicemail: string;}constmyResponse=Response(...)// Deserialize from stringconstjsonDecoded=jsonDeserialize<MyData>(awaitmyResponse.text())// Deserialize from untyped objectconstobjectDeserialize=objectDeserialize<MyData>(awaitmyResponse.json())
😯 Current Behavior
Can't introspect type arguments to be able to code-gen against it
💁 Possible Solution
Not really sure how to implement it
🔦 Context
See the example above :)
💻 Examples
See the example above :)
The text was updated successfully, but these errors were encountered:
🙋 feature request
Support introspecting types, annotations, and more in macros. My main theoretical usecase is writing a
zod
-type library that doesn't require advanced conditional typescript, and can compile to the most performant version of serializers and deserializers. Very similar to Serde.🤔 Expected Behavior
I don't know exactly the semantics of how this behavior might work, but here's an example of what I'd like to be able to do:
😯 Current Behavior
Can't introspect type arguments to be able to code-gen against it
💁 Possible Solution
Not really sure how to implement it
🔦 Context
See the example above :)
💻 Examples
See the example above :)
The text was updated successfully, but these errors were encountered: