Full announcement: arktype.io/docs/blog/2.2
I couldn't be more hyped to see what you do with it.
⚡ arktype.io/docs/intro/setup
⭐ github.com/arktypeio/arktype
👋 arktype.io/discord
If you want to support this work: github.com/sponsors/arktypeio
Posts by ArkType
@ark/json-schema — Bidirectional JSON Schema
Parse JSON Schema into ArkType Types, and convert Types to JSON Schema. Huge thanks to @TizzySaurus
for building this one.
toJsonSchema() now supports configurable fallbacks, draft-07/2020-12 targets, and cyclic types.
Standard Schema validators can now be embedded directly in ArkType definitions.
Zod, Valibot, or anything else that implements the spec.
Type-safe regex via arkregex
Regex literals in your definitions now carry full type inference. x-prefix parses capture groups at runtime.
type.fn
Define runtime-validated functions using the same syntax you already know.
Defaults, optionals, variadics- it all works.
📢ArkType 2.2 is here.
This is a big one, and it's long overdue.
Validated functions, type-safe regex, bidirectional JSON Schema, and universal schema interop.
Here's what's new 🧵
strategy is summarized here:
x.com/ssalbdivad/s...
🛝 playground: arktype.io/playground
📚 docs: arktype.io
👋 discord: arktype.io/discord
⭐ github: github.com/arktypeio/arktype
all you need to "learn" ArkType syntax:
1️⃣ start with a typescript keyword
2️⃣ .autocomplete to discover constraints
3️⃣ compose if needed with &, |, etc.
Yeah unfortunately without build-time transforms (which come with their own limitations), this is probably about as close as you will get to TypeScript at runtime.
tools are just introspectable functions...
what if you could define them like this?🤔
📚 match docs: arktype.io/docs/match
👋 discord: arktype.io/discord
⭐ github: github.com/arktypeio/ar...
wish TS had rust-style pattern matching?
(it already does)🪄
🚨Standard JSON Schema v1 just dropped🚨
🟢libraries can now accept ArkType wherever they need JSON Schema
🟢100% type-safe with inference built-in
🟢day one support from AI SDK
🟢TanStack AI and MCP SDK support imminent
🎉Announcing Standard JSON Schema🎉
The next spec in the Standard Schema family is here to bring library-agnostic JSON Schema to TS.
Let's make sure everyone sees it🔁
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
mission accomplished @mattpocock.com
BETRAYAL
📚 docs: arktype.io
👋 discord: arktype.io/discord
⭐ github: github.com/arktypeio/arktype
"bUt StRiNgS aReN'T tYpE sAfE"
📚 docs: arktype.io
👋 discord: arktype.io/discord
⭐ github: github.com/arktypeio/arktype
95% of ArkType syntax is just TypeScript.
The other 5% are extensions like this that are...
✅composable
✅consistent across data types
✅100% safe with helpful type-level error messages
📚 docs: arktype.io
👋 discord: arktype.io/discord
⭐ github: github.com/arktypeio/arktype
once you go type("string") you never go z.back()
Yeah we considered that syntax but it was cleaner to separate them since it won't always be a string definition that goes there (could be a reference to another type) so for now it just makes it easier to always think about spreading the same way.
📚 docs: arktype.io/docs/blog/arkregex
👋 discord: arktype.io/discord
⭐ github: github.com/arktypeio/arktype
Difficulty of Parsing Regex with TypeScript Types
------------------------------------------------------------
group associativity ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
everything else ▒▒
📚 docs: arktype.io
👋 discord: arktype.io/discord
⭐ github: github.com/arktypeio/arktype
In the next version of ArkType, any Standard Schema is a valid definition.
Zod migration is about to get a whole lot easier🚀