thank you!!
Posts by Colin McDonnell ๐ Zod
yaaasssss
no but they could probably benefit from it!
Visit the website to see the fulltext spec, FAQs, integration examples, and more standardschema.dev/json-schema
If you implement or integrate with the spec, don't forget to submit a PR adding yourself to the website โ๏ธ
The following schema libraries have implemented day-one support for the spec ๐
Note the minimum versions (these we're all released in the last few weeks)
This takes the onus off the end user to properly convert their schemas correctly to the format expected by some consuming library, eliminating a swath of potential footguns & unnecessary DX complexity
It puts control in the hands of the *consuming library*. Given a spec-compliant entity, they can:
โข extract a JSON representation of either its input or output type
โข control the *draft version* of the produced JSON Schema
โข pass library-specific config
This is the first ecosystem-wide standard representation that unifies runtime and static type information
Essentially "JSON Schema with inferred types" โ which unlocks totally new APIs for frameworks & AI tools
Introducing โจ Standard JSON Schema โจ
It's a sister spec to Standard Schema that provides a common interface for any entity that can be converted to JSON Schema
wish I'd thought of this 3 days ago ๐ซ
thanks Ryan!!
right!?!?
thanks josh! really looking forward to having you play with it!
check out the website for a more detailed explanation, and to join the waitlist. we'll be letting people in over the next few weeks! pullfrog.com
Pullfrog is the "agent x GitHub" integration I wish existed
๐ธ can plan, review, and implement PRs (and more)
๐ธ GitHub-first (no new UI)
๐ธ agent-agnostic (bring your own agent / API key)
๐ธ runs in GitHub Actions
๐ธ configurable: custom per-trigger prompts, automations, etc
we're taking a stab at a problem we're familiar with: improving the DX of iterating on code (with AI) inside of GitHub.
having closed 6000 issues and PRs on Zod/ArkType over the last 5 yearsโwe have thoughts.
sounds fake but I'm starting a company with my nemesis David E. ArkType
and our first hire is @andarist.bsky.social
and our first product is now in beta :)
as you said, "decode" and "parse" are essentially synonymous. encoding is the new thing here, and it's the inverse of parse. but in anycase, this isn't something I just came up with: see io-ts and Effect Schema.
for a more detailed technical breakdown of codecs, read the associated blog post ๐ colinhacks.com/essays/intro...
including...
โ
stringToNumber
โ
stringToInt
โ
stringToBigInt
โ
numberToBigInt
โ
isoDatetimeToDate
โ
epochSecondsToDate
โ
epochMillisToDate
โ
jsonCodec
โ
utf8ToBytes
โ
bytesToUtf8
โ
base64ToBytes
โ
base64urlToBytes
โ
hexToBytes
โ
stringToURL
โ
uriComponent
instead of providing first-party APIs for commonly-needed codecs, Zod is taking a page from shadcn
fully-tested versions of 16 commonly-needed codecs are available on the new Codecs page. you're encouraged to copy/paste/customize them as needed ๐
zod.dev/codecs
Codecs is useful when mapping data between two different domains. for instance, when converting data in your Node.js backend from a rich JavaScript representation (Dates, BigInts, Maps, Sets, etc) into a JSON-serializable format (ISO datetimes, arrays, etc)
these methods are intended for use cases involving data *conversion*, not *validation* (though they do that too). so if you pass in an input of an unexpected type, you'll get a TypeScript error.
"how does .decode() differ from .parse()?"
good question! they're identical at runtime, but their type signatures differ in an important way.
unlike .parse()โwhich accepts `unknown` inputโdecode and encode expect strongly-typed inputs
It is coupled with the addition of new methods (available on all Zod schemas)
.decode() โ "forward" parsing
.encode() โ "reverse" parsing
Introducing Zod 4.1 and its flagship feature: codecs.
z.codec() is a new API for defining *bi-directional transformations* in Zod
in the absence of an existing convention, I'm adding these three fields to Zod's package.json.
making this stuff auto-discoverable would resolve one of the biggest usability issues with today's agents/IDEs. a simple convention here will go a long way! ๐ค
sounds like you found an alternative but the answer is "not at all". MIT license, go ham :)
very nice ๐คฉ