A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/DZakh/rescript-schema below:

DZakh/sury: 🧬 The fastest schema with next-gen DX

Sury (aka ReScript Schema) 🧬

The fastest schema with next-gen DX.

Highlights:

Also, you can use Sury as a building block for your own tools or use existing ones:

⚠️ Be aware that Sury uses new Function for parsing. The approach is battle tested and has no known security issues. It's also used by TypeBox, Zod@4 and ArkType. Even Cloudflare Workers recently added support for it.

Instead of relying on a few large functions with many methods, Sury follows Valibot's approach, where API design and source code is based on many small and independent functions, each with just a single task. This modular design has several advantages.

For example, this allows a bundler to use the import statements to remove code that is not needed. This way, only the code that is actually used gets into your production build. This can reduce the bundle size by up to 2 times compared to Zod.

Besides the individual bundle size, the overall size of the library is also significantly smaller.

At the same time Sury is the fastest composable validation library in the entire JavaScript ecosystem. This is achieved because of the JIT approach when an ultra optimized validator is created using new Function.

Sury@10.0.0-rc.0 Zod@4.0.0-beta TypeBox@0.34.33 Valibot@1.0.0 ArkType@2.1.20 Total size (min + gzip) 14.1 kB 25.9 kB 31.4 kB 12.6 kB 45.9 kB Benchmark size (min + gzip) 4.27 kB 13.5 kB 22.8 kB 1.23 kB 45.8 kB Parse with the same schema 94,828 ops/ms 8,437 ops/ms 99,640 ops/ms (No transforms) 1,721 ops/ms 67,552 ops/ms Create schema & parse once 166 ops/ms 6 ops/ms 111 ops/ms (No transforms) 287 ops/ms 11 ops/ms JSON Schema S.toJSONSchema z.toJSONSchema 👑 @valibot/to-json-schema T.toJsonSchema Standard Schema ✅ ✅ ❌ ✅ ✅ Eval-free ❌ ⭕ opt-out ⭕ opt-in ✅ ⭕ opt-out Codegen-free (Doesn't need compiler) ✅ ✅ ✅ ✅ ✅ Infered TS Type S.Schema<{foo: string}, {foo: string}> z.ZodObject<{foo: z.ZodString}, {}> TObject<{foo: TString}> v.ObjectSchema<{readonly foo: v.StringSchema<undefined>}, undefined> Type<{foo: string}, {}> Ecosystem ⭐️⭐️ ⭐️⭐️⭐️⭐️⭐️ ⭐️⭐️⭐️⭐️⭐️ ⭐️⭐️⭐️ ⭐️⭐️

If you're enjoying Sury and want to give back, that would be rad!

Your sponsorship doesn't go towards anything specific – it's simply a wonderful way to say "thank you" and make me happy. 😁

Donate with USDT:

DM me on X/Twitter if you want to be featured or just to say hi! This would mean so much to me. ✨


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4