1 line
132 KiB
JSON
1 line
132 KiB
JSON
{"success":true,"data":{"web":[{"url":"https://www.reddit.com/r/typescript/comments/1ns6vma/is_effectts_really_good_or_is_it_just_hype/","title":"Is Effect-Ts really good or is it just hype? : r/typescript - Reddit","description":"Effect is worth it if you adopt it in slices: start with typed errors, then add services for your DB and config, then bring in schema validation ...","position":1},{"url":"https://medium.com/@hjparmar1944/typescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d","title":"TypeScript Schema Migrations: Safe Evolution with Zod + OpenAPI Diff","description":"TypeScript Schema Migrations: Safe Evolution with Zod + OpenAPI Diff How to ship fast, change schemas often, and still sleep at night.","position":2,"markdown":"[Sitemap](https://medium.com/sitemap/sitemap.xml)\n\n[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNavBar&source=post_page---top_nav_layout_nav-----------------------------------------)\n\nSign up\n\n[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40hjparmar1944%2Ftypescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)\n\n[Medium Logo](https://medium.com/?source=post_page---top_nav_layout_nav-----------------------------------------)\n\nGet app\n\n[Write](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)\n\n[Search](https://medium.com/search?source=post_page---top_nav_layout_nav-----------------------------------------)\n\nSign up\n\n[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40hjparmar1944%2Ftypescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)\n\n\n\nMember-only story\n\n# TypeScript Schema Migrations: Safe Evolution with Zod + OpenAPI Diff\n\n## How to ship fast, change schemas often, and still sleep at night.\n\n[](https://medium.com/@hjparmar1944?source=post_page---byline--4b2a8cf1988d---------------------------------------)\n\n[Bytecraft](https://medium.com/@hjparmar1944?source=post_page---byline--4b2a8cf1988d---------------------------------------)\n\nFollow\n\n5 min read\n\n·\n\nNov 30, 2025\n\n[Listen](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2Fplans%3Fdimension%3Dpost_audio_button%26postId%3D4b2a8cf1988d&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40hjparmar1944%2Ftypescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d&source=---header_actions--4b2a8cf1988d---------------------post_audio_button------------------)\n\nShare\n\nPress enter or click to view image in full size\n\n\n\nLearn how to evolve TypeScript APIs safely using Zod as your source of truth and OpenAPI diff to catch breaking changes before they hit production.\n\nYou add one tiny change to a response type.\n\nCI is green. TypeScript compiles. You deploy.\n\nAnd suddenly someone’s mobile app, written three teams away, explodes because you “just” renamed a field.\n\nLet’s be real: **static typing isn’t enough** to keep schema evolution safe. You need a workflow that treats schemas as first-class, versioned artifacts — _and_ checks their impact on consumers before they go live.\n\nThis is where **Zod + OpenAPI diff** becomes a surprisingly powerful combo.\n\n## The real problem: Type safety is local, breakage is global\n\nTypeScript is great at telling _you_ when your code is broken. It’s not so great at telling other teams that you just broke _their_ assumptions.\n\nThree common failure modes:\n\n- You change a required field to optional, but a consumer relies on it always being there.\n- You rename `fullName` → `name` “for consistency”. Old clients now see `undefined`.\n- You tweak a nested object, but a BI pipeline was parsing it as a fixed shape.\n\nThe root issue: **local type safety doesn’t equal global compatibility**.\n\nWhat you want instead:\n\n1. A **single, authoritative schema** for your runtime payloads.\n2. A generated **OpenAPI contract** from that schema.\n3. A **diff step** comparing “before vs after” to flag breaking changes in CI.\n\nZod + OpenAPI diff gives you exactly that pipeline.\n\n## Zod as your source of truth\n\nIf you haven’t used Zod yet, it’s a schema declaration library that works beautifully with TypeScript:\n\n- You define schemas in code.\n- You get **runtime validation**.\n\n## Create an account to read the full story.\n\nThe author made this story available to Medium members only.\n\nIf you’re new to Medium, create a new account to read this story on us.\n\n[Continue in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3Dregwall&source=-----4b2a8cf1988d---------------------post_regwall------------------)\n\nOr, continue in mobile web\n\n[Sign up with Google](https://medium.com/m/connect/google?state=google-%7Chttps%3A%2F%2Fmedium.com%2F%40hjparmar1944%2Ftypescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d%3Fsource%3D-----4b2a8cf1988d---------------------post_regwall------------------%26skipOnboarding%3D1%7Cregister%7Cremember_me&source=-----4b2a8cf1988d---------------------post_regwall------------------)\n\n[Sign up with Facebook](https://medium.com/m/connect/facebook?state=facebook-%7Chttps%3A%2F%2Fmedium.com%2F%40hjparmar1944%2Ftypescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d%3Fsource%3D-----4b2a8cf1988d---------------------post_regwall------------------%26skipOnboarding%3D1%7Cregister%7Cremember_me&source=-----4b2a8cf1988d---------------------post_regwall------------------)\n\nSign up with email\n\nAlready have an account? [Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40hjparmar1944%2Ftypescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d&source=-----4b2a8cf1988d---------------------post_regwall------------------)\n\n[](https://medium.com/@hjparmar1944?source=post_page---post_author_info--4b2a8cf1988d---------------------------------------)\n\n[](https://medium.com/@hjparmar1944?source=post_page---post_author_info--4b2a8cf1988d---------------------------------------)\n\nFollow\n\n[**Written by Bytecraft**](https://medium.com/@hjparmar1944?source=post_page---post_author_info--4b2a8cf1988d---------------------------------------)\n\n[57 followers](https://medium.com/@hjparmar1944/followers?source=post_page---post_author_info--4b2a8cf1988d---------------------------------------)\n\n· [233 following](https://medium.com/@hjparmar1944/following?source=post_page---post_author_info--4b2a8cf1988d---------------------------------------)\n\nI write about Python, DuckDB, FastAPI, TypeScript & n8n. Deep dives into performance, local analytics, and tiny tools that save hours.\n\nFollow\n\n## No responses yet\n\n\n\nWrite a response\n\n[What are your thoughts?](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40hjparmar1944%2Ftypescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d&source=---post_responses--4b2a8cf1988d---------------------respond_sidebar------------------)\n\nCancel\n\nRespond\n\n## More from Bytecraft\n\n\n\n[](https://medium.com/@hjparmar1944?source=post_page---author_recirc--4b2a8cf1988d----0---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n[Bytecraft](https://medium.com/@hjparmar1944?source=post_page---author_recirc--4b2a8cf1988d----0---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n[**Tool Permissions for Agents: The Missing Security Layer**\\\\\n\\\\\n**How to stop your agent from becoming a “confused deputy” by putting least-privilege, scoped approvals, and auditability between the model…**](https://medium.com/@hjparmar1944/tool-permissions-for-agents-the-missing-security-layer-04fe98332c50?source=post_page---author_recirc--4b2a8cf1988d----0---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\nFeb 18\n\n[A clap icon23](https://medium.com/@hjparmar1944/tool-permissions-for-agents-the-missing-security-layer-04fe98332c50?source=post_page---author_recirc--4b2a8cf1988d----0---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n\n\n[](https://medium.com/@hjparmar1944?source=post_page---author_recirc--4b2a8cf1988d----1---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n[Bytecraft](https://medium.com/@hjparmar1944?source=post_page---author_recirc--4b2a8cf1988d----1---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n[**TypeScript-Friendly Pandas via Pyodide: DataFrames in the Browser for Real Apps**\\\\\n\\\\\n**How to bring “real” pandas into your frontend without turning your codebase into a Python science fair.**](https://medium.com/@hjparmar1944/typescript-friendly-pandas-via-pyodide-dataframes-in-the-browser-for-real-apps-cd17e7f03c7a?source=post_page---author_recirc--4b2a8cf1988d----1---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\nDec 1, 2025\n\n[A clap icon16](https://medium.com/@hjparmar1944/typescript-friendly-pandas-via-pyodide-dataframes-in-the-browser-for-real-apps-cd17e7f03c7a?source=post_page---author_recirc--4b2a8cf1988d----1---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n\n\n[](https://medium.com/@hjparmar1944?source=post_page---author_recirc--4b2a8cf1988d----2---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n[Bytecraft](https://medium.com/@hjparmar1944?source=post_page---author_recirc--4b2a8cf1988d----2---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n[**Lock-Free Bounded Queue, Made Understandable**\\\\\n\\\\\n**Build an MPMC queue that’s fast, bounded, and provably linearizable — plus a clean reference implementation you can adapt.**](https://medium.com/@hjparmar1944/lock-free-bounded-queue-made-understandable-3c4a2b7dc78c?source=post_page---author_recirc--4b2a8cf1988d----2---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\nNov 16, 2025\n\n\n\n[](https://medium.com/@hjparmar1944?source=post_page---author_recirc--4b2a8cf1988d----3---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n[Bytecraft](https://medium.com/@hjparmar1944?source=post_page---author_recirc--4b2a8cf1988d----3---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n[**FastAPI Multi-Tenant SaaS: Row-Level Security Without Pain**\\\\\n\\\\\n**How to keep tenant data isolated, even when a developer forgets a .filter() in one sleepy PR.**](https://medium.com/@hjparmar1944/fastapi-multi-tenant-saas-row-level-security-without-pain-9ef960085bf4?source=post_page---author_recirc--4b2a8cf1988d----3---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\nNov 25, 2025\n\n[A clap icon1](https://medium.com/@hjparmar1944/fastapi-multi-tenant-saas-row-level-security-without-pain-9ef960085bf4?source=post_page---author_recirc--4b2a8cf1988d----3---------------------68c1e793_44bc_42cb_be1f_251e85c699f5--------------)\n\n[See all from Bytecraft](https://medium.com/@hjparmar1944?source=post_page---author_recirc--4b2a8cf1988d---------------------------------------)\n\n## Recommended from Medium\n\n\n\n[](https://medium.com/@girff?source=post_page---read_next_recirc--4b2a8cf1988d----0---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[Girff](https://medium.com/@girff?source=post_page---read_next_recirc--4b2a8cf1988d----0---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[**ClickHouse Tutorial for Absolute Beginners: From Installation to First Query**\\\\\n\\\\\n**Welcome to this beginner-friendly guide on ClickHouse! If you’re new to databases and want to dive into high-performance analytics…**](https://medium.com/@girff/clickhouse-tutorial-for-absolute-beginners-from-installation-to-first-query-72151630a44c?source=post_page---read_next_recirc--4b2a8cf1988d----0---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\nNov 3, 2025\n\n\n\n[](https://medium.com/javascript-in-plain-english?source=post_page---read_next_recirc--4b2a8cf1988d----1---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\nIn\n\n[JavaScript in Plain English](https://medium.com/javascript-in-plain-english?source=post_page---read_next_recirc--4b2a8cf1988d----1---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\nby\n\n[Tanzim Hossain](https://medium.com/@0xTanzim?source=post_page---read_next_recirc--4b2a8cf1988d----1---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[**TypeScript Decorators: Legacy vs. New in Everyday Use**\\\\\n\\\\\n**Decorators let you attach extra behavior to classes or methods with a simple @name tag. They're great for logging calls, validating inputs…**](https://medium.com/javascript-in-plain-english/typescript-decorators-legacy-vs-new-in-everyday-use-b08175c7a4a6?source=post_page---read_next_recirc--4b2a8cf1988d----1---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\nOct 2, 2025\n\n[A clap icon4](https://medium.com/javascript-in-plain-english/typescript-decorators-legacy-vs-new-in-everyday-use-b08175c7a4a6?source=post_page---read_next_recirc--4b2a8cf1988d----1---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n\n\n[](https://medium.com/@srachel27?source=post_page---read_next_recirc--4b2a8cf1988d----0---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[Sandy Zhang](https://medium.com/@srachel27?source=post_page---read_next_recirc--4b2a8cf1988d----0---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[**Building a Scalable Next.js Frontend: Why I Chose shadcn/ui, Zustand, and Zod**\\\\\n\\\\\n**In my previous post, I talked about structuring a Next.js app using a layered approach: Domains + Features + Core.**](https://medium.com/@srachel27/building-a-scalable-next-js-frontend-why-i-chose-shadcn-ui-zustand-and-zod-c8ebfecb6b49?source=post_page---read_next_recirc--4b2a8cf1988d----0---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\nMar 19\n\n[A clap icon3](https://medium.com/@srachel27/building-a-scalable-next-js-frontend-why-i-chose-shadcn-ui-zustand-and-zod-c8ebfecb6b49?source=post_page---read_next_recirc--4b2a8cf1988d----0---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n\n\n[](https://medium.com/@codabu?source=post_page---read_next_recirc--4b2a8cf1988d----1---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[Pavol Repisky](https://medium.com/@codabu?source=post_page---read_next_recirc--4b2a8cf1988d----1---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[**Drizzle vs Prisma: Choosing the Right TypeScript ORM in 2026 (Deep Dive)**\\\\\n\\\\\n**If you’re building a TypeScript application, choosing the right ORM can make your life much easier. Two of the leading options today are…**](https://medium.com/@codabu/drizzle-vs-prisma-choosing-the-right-typescript-orm-in-2026-deep-dive-63abb6aa882b?source=post_page---read_next_recirc--4b2a8cf1988d----1---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\nNov 18, 2025\n\n[A clap icon6\\\\\n\\\\\nA response icon1](https://medium.com/@codabu/drizzle-vs-prisma-choosing-the-right-typescript-orm-in-2026-deep-dive-63abb6aa882b?source=post_page---read_next_recirc--4b2a8cf1988d----1---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n\n\n[](https://medium.com/@sathathinesh?source=post_page---read_next_recirc--4b2a8cf1988d----2---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[Thinesh Sathaharan](https://medium.com/@sathathinesh?source=post_page---read_next_recirc--4b2a8cf1988d----2---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[**🚀 Mastering Error Handling & Validation in NestJS: DTOs, Pipes, Filters, Interceptors & Best…**\\\\\n\\\\\n**If you’ve ever built a backend API, you know one thing: bad data is inevitable. Users forget required fields, send invalid emails, or even…**](https://medium.com/@sathathinesh/mastering-error-handling-validation-in-nestjs-dtos-pipes-filters-interceptors-best-d8ff9302fbc4?source=post_page---read_next_recirc--4b2a8cf1988d----2---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\nOct 4, 2025\n\n[A clap icon1](https://medium.com/@sathathinesh/mastering-error-handling-validation-in-nestjs-dtos-pipes-filters-interceptors-best-d8ff9302fbc4?source=post_page---read_next_recirc--4b2a8cf1988d----2---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n\n\n[](https://medium.com/@gargdev010300?source=post_page---read_next_recirc--4b2a8cf1988d----3---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[Dev Garg](https://medium.com/@gargdev010300?source=post_page---read_next_recirc--4b2a8cf1988d----3---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[**How I Configured Prisma 7 (New Changes, Issues, and How I Solved Them)**\\\\\n\\\\\n**Prisma 7 is a very recent release (Nov 19, 2025), and when I tried setting it up for the first time, I couldn’t find a single blog or…**](https://medium.com/@gargdev010300/how-i-configured-prisma-7-new-changes-issues-and-how-i-solved-them-d5ca728c5b9f?source=post_page---read_next_recirc--4b2a8cf1988d----3---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\nNov 27, 2025\n\n[A clap icon54\\\\\n\\\\\nA response icon6](https://medium.com/@gargdev010300/how-i-configured-prisma-7-new-changes-issues-and-how-i-solved-them-d5ca728c5b9f?source=post_page---read_next_recirc--4b2a8cf1988d----3---------------------6944061b_805b_4c5a_addc_6a92bf9e3ef6--------------)\n\n[See more recommendations](https://medium.com/?source=post_page---read_next_recirc--4b2a8cf1988d---------------------------------------)\n\n[Help](https://help.medium.com/hc/en-us?source=post_page-----4b2a8cf1988d---------------------------------------)\n\n[Status](https://status.medium.com/?source=post_page-----4b2a8cf1988d---------------------------------------)\n\n[About](https://medium.com/about?autoplay=1&source=post_page-----4b2a8cf1988d---------------------------------------)\n\n[Careers](https://medium.com/jobs-at-medium/work-at-medium-959d1a85284e?source=post_page-----4b2a8cf1988d---------------------------------------)\n\n[Press](mailto:pressinquiries@medium.com)\n\n[Blog](https://blog.medium.com/?source=post_page-----4b2a8cf1988d---------------------------------------)\n\n[Privacy](https://policy.medium.com/medium-privacy-policy-f03bf92035c9?source=post_page-----4b2a8cf1988d---------------------------------------)\n\n[Rules](https://policy.medium.com/medium-rules-30e5502c4eb4?source=post_page-----4b2a8cf1988d---------------------------------------)\n\n[Terms](https://policy.medium.com/medium-terms-of-service-9db0094a1e0f?source=post_page-----4b2a8cf1988d---------------------------------------)\n\n[Text to speech](https://speechify.com/medium?source=post_page-----4b2a8cf1988d---------------------------------------)\n\nreCAPTCHA\n\nRecaptcha requires verification.\n\n[Privacy](https://www.google.com/intl/en/policies/privacy/) \\- [Terms](https://www.google.com/intl/en/policies/terms/)\n\nprotected by **reCAPTCHA**\n\n[Privacy](https://www.google.com/intl/en/policies/privacy/) \\- [Terms](https://www.google.com/intl/en/policies/terms/)","metadata":{"twitter:app:name:iphone":"Medium","al:android:package":"com.medium.reader","ogSiteName":"Medium","author":"Bytecraft","twitter:title":"TypeScript Schema Migrations: Safe Evolution with Zod + OpenAPI Diff","twitter:site":"@Medium","al:android:url":"medium://p/4b2a8cf1988d","article:published_time":"2025-11-30T16:32:36.014Z","twitter:description":"How to ship fast, change schemas often, and still sleep at night.","twitter:app:id:iphone":"828256236","title":"TypeScript Schema Migrations: Safe Evolution with Zod + OpenAPI Diff | by Bytecraft | Medium","al:ios:app_store_id":"828256236","referrer":"unsafe-url","twitter:label1":"Reading time","publishedTime":"2025-11-30T16:32:36.014Z","al:android:app_name":"Medium","og:url":"https://medium.com/@hjparmar1944/typescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d","twitter:image:src":"https://miro.medium.com/v2/resize:fit:1200/1*OWnN2reHdI-0Z9Buv4rhJQ.png","viewport":"width=device-width,minimum-scale=1,initial-scale=1,maximum-scale=1","al:web:url":"https://medium.com/@hjparmar1944/typescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d","og:image":"https://miro.medium.com/v2/resize:fit:1200/1*OWnN2reHdI-0Z9Buv4rhJQ.png","twitter:card":"summary_large_image","apple-itunes-app":"app-id=828256236, app-argument=/@hjparmar1944/typescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d, affiliate-data=pt=698524&ct=smart_app_banner&mt=8","og:description":"How to ship fast, change schemas often, and still sleep at night.","theme-color":"#000000","twitter:app:url:iphone":"medium://p/4b2a8cf1988d","al:ios:app_name":"Medium","robots":"index,noarchive,follow,max-image-preview:large","ogTitle":"TypeScript Schema Migrations: Safe Evolution with Zod + OpenAPI Diff","og:type":"article","ogUrl":"https://medium.com/@hjparmar1944/typescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d","twitter:data1":"5 min read","fb:app_id":"542599432471018","ogDescription":"How to ship fast, change schemas often, and still sleep at night.","ogImage":"https://miro.medium.com/v2/resize:fit:1200/1*OWnN2reHdI-0Z9Buv4rhJQ.png","article:author":"https://medium.com/@hjparmar1944","language":"en","og:site_name":"Medium","og:title":"TypeScript Schema Migrations: Safe Evolution with Zod + OpenAPI Diff","description":"TypeScript Schema Migrations: Safe Evolution with Zod + OpenAPI Diff How to ship fast, change schemas often, and still sleep at night. Learn how to evolve TypeScript APIs safely using Zod as your …","al:ios:url":"medium://p/4b2a8cf1988d","favicon":"https://miro.medium.com/v2/5d8de952517e8160e40ef9841c781cdc14a5db313057fa3c3de41c6f5b494b19","scrapeId":"019d3953-7d91-744c-89c6-2cce9721f8cf","sourceURL":"https://medium.com/@hjparmar1944/typescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d","url":"https://medium.com/@hjparmar1944/typescript-schema-migrations-safe-evolution-with-zod-openapi-diff-4b2a8cf1988d","statusCode":200,"contentType":"text/html; charset=utf-8","timezone":"America/New_York","proxyUsed":"basic","cacheState":"miss","indexId":"75a8e578-21af-46a6-a843-565af5e30b0c","creditsUsed":1}},{"url":"https://dev.to/dzakh/javascript-schema-library-from-the-future-5420","title":"JavaScript schema library from the Future - DEV Community","description":"It's ~100 times faster than Zod and on par with Typia or Arktype (benchmark). But often, besides validation, you want to transform data incoming ...","position":3,"markdown":"[ReScript Schema](https://github.com/DZakh/rescript-schema) \\- The fastest parser in the entire JavaScript ecosystem with a focus on small bundle size and top-notch DX.\n\nWhy did you not hear about it then, and why should you learn about it now? I started developing the library three years ago, and today, it's at a point others have yet to achieve. I'll prove it in the article, but before we start, I'd like to answer a few questions you might already have.\n\n### What's a parser?\n\nOne of the most basic applications of ReScript Schema is parsing - Accepting unknown JavaScript data, validating it, and returning the result of your desired type. There are dozens of such libraries, and the most popular ones are [Zod](https://github.com/colinhacks/zod), [Valibot](https://github.com/fabian-hiller/valibot), [Runtypes](https://github.com/runtypes/runtypes), [Arktype](https://github.com/arktypeio/arktype), [Typia](https://github.com/samchon/typia), [Superstruct](https://github.com/ianstormtaylor/superstruct), [Effect Schema](https://github.com/Effect-TS/schema), and more. Also, even though this is slightly different, validation libraries like [Ajv](https://github.com/ajv-validator/ajv), [Yup](https://github.com/jquense/yup), and others also stand really close.\n\n### Is ReScript Schema faster than all of them?\n\nYes. It's ~100 times faster than [Zod](https://github.com/colinhacks/zod) and on par with [Typia](https://github.com/samchon/typia) or [Arktype](https://github.com/arktypeio/arktype) ( [benchmark](https://moltar.github.io/typescript-runtime-type-benchmarks/)). But often, besides validation, you want to transform data incoming to your system, and here, ReScript Schema overperforms any solution existing in the JavaScript ecosystem.\n\n### What's ReScript? Isn't the library for JavaScript/TypeScript?\n\n[ReScript](https://rescript-lang.org/) is a robustly typed language that compiles to efficient and human-readable JavaScript. And yes, ReScript Schema is written in ReScript, but it also has a really nice JavaScript API with TS types. You don't need to install or run any compiler; `npm i rescript-schema` is all you need.\n\nIt makes ReScript Schema support 3 languages - JavaScript, TypeScript, and ReScript. This is especially nice when you mix TypeScript and ReScript in a single codebase 👌\n\n### Are there trade-offs?\n\nYes. To maximize DX, performance, and bundle size while keeping the library fully runtime, I've decided to use [eval](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval) under the hood. You needn't worry about the code's dangerous execution, but some environments, like Cloudflare Workers, won't work. In 99% of cases, you don't need to be concerned about this. I just think it's my duty as a creator to let you know about the 1% beforehand.\n\n### What's the plan?\n\nI'm going to provide an overview of the basic ReScript Schema API and mental model. Then, we'll discuss what makes it stand out from millions of similar libraries (and this is not only performance). I'll also look at some more advanced use cases and discuss the ecosystem, performance, and where it stands with other libraries.\n\nI hope you'll enjoy it. 😊\n\n> Follow me on [X](https://x.com/dzakh_dev) to learn more about programming stuff I'm cooking.\n\n## Parsing / Validating\n\nLet's start with the most basic use case of ReScript Schema. By the way, if you don't know the difference between parsing (sometimes called decoding) and validating, here's a [good article](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/) from Zod's docs. If you're curious about when and why you need to parse data in your application, let me know in the comments. I can write a big article about it, but for now, I assume you are already familiar with the concept.\n\nLet's finally take a look at the code. I'll go with the TypeScript example first, so it's more familiar for most readers. Everything starts with defining a schema of the data you expect:\n\n```\nimport * as S from \"rescript-schema\";\n\nconst filmSchema = S.schema({\n id: S.number,\n title: S.string,\n tags: S.array(S.string),\n rating: S.union([\"G\", \"PG\", \"PG13\", \"R\"])\n})\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nThe schema here is like a type definition that exists in runtime. If you hover over the `filmSchema`, you'll see the following type:\n\n```\nS.Schema<{\n id: number;\n title: string;\n tags: string[];\n rating: \"G\" | \"PG\" | \"PG13\" | \"R\";\n}>\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nThis is a `Schema` type that inferred the film object definition. I recommend extracting its value into its own type. This way, you'll have the schema as the source of truth and the `Film` type always matching the schema:\n\n```\ntype Film = S.Output<typeof filmSchema>\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nAfter we've defined our `Film` type using the schema, we can parse unknown data entering our application to guarantee that it matches what we expect:\n\n```\nS.parseOrThrow(\n {\n id: 1,\n title: \"My first film\",\n tags: [\"Loved\"],\n rating: \"S\",\n },\n filmSchema,\n);\n//? Throws RescriptSchemaError with message `Failed parsing at [\"rating\"]. Reason: Expected \"G\" | \"PG\" | \"PG13\" | \"R\", received \"S\"`\n\nS.parseOrThrow(validDataWithUnknownType, filmSchema)\n//? Returns value of the Film type\n\n// If you don't want to throw, you can wrap the operations in S.safe and get S.Result as a return value\nS.safe(() => S.parseOrThrow(data, filmSchema))\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nDone! We have valid data here 🙌\n\nSome experienced users may have noticed that the API is similar to [Valibot](https://github.com/fabian-hiller/valibot), but with a unique flavor.\n\nYou can use `S.schema` for objects, tuples, and literals. For any kind of union, there's `S.union`; even if it's a [discriminated](https://github.com/DZakh/rescript-schema/blob/main/docs/js-usage.md#discriminated-unions) one, the parser will perform in the most optimized way. I personally have seen this kind of DX only in [ArkType](https://arktype.io/) so far.\n\nAlso, there are no annoying parentheses; the parse function explicitly says it can throw, and thanks to the modular design, the library tree-shaking is very good.\n\n### Package size\n\nSince I mentioned tree-shaking, I'd like to quickly note about the package size. The bundle size is an essential metric for a web application, and I'd like to share how ReScript Schema is doing here in comparison with other libraries:\n\n| | [rescript-schema@9.2.2](mailto:rescript-schema@9.2.2) | [Zod@3.24.1](mailto:Zod@3.24.1) | [Valibot@1.0.0-beta.14](mailto:Valibot@1.0.0-beta.14) | [ArkType@2.0.4](mailto:ArkType@2.0.4) |\n| --- | --- | --- | --- | --- |\n| **Total size** (minified + gzipped) | 12.7 kB | 15.2 kB | 12.3 kB | 40.8 kB |\n| **Example size** (minified + gzipped) | 5.14 kB | 14.5 kB | 1.39 kB | 40.7 kB |\n| **Playground** | [Link](https://bundlejs.com/?q=rescript-schema%409.2.2&treeshake=%5B*%5D&text=%22const+filmSchema+%3D+S.schema%28%7B%5Cn++id%3A+S.number%2C%5Cn++title%3A+S.string%2C%5Cn++tags%3A+S.array%28S.string%29%2C%5Cn++rating%3A+S.union%28%5B%5C%22G%5C%22%2C+%5C%22PG%5C%22%2C+%5C%22PG13%5C%22%2C+%5C%22R%5C%22%5D%29%2C%5Cn%7D%29%3B%5Cn%5CnS.parseOrThrow%28null%2C+filmSchema%29%22) | [Link](https://bundlejs.com/?q=zod%403.24.1&treeshake=%5B*%5D&text=%22const+filmSchema+%3D+z.object%28%7B%5Cn++id%3A+z.number%28%29%2C%5Cn++title%3A+z.string%28%29%2C%5Cn++tags%3A+z.array%28z.string%28%29%29%2C%5Cn++rating%3A+z.enum%28%5B%5C%22G%5C%22%2C+%5C%22PG%5C%22%2C+%5C%22PG13%5C%22%2C+%5C%22R%5C%22%5D%29%2C%5Cn%7D%29%3B%5Cn%5CnfilmSchema.parse%28null%29%22) | [Link](https://bundlejs.com/?q=valibot%401.0.0-beta.14&treeshake=%5B*%5D&text=%22const+filmSchema+%3D+v.object%28%7B%5Cn++id%3A+v.number%28%29%2C%5Cn++title%3A+v.string%28%29%2C%5Cn++tags%3A+v.array%28z.string%28%29%29%2C%5Cn++rating%3A+v.picklist%28%5B%5C%22G%5C%22%2C+%5C%22PG%5C%22%2C+%5C%22PG13%5C%22%2C+%5C%22R%5C%22%5D%29%2C%5Cn%7D%29%3B%5Cn%5Cnv.parse%28filmSchema%2C+null%29%22) | [Link](https://bundlejs.com/?q=arktype%402.0.4&treeshake=%5B*%5D&text=%22const+filmSchema+%3D+type%28%7B%5Cn++id%3A+%5C%22number%5C%22%2C%5Cn++title%3A+%5C%22string%5C%22%2C%5Cn++tags%3A+%5C%22string%5B%5D%5C%22%2C%5Cn++rating%3A+%60%5C%22G%5C%22+%7C+%5C%22PG%5C%22+%7C+%5C%22PG13%5C%22+%7C+%5C%22R%5C%22%60%2C%5Cn%7D%29%3B%5Cn%5CnfilmSchema%28null%29%22) |\n\nIt's not as amazing as Valibot, but ReScript Schema is definitely doing good here. If we compare ReScript Schema to libraries that have similar performance, they all use the code generation approach (besides ArkType). This means it'll start small, but for every new type, more and more code will be added to your bundle, rapidly increasing the application size.\n\n### Parsing using ReScript\n\nEven though I want to make ReScript Schema popular for TS developers, ReScript is still the library's main user base, so I'll also include examples of it.\n\nCompared to TypeScript, the type system in ReScript is much simpler; you literally can't do any type gymnastics in it. Together with [nominal typing](https://medium.com/@thejameskyle/type-systems-structural-vs-nominal-typing-explained-56511dd969f4), it's getting impossible to extract the `film` type from the schema (even though it can infer it). But there's a built-in way to prevent boilerplate code in ReScript. You can use ReScript Schema PPX to generate schemas for your types automatically. Just annotate them with `@schema` attribute.\n\n```\n@schema\ntype rating =\n | @as(\"G\") GeneralAudiences\n | @as(\"PG\") ParentalGuidanceSuggested\n | @as(\"PG13\") ParentalStronglyCautioned\n | @as(\"R\") Restricted\n@schema\ntype film = {\n id: float,\n title: string,\n tags: array<string>,\n rating: rating,\n}\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nDoes the `rating` type look scary to you? Don't worry, this is a ReScript [Variant](https://rescript-lang.org/docs/manual/v11.0.0/variant), which is such a nice way to describe any kind of union. Also, you can use `@as` and give a better name to the ratings while preserving the original short values in runtime.\n\nAlthough PPX is nice, you can always code without it:\n\n```\ntype rating =\n | @as(\"G\") GeneralAudiences\n | @as(\"PG\") ParentalGuidanceSuggested\n | @as(\"PG13\") ParentalStronglyCautioned\n | @as(\"R\") Restricted\ntype film = {\n id: float,\n title: string,\n tags: array<string>,\n rating: rating,\n}\n\nlet filmSchema = S.schema(s => {\n id: s.matches(S.number),\n title: s.matches(S.string),\n tags: s.matches(S.array(S.string)),\n rating: s.matches(S.union([\\\n GeneralAudiences,\\\n ParentalGuidanceSuggested,\\\n ParentalStronglyCautioned,\\\n Restricted\\\n ]))\n})\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nThe TS API admittedly wins here since we don't need to call `s.matches` to make type system happy, but when it comes to parsing ReScript takes it back with the [Pipe Operator](https://rescript-lang.org/docs/manual/v11.0.0/pipe) and [Pattern Matching on exceptions](https://rescript-lang.org/docs/manual/v11.0.0/pattern-matching-destructuring#match-on-exceptions):\n\n```\n{\n \"id\": 1,\n \"title\": \"My first film\",\n \"tags\": [\"Loved\"],\n \"rating\": \"S\",\n}->S.parseOrThrow(filmSchema)\n//? Throws RescriptSchemaError with message `Failed parsing at [\"rating\"]. Reason: Expected \"G\" | \"PG\" | \"PG13\" | \"R\", received \"S\"`\n\nvalidDataWithUnknownType->S.parseOrThrow(filmSchema)\n//? Returns value of the film type\n\n// If you don't want to throw, you can match on the S.Raised exception and return the result type. There's no S.safe API like in TypeScript, since you can do better with the language itself!\nswitch data->S.parseOrThrow(filmSchema) {\n| film => Ok(film)\n| exception S.Raised(error) => Error(error)\n}\n```\n\nEnter fullscreen modeExit fullscreen mode\n\n## Unique Features\n\nAfter we covered the most basic use case, let's move on to the things that make ReScript Schema special 🔥\n\n### Changing shape and field names\n\nLet's imagine working with a weird REST API with poorly named fields in PascalCase, where data is randomly nested in objects or tuples. But we can't change the backend, so at least we want to transform data to a more convenient format for our application. In ReScript Schema you can make it in a declarative way, which will result in the most possibly performant operation:\n\n```\nconst filmSchema = S.object((s) => ({\n id: s.field(\"Id\", S.number),\n title: s.nested(\"Meta\").field(\"Title\", S.string),\n tags: s.field(\"Tags_v2\", S.array(S.string)),\n rating: s.field(\"Rating\", S.schema([S.union([\"G\", \"PG\", \"PG13\", \"R\"])]))[0],\n}));\n\nS.parseOrThrow(\n {\n Id: 1,\n Meta: {\n Title: \"My first film\",\n },\n Tags_v2: [\"Loved\"],\n Rating: [\"G\"],\n },\n filmSchema\n);\n//? { id: 1, title: \"My first film\", tags: [\"Loved\"], rating: \"G\" }\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nLooks scary? Let's dive in. First of all, every schema has `Input` and `Output`. Quite often, they are equal, and during parsing, the library only validates that `Input` has the correct type and returns it immediately. Although there are ways to change the expected `Output` type like we do in the example above. For comparison, let's take a look at how you'd usually achieve the same with other schema libraries:\n\n```\nconst filmSchema = S.transform(\n S.schema({\n Id: S.number,\n Meta: {\n Title: S.string,\n },\n Tags_v2: S.array(S.string),\n Rating: S.schema([S.union([\"G\", \"PG\", \"PG13\", \"R\"])]),\n }),\n (input) => ({\n id: input.Id,\n title: input.Meta.Title,\n tags: input.Tags_v2,\n rating: input.Rating[0],\n })\n);\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nThis is still ReScript Schema, but we use `S.transform` to manually transform the `Input` type. You can find this kind of API in many other schema libraries. What's good about the example is that you can clearly see that we use our schema to declaratively describe what the data incoming to our system looks like, and then we transform it to what's convenient for us to work with. In a way, the schema here is similar to a contract between the client and the server that returns the object in response.\n\nIn the advanced `S.object` example, which I showed first, we combine a declarative description of the `Input` type with a transformation to the `Output` type. And this enables one more thing besides shorter code and a performance boost.\n\n### Reverse Parsing (aka serializing/decoding)\n\nDecoding is present in many libraries from other languages, but it's not very common in the JS ecosystem. This is a big loss because the ability to perform operations in the reverse direction is the most powerful feature I personally find.\n\nIf it's unclear what I mean, in other popular JavaScript schema libraries, you can only parse `Input` to `Output` types. While in ReScript Schema you can easily parse `Output` to `Input` using the same schema. Or only perform the conversion logic since the `Output` type usually doesn't require validation.\n\nDo you remember our `filmSchema` using `S.object` to rename fields? Let's say we want to send a POST request with the film entity, and the server also expects the weirdly cased data structure it initially sent to us. Here is how we deal with it:\n\n```\n// The same schema from above\nconst filmSchema = S.object((s) => ({\n id: s.field(\"Id\", S.number),\n title: s.nested(\"Meta\").field(\"Title\", S.string),\n tags: s.field(\"Tags_v2\", S.array(S.string)),\n rating: s.field(\"Rating\", S.schema([S.union([\"G\", \"PG\", \"PG13\", \"R\"])]))[0],\n}));\n\nS.reverseConvertOrThrow({ id: 1, title: \"My first film\", tags: [\"Loved\"], rating: \"G\" }, filmSchema)\n//? { Id: 1, Meta: { Title: \"My first film\" }, Tags_v2: [\"Loved\"], Rating: [\"G\"] }\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nSweet! Isn't it? And even though I want to talk more about performance a little bit later, I can't stop myself from sharing the code it evaluates under the hood:\n\n```\n(i) => {\n let v0 = i[\"tags\"];\n return {\n Id: i[\"id\"],\n Meta: { Title: i[\"title\"] },\n Tags_v2: v0,\n Rating: [i[\"rating\"]],\n };\n};\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nI think most people would write slower code by hand 😅\n\n### Reverse\n\nThe `S.reverseConvertOrThrow` is one of the reverse cases I use daily in my work, but this is actually just a shorthand of `S.convertOrThrow` and `S.reverse` you can use separately.\n\n`S.reverse` \\- this is what allows you to take your `Schema<Input, Output>` and turn it into `Schema<Output, Input>`.\n\nIt may sound quite dull, but compared to the commonly used parser/serializer or encoder/decoder approach, here you get an actual schema you can use the same way as the original one without any limitations.\n\nIf you want, you can parse output with/without data validation, generate JSON Schema, perform optimized comparison and hashing, or use the data representation in runtime for any custom logic.\n\nAs a fruit of the ability to know `Input` and `Output` data types in runtime, ReScript Schema has a very powerful coercion API.\n\n```\nconst schema = S.coerce(S.string, S.bigint)\nS.parseOrThrow(\"123\", schema) //? 123n\nS.reverseConvertOrThrow(123n, schema) //? \"123\"\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nPass any schemas to `S.coerce` that you want to coerce from and to, and ReScript Schema will figure out the rest.\n\nAnd this has not been implemented yet, but with the API, it'll also be possible to achieve 2x faster JSON.stringify(). Like [fast-json-stringify](https://github.com/fastify/fast-json-stringify) does and maybe even faster 😎\n\n### 100 Operations\n\nIf you want the best possible performance or the built-in operations don't cover your specific use case, you can use `S.compile` to create fine-tuned operation functions.\n\n```\nconst operation = S.compile(S.string, \"Any\", \"Assert\", \"Async\");\n//? (input: unknown) => Promise<void>\n\nawait operation(\"Hello world!\");\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nIn the example above, we've created an async assert operation, which is not available by default.\n\nWith the API, you can get 100 different operation combinations, each of which might make sense for your specific use case. This is like [parser](https://valibot.dev/api/parser/) in Valibot, but multiplied by 💯.\n\n### Performance Comparison\n\nAs I mentioned in the beginning, ReScript Schema is the fastest. Now I'll explain why 🔥\n\nAlso, you can use the big community [benchmark](https://moltar.github.io/typescript-runtime-type-benchmarks/) to confirm yourself. If you see [Typia](https://typia.io/) overperforming ReScript Schema, I have a take on it too 😁\n\nFirst of all, the biggest advantage of ReScript Schema is its very clever library core, which builds the most possibly optimized operations using `eval`. I have already shown before how the operation code looks for reverse conversion; here's the `filmSchema` parse operation code:\n\n```\n(i) => {\n if (typeof i !== \"object\" || !i) {\n e[7](i);\n }\n let v0 = i[\"Id\"],\n v1 = i[\"Meta\"],\n v3 = i[\"Tags_v2\"],\n v7 = i[\"Rating\"];\n if (typeof v0 !== \"number\" || Number.isNaN(v0)) {\n e[0](v0);\n }\n if (typeof v1 !== \"object\" || !v1) {\n e[1](v1);\n }\n let v2 = v1[\"Title\"];\n if (typeof v2 !== \"string\") {\n e[2](v2);\n }\n if (!Array.isArray(v3)) {\n e[3](v3);\n }\n for (let v4 = 0; v4 < v3.length; ++v4) {\n let v6 = v3[v4];\n try {\n if (typeof v6 !== \"string\") {\n e[4](v6);\n }\n } catch (v5) {\n if (v5 && v5.s === s) {\n v5.path = '[\"Tags_v2\"]' + '[\"' + v4 + '\"]' + v5.path;\n }\n throw v5;\n }\n }\n if (!Array.isArray(v7) || v7.length !== 1) {\n e[5](v7);\n }\n let v8 = v7[\"0\"];\n if (v8 !== \"G\") {\n if (v8 !== \"PG\") {\n if (v8 !== \"PG13\") {\n if (v8 !== \"R\") {\n e[6](v8);\n }\n }\n }\n }\n return { id: v0, title: v2, tags: v3, rating: v8 };\n};\n```\n\nEnter fullscreen modeExit fullscreen mode\n\nThanks to `eval`, we can eliminate function calls and inline all type validations using `if` statements. Also, knowing about the `Output` type at runtime allows us to perform transformations with zero wasteful object allocations, optimizing the operation for JavaScript engines.\n\nInterestingly, you probably think that calling `eval` itself is slow, and I thought this myself. However, it was actually not as slow as I expected. For example, creating a simple nested object schema and calling the parser once happened to be 1.8 times faster with ReScript Schema using eval than Zod. I really put a lot of effort into making it as fast as possible, and I have to thank the [ReScript language](https://rescript-lang.org/) and the people behind it for allowing me to write very performant and safe code.\n\nTalking about [ArkType](https://arktype.io/), they use the same approach with eval and have similar potential to ReScript Schema, but their evaluated code is not there yet. Currently, their operations are a little bit slower, and the schema creation is significantly slower. But I can see that it can somewhat catch up in the future.\n\nWhat other libraries will never be able to catch up on is the ability to reshape schema declaratively. And this is why I say that ReScript Schema is faster than Typia. Also, Typia doesn't always generate the most optimized code, e.g., for optional fields. And it doesn't come with many built-in operations specifically optimized for the desired use case. Still, this is an excellent library with Fast JSON Serialization and Protocol Buffer Encoding features, which I'm still yet to implement.\n\n### Ecosystem\n\nWhen choosing a schema library for your project, where performance is not a concern, the ecosystem is the most important factor to consider. With a schema, you can do millions of things by knowing the type of representation in runtime. Such as JSON Schema generation, describing database schemas, optimized comparison and hashing, encoding to proto buff, building forms, mocking data, communicating with AI, and much more.\n\nZod is definitely a winner here. I counted 78 libraries integrating with Zod at the moment of writing the article. There are even some where you provide a Zod schema, and it renders a Vue page with a form prompting for the data. This is just too convenient for not using it for prototyping.\n\nBut if you don't need something super specific, ReScript Schema has a decent ecosystem itself, which is comparable to Valibot and ArkType. Actually, it has an even higher potential thanks to the ability to adjust Shape and automatically Reverse the schema. A good example of this is [ReScript Rest](https://github.com/DZakh/rescript-rest), which combines the DX of [tRPC](https://trpc.io/) while staying unopinionated like [ts-rest](https://ts-rest.com/). I also built many powerful tools around ReScript Schema, but I have to admit that I haven't added TS support yet. Let me know if you find something interesting to use, and I'll do this asap 😁\n\nAlso, ReScript Schema supports [Standard Schema](https://standardschema.dev/), a common interface for TypeScript validation libraries. It was recently designed by the creators of Zod, Valibot, and ArkType and has already been integrated into many popular libraries. This means that you can use ReScript Schema with [tRPC](https://trpc.io/), [TanStack Form](https://tanstack.com/form), [TanStack Router](https://tanstack.com/router), [Hono](https://hono.dev/), and 19+ more at the time of writing the article.\n\n### Conclusion\n\nAs the title says, I wholeheartedly believe that ReScript Schema is the future of schema libraries. It offers both DX, performance, bundle size, and many innovative features. I tried to cover all of them at a high level, and I hope I managed to make you at least a little bit interested 👌\n\nI don't persuade you to choose ReScript Schema for your next project, and I actually still recommend Zod when somebody asks me. But I'll definitely appreciate a [star](https://github.com/DZakh/rescript-schema) and [X follow](https://x.com/dzakh_dev) 🙏\n\nLet's see how the future of schema libraries will turn out. Maybe I'll rename ReScript Schema to something dope and become more popular than Zod? Cheers 😁\n\n[\\\\\nMongoDB](https://dev.to/mongodb) Promoted\n\nDropdown menu\n\n- [What's a billboard?](https://dev.to/billboards)\n- [Manage preferences](https://dev.to/settings/customization#sponsors)\n\n* * *\n\n- [Report billboard](https://dev.to/report-abuse?billboard=241241)\n\n[](https://www.mongodb.com/cloud/atlas/lp/try3?utm_campaign=display_devto-broad_pl_flighted_atlas_tryatlaslp_prosp_gic-null_ww-all_dev_dv-all_eng_leadgen&utm_source=devto&utm_medium=display&utm_content=airevolution-v1&bb=241241)\n\n## [Gen AI apps are built with MongoDB Atlas](https://www.mongodb.com/cloud/atlas/lp/try3?utm_campaign=display_devto-broad_pl_flighted_atlas_tryatlaslp_prosp_gic-null_ww-all_dev_dv-all_eng_leadgen&utm_source=devto&utm_medium=display&utm_content=airevolution-v1&bb=241241)\n\nMongoDB Atlas is the developer-friendly database for building, scaling, and running gen AI & LLM apps—no separate vector DB needed. Enjoy native vector search, 115+ regions, and flexible document modeling. Build AI faster, all in one place.\n\n[Start Free](https://www.mongodb.com/cloud/atlas/lp/try3?utm_campaign=display_devto-broad_pl_flighted_atlas_tryatlaslp_prosp_gic-null_ww-all_dev_dv-all_eng_leadgen&utm_source=devto&utm_medium=display&utm_content=airevolution-v1&bb=241241)\n\nRead More\n\n\n\n\n[Create template](https://dev.to/settings/response-templates)\n\nTemplates let you quickly answer FAQs or store snippets for re-use.\n\nSubmitPreview [Dismiss](https://dev.to/404.html)\n\nCollapseExpand\n\n[](https://dev.to/1ce)\n\n[Sby](https://dev.to/1ce)\n\nSby\n\n\n\n[\\\\\nSby](https://dev.to/1ce)\n\nFollow\n\nI write good code.\nInterested in moving to another country.\n\n\n- Joined\n\n\nNov 3, 2024\n\n\n• [Feb 22 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m16g)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m16g)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/1ce/comment/2m16g)\n\nNice work! Definitely will consider it next time I need a parser or a validator.\n\nBy the way, since you're familiar with Typia, have you by any chance seen a recent post by Typia's author about its performance with the Bun runtime being 20 times slower?\n\nWould you perhaps have any comments on that? I'm also interested in how ReScript Schema performs with different runtimes (Node, Deno, Bun, browser)\n\nCollapseExpand\n\n[](https://dev.to/dzakh)\n\n[Dmitry Zakharov](https://dev.to/dzakh)\n\nDmitry Zakharov\n\n\n\n[\\\\\nDmitry Zakharov](https://dev.to/dzakh)\n\nFollow\n\nBuild fastest tools with best DX 🫡\n\n\n- Location\n\n\n\nGeorgia, Batumi\n\n\n- Work\n\n\n\nEnvio\n\n\n- Joined\n\n\nDec 11, 2022\n\n\n• [Feb 23 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m19p)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m19p)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/dzakh/comment/2m19p)\n\nInteresting, this is a new one. Just read it and left a like [dev.to/samchon/bun-is-up-to-20x-sl...](https://dev.to/samchon/bun-is-up-to-20x-slower-than-nodejs-in-logic-operations-305d)\n\nNode.js, Deno and Browser are fine; the only problem is with Bun, which you can see in the community benchmark [moltar.github.io/typescript-runtim...](https://moltar.github.io/typescript-runtime-type-benchmarks)\n\nI can see many comments in the article where people claim that it's a Typia specific problem, but Typia is a codegen library, and it doesn't do anything special in runtime. This means if you write a function like `(input) => \"string\" === typeof input` by hand and run it multiple times, it'll execute multiple times slower in Bun than in any other runtime.\n\nCollapseExpand\n\n[](https://dev.to/retakenroots)\n\n[Rene Kootstra](https://dev.to/retakenroots)\n\nRene Kootstra\n\n\n\n[\\\\\nRene Kootstra](https://dev.to/retakenroots)\n\nFollow\n\nAuthor of enge-js a pure JavaScript playstation 1 emulator and professional developer for 25+ years.\n\n\n- Joined\n\n\nFeb 12, 2022\n\n\n• [Feb 23 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m1a7)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m1a7)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/retakenroots/comment/2m1a7)\n\nHmm very interesting article. Though when i read eval it raised some concerns. Nonetheless good job.\n\nCollapseExpand\n\n[](https://dev.to/dzakh)\n\n[Dmitry Zakharov](https://dev.to/dzakh)\n\nDmitry Zakharov\n\n\n\n[\\\\\nDmitry Zakharov](https://dev.to/dzakh)\n\nFollow\n\nBuild fastest tools with best DX 🫡\n\n\n- Location\n\n\n\nGeorgia, Batumi\n\n\n- Work\n\n\n\nEnvio\n\n\n- Joined\n\n\nDec 11, 2022\n\n\n• [Feb 23 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m1ac)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m1ac)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/dzakh/comment/2m1ac)\n\nIt's indeed good to be aware of this because if you build for serverless or some widget that is embedded as a CDN to someone else website ( [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP)) there might be problems. But as I said, this is ~1% of use cases.\n\nAlso, ArkType uses eval, and according to [Colin](https://x.com/colinhacks)'s words, he plans to add Eval mode to Zod v4.\n\nIdeally, there should be a fallback mode to be able to work without Eval when it's not supported. I actually recently got an idea of how to implement it without reducing the quality of the library. But it'll probably take several months for me to implement.\n\nCollapseExpand\n\n[](https://dev.to/dhruvgarg79)\n\n[Dhruv garg](https://dev.to/dhruvgarg79)\n\nDhruv garg\n\n\n\n[\\\\\nDhruv garg](https://dev.to/dhruvgarg79)\n\nFollow\n\nWorking as a Tech Lead at a MarTech Startup.\nInterested in Databases, Performance, and everything Backend.\n\n\n- Location\n\n\n\nBengaluru, India\n\n\n- Education\n\n\n\nB. Tech in computer science\n\n\n- Work\n\n\n\nTech lead\n\n\n- Joined\n\n\nOct 1, 2019\n\n\n• [Feb 25 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m2lh)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m2lh)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/dhruvgarg79/comment/2m2lh)\n\nwhat about comparison with typebox? It's also much faster than zod.\n\nCollapseExpand\n\n[](https://dev.to/dzakh)\n\n[Dmitry Zakharov](https://dev.to/dzakh)\n\nDmitry Zakharov\n\n\n\n[\\\\\nDmitry Zakharov](https://dev.to/dzakh)\n\nFollow\n\nBuild fastest tools with best DX 🫡\n\n\n- Location\n\n\n\nGeorgia, Batumi\n\n\n- Work\n\n\n\nEnvio\n\n\n- Joined\n\n\nDec 11, 2022\n\n\n• [Feb 26 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m300)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m300)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/dzakh/comment/2m300)\n\nThis is actually very good, and it's very mature. I actually had a misunderstanding about it being a worse version of Typia, but after double-checking the docs, I was really impressed by it.\n\nIn the benchmark, you can indeed see that it's fast [moltar.github.io/typescript-runtim...](https://moltar.github.io/typescript-runtime-type-benchmarks/)\n\nBut there are some trade-offs that are solved in ReScript Schema:\n\n- Optimised check only supports validation, not parsing with data transformations\n- I find the DX of ReScript Schema to be more friendly for web developers. Also, reshaping and reversing are still unbeaten\n- The TypeBox packages size is huge, making it not the best fit for web development [github.com/sinclairzx81/typebox?ta...](https://github.com/sinclairzx81/typebox?tab=readme-ov-file#compression)\n\nSo, at the moment of writing the article I think ReScript Schema is a better library if you use it for Web, but for server-side TypeBox is more mature and provides more flexibility and features. Although there are still some features of ReScript Schema you might want to use, which are not a part of TypeBox 😉\n\nReScript Schema v10 is coming, which will improve the flexibility similar to TypeBox while boosting DX even more, exceeding Zod and ArkType levels 😁\n\nCollapseExpand\n\n[](https://dev.to/dzakh)\n\n[Dmitry Zakharov](https://dev.to/dzakh)\n\nDmitry Zakharov\n\n\n\n[\\\\\nDmitry Zakharov](https://dev.to/dzakh)\n\nFollow\n\nBuild fastest tools with best DX 🫡\n\n\n- Location\n\n\n\nGeorgia, Batumi\n\n\n- Work\n\n\n\nEnvio\n\n\n- Joined\n\n\nDec 11, 2022\n\n\n• [Feb 26 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m305)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m305)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/dzakh/comment/2m305)\n\nOk, I decided to double-check the package size table from their docs and it actually happened that the package size is not big [bundlephobia.com/package/@sinclair...](https://bundlephobia.com/package/@sinclair/typebox@0.34.28)\n\nAnother thing to compare is the much more readable error messages by default in ReScript Schema.\n\n[](https://dev.to/dhruvgarg79)\n\n[Dhruv garg](https://dev.to/dhruvgarg79)\n\nDhruv garg\n\n\n\n[\\\\\nDhruv garg](https://dev.to/dhruvgarg79)\n\nFollow\n\nWorking as a Tech Lead at a MarTech Startup.\nInterested in Databases, Performance, and everything Backend.\n\n\n- Location\n\n\n\nBengaluru, India\n\n\n- Education\n\n\n\nB. Tech in computer science\n\n\n- Work\n\n\n\nTech lead\n\n\n- Joined\n\n\nOct 1, 2019\n\n\n• [Mar 18 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2meh7)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2meh7)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/dhruvgarg79/comment/2meh7)\n\nI will give it a try in near future, thanks for amazing library my friend :)\n\nCollapseExpand\n\n[](https://dev.to/alexdev404)\n\n[Immanuel Garcia](https://dev.to/alexdev404)\n\nImmanuel Garcia\n\n\n\n[\\\\\nImmanuel Garcia](https://dev.to/alexdev404)\n\nFollow\n\n- Joined\n\n\nMay 6, 2020\n\n\n• [Feb 23 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m1h4)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m1h4)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/alexdev404/comment/2m1h4)\n\nSo why even use this if you can just use Zod or Valibot, bypassing any or all of that `eval` magic you did just for a few extra kilobytes?\n\nCollapseExpand\n\n[](https://dev.to/dzakh)\n\n[Dmitry Zakharov](https://dev.to/dzakh)\n\nDmitry Zakharov\n\n\n\n[\\\\\nDmitry Zakharov](https://dev.to/dzakh)\n\nFollow\n\nBuild fastest tools with best DX 🫡\n\n\n- Location\n\n\n\nGeorgia, Batumi\n\n\n- Work\n\n\n\nEnvio\n\n\n- Joined\n\n\nDec 11, 2022\n\n\n• [Feb 24 '25• Edited on Feb 24• Edited](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m1j5)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m1j5)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/dzakh/comment/2m1j5)\n\nEval actually makes the size bigger 😅\n\nThere are some unique features you can't find in any other library together:\n\n- Nice API with good DX\n- Top performance\n- Ability to conveniently and efficiently transform data when you parse\n- Ability to transform data without validation\n- Ability to get schema for the output type\n- Flexible set of operations\n\nIf you don't need it, then use Zod or Valibot. Both of them are good libraries I like.\n\nCollapseExpand\n\n[](https://dev.to/jpeggdev)\n\n[Jeff Pegg](https://dev.to/jpeggdev)\n\nJeff Pegg\n\n\n\n[\\\\\nJeff Pegg](https://dev.to/jpeggdev)\n\nFollow\n\n- Location\n\n\n\nTulsa, Oklahoma\n\n\n- Joined\n\n\nDec 4, 2024\n\n\n• [Mar 2 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m5ei)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m5ei)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/jpeggdev/comment/2m5ei)\n\nHi Dmitry, nice article. In your last code example showing the under the hood code, on the 3rd line it says e [7](https://dev.toi/), where does the capital I come from or is that a typo?\n\nCollapseExpand\n\n[](https://dev.to/dzakh)\n\n[Dmitry Zakharov](https://dev.to/dzakh)\n\nDmitry Zakharov\n\n\n\n[\\\\\nDmitry Zakharov](https://dev.to/dzakh)\n\nFollow\n\nBuild fastest tools with best DX 🫡\n\n\n- Location\n\n\n\nGeorgia, Batumi\n\n\n- Work\n\n\n\nEnvio\n\n\n- Joined\n\n\nDec 11, 2022\n\n\n• [Mar 2 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m5f0)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m5f0)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/dzakh/comment/2m5f0)\n\nHm, this looks like a copy-paste bug from Google Docs where I initially written the article. It should be a lower case i. As for `e` it comes from the function context and used for safe embedding to eval code.\n\nCollapseExpand\n\n[](https://dev.to/jpeggdev)\n\n[Jeff Pegg](https://dev.to/jpeggdev)\n\nJeff Pegg\n\n\n\n[\\\\\nJeff Pegg](https://dev.to/jpeggdev)\n\nFollow\n\n- Location\n\n\n\nTulsa, Oklahoma\n\n\n- Joined\n\n\nDec 4, 2024\n\n\n• [Mar 2 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m5f6)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m5f6)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/jpeggdev/comment/2m5f6)\n\nI didn't even notice it stripped the brackets and parenthesis from my comment.\n\n`e[7](I)`\n\nCollapseExpand\n\n[](https://dev.to/ravi-coding)\n\n[Ravindra Kumar](https://dev.to/ravi-coding)\n\nRavindra Kumar\n\n\n\n[\\\\\nRavindra Kumar](https://dev.to/ravi-coding)\n\nFollow\n\nFull-Stack Developer \\| MERN & Python \\| Passionate about building web apps and OpenAi APIs. Always learning and sharing knowledge with the community. Let's connect and create something awesome! 🚀\n\n\n- Email\n\n\n[rk2671353@gmail.com](mailto:rk2671353@gmail.com)\n\n- Location\n\n\n\nNew Delhi\n\n\n- Education\n\n\n\n2016\n\n\n- Pronouns\n\n\n\nHe/him\n\n\n- Work\n\n\n\nFull-Stack Developer \\| MERN & Django Specialist \\| Currently enhancing skills in AWS and cloud tech\n\n\n- Joined\n\n\nSep 5, 2024\n\n\n• [Feb 22 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m0on)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m0on)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/ravi-coding/comment/2m0on)\n\nAwesome !\n\nCollapseExpand\n\n[](https://dev.to/jesterly)\n\n[jesterly](https://dev.to/jesterly)\n\njesterly\n\n\n\n[\\\\\njesterly](https://dev.to/jesterly)\n\nFollow\n\n- Joined\n\n\nFeb 10, 2025\n\n\n• [Feb 26 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m33c)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2m33c)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/jesterly/comment/2m33c)\n\nVery cool, and thanks for the heads up about eval. It's a shame we can't use this in browser extensions because eval is not allowed in MV3 :-(.\n\nCollapseExpand\n\n[](https://dev.to/dzakh)\n\n[Dmitry Zakharov](https://dev.to/dzakh)\n\nDmitry Zakharov\n\n\n\n[\\\\\nDmitry Zakharov](https://dev.to/dzakh)\n\nFollow\n\nBuild fastest tools with best DX 🫡\n\n\n- Location\n\n\n\nGeorgia, Batumi\n\n\n- Work\n\n\n\nEnvio\n\n\n- Joined\n\n\nDec 11, 2022\n\n\n• [Apr 13 '25](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2n2h8)\n\nDropdown menu\n\n- [Copy link](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#comment-2n2h8)\n- Hide\n\n- [Report abuse](https://dev.to/report-abuse?url=https://dev.to/dzakh/comment/2n2h8)\n\nFinishing V10 with some fantastic improvements. I'm ready to take over the world 😁\n\n\n\n[View full discussion (16 comments)](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420/comments)\n\nAre you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's [permalink](https://dev.to/dzakh/javascript-schema-library-from-the-future-5420#).\n\n\nHide child comments as well\n\nConfirm\n\n\nFor further actions, you may consider blocking this person and/or [reporting abuse](https://dev.to/report-abuse)\n\n[\\\\\nBright Data](https://dev.to/bright-data) Promoted\n\nDropdown menu\n\n- [What's a billboard?](https://dev.to/billboards)\n- [Manage preferences](https://dev.to/settings/customization#sponsors)\n\n* * *\n\n- [Report billboard](https://dev.to/report-abuse?billboard=246460)\n\n[](https://dev.to/joupify/soc-cert-automated-threat-intelligence-system-with-n8n-ai-5722?bb=246460)\n\n## [SOC-CERT: Automated Threat Intelligence System with n8n & AI](https://dev.to/joupify/soc-cert-automated-threat-intelligence-system-with-n8n-ai-5722?bb=246460)\n\nCheck out this submission for the [AI Agents Challenge powered by n8n and Bright Data](https://dev.to/challenges/brightdata-n8n-2025-08-13?bb=246460).\n\n[Read more →](https://dev.to/joupify/soc-cert-automated-threat-intelligence-system-with-n8n-ai-5722?bb=246460)\n\n👋 Kindness is contagious\n\nDropdown menu\n\n- [What's a billboard?](https://dev.to/billboards)\n- [Manage preferences](https://dev.to/settings/customization#sponsors)\n\n* * *\n\n- [Report billboard](https://dev.to/report-abuse?billboard=239338)\n\nx\n\nExplore this practical breakdown on DEV’s open platform, where developers from every background come together to push boundaries. **No matter your experience,** your viewpoint enriches the conversation.\n\nDropping a simple “thank you” or question in the comments goes a long way in supporting authors—your feedback helps ideas evolve.\n\nAt DEV, **shared discovery drives progress** and builds lasting bonds. If this post resonated, a quick nod of appreciation can make all the difference.\n\n## [Okay](https://dev.to/enter?state=new-user&bb=239338)\n\n\n\nWe're a place where coders share, stay up-to-date and grow their careers.\n\n\n[Log in](https://dev.to/enter?signup_subforem=1) [Create account](https://dev.to/enter?signup_subforem=1&state=new-user)\n\n","metadata":{"twitter:widgets:new-embed-design":"on","ogSiteName":"DEV Community","twitter:card":"summary_large_image","og:site_name":"DEV Community","viewport":"width=device-width, initial-scale=1.0, viewport-fit=cover","theme-color":["#ffffff","#000000"],"forem:name":"DEV Community","og:image":"https://media2.dev.to/dynamic/image/width=1000,height=500,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn102ksd9w1xo5ysgxbur.png","ogUrl":"https://dev.to/dzakh/javascript-schema-library-from-the-future-5420","twitter:description":"ReScript Schema - The fastest parser in the entire JavaScript ecosystem with a focus on small bundle...","user-signed-in":"false","keywords":"schema, typescript, rescript, opensource, software, coding, development, engineering, inclusive, community","ogDescription":"ReScript Schema - The fastest parser in the entire JavaScript ecosystem with a focus on small bundle...","ogTitle":"JavaScript schema library from the Future 🧬","og:title":"JavaScript schema library from the Future 🧬","application-name":"dev.to","environment":"production","twitter:creator":"@dzakh_dev","last-updated":"2026-03-27 13:50:22 UTC","search-script":"https://assets.dev.to/assets/Search-b977aea0f2d7a5818b4ebd97f7d4aba8548099f84f5db5761f8fa67be76abc54.js","ogImage":"https://media2.dev.to/dynamic/image/width=1000,height=500,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn102ksd9w1xo5ysgxbur.png","og:url":"https://dev.to/dzakh/javascript-schema-library-from-the-future-5420","csrf-param":"authenticity_token","og:type":"article","twitter:image:src":"https://media2.dev.to/dynamic/image/width=1000,height=500,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn102ksd9w1xo5ysgxbur.png","apple-mobile-web-app-title":"dev.to","forem:logo":"https://media2.dev.to/dynamic/image/width=512,height=,fit=scale-down,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j7kvp660rqzt99zui8e.png","description":"ReScript Schema - The fastest parser in the entire JavaScript ecosystem with a focus on small bundle... Tagged with schema, typescript, rescript, opensource.","twitter:site":"@thepracticaldev","forem:domain":"dev.to","csrf-token":"Zaxe-092G0zAA0HFwn9lahOGpju8s9tGVoewgHTJx4Nl8W4q4ahTyB3O95CU560sPkhsC6oYVYEdBNbBCMhyPA","title":"JavaScript schema library from the Future 🧬 - DEV Community","head-cached-at":"1774619422","twitter:title":"JavaScript schema library from the Future 🧬","language":"en","og:description":"ReScript Schema - The fastest parser in the entire JavaScript ecosystem with a focus on small bundle...","robots":"max-snippet:-1, max-image-preview:large, max-video-preview:-1","favicon":"https://media2.dev.to/dynamic/image/width=32,height=,fit=scale-down,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j7kvp660rqzt99zui8e.png","scrapeId":"019d3953-7d92-73ea-8ecb-7573c5b87b9c","sourceURL":"https://dev.to/dzakh/javascript-schema-library-from-the-future-5420","url":"https://dev.to/dzakh/javascript-schema-library-from-the-future-5420","statusCode":200,"contentType":"text/html; charset=utf-8","timezone":"America/New_York","proxyUsed":"basic","cacheState":"miss","indexId":"bd910caa-9662-4fa1-86e6-d041fc353261","creditsUsed":1}},{"url":"https://www.youtube.com/watch?v=Ej8MBEmUTNI","title":"Effect Schema v4 improvements & comparisons - YouTube","description":"... v=P04R7lUR4Cc Join the conversation on -v4-beta: https ... Effect #TypeScript #TypeScriptLibrary.","position":4,"markdown":"\n# [Effect Schema v4 improvements & comparisons | Effect v4 Beta 🚀](https://www.youtube.com/watch?v=Ej8MBEmUTNI)\n\n**Visibility**: Public\n**Uploaded by**: [Effect | TypeScript at Scale](http://www.youtube.com/@effect-ts)\n**Uploaded at**: 2026-02-24T06:12:21-08:00\n**Published at**: 2026-02-24T06:12:21-08:00\n**Length**: 06:30\n**Views**: 1233\n**Likes**: 41\n**Category**: Science & Technology\n\n## Description\n\n```\nJoin the Effect community → https://discord.gg/effect-ts\n\n00:00 Effect Schema transformation and compatibility helpers\n01:29 Making large Schemas manageable: optional fields and mapping\n02:19 Performance and design goals compared to other libraries\n\nFull breakdown: https://www.youtube.com/watch?v=P04R7lUR4Cc\nJoin the conversation on 🚀-v4-beta: https://discord.com/channels/795981131316985866/1473717956092629185\n\n______________________________________\n\nEffect is an ecosystem of tools for production-grade software in TypeScript.\n\n→ https://effect.website\n→ https://effect.solutions\n→ https://effect.institute\n→ https://github.com/Effect-TS\n→ https://twitter.com/EffectTS_\n\n______________________________________\n\n#Effect #TypeScript #TypeScriptLibrary\n```\n\n## Transcript\n\nThe number of cool and exciting features of schema in V4 is just like unreal. Yeah. Like is a whole new world, a whole new world that the V4 that once you try it, you say, okay, what I have been using up to now. Yeah.\nI mean, like it's, it's just, yeah. I mean, a good example is like in the AI packages. one of the common pieces gripes and feedback things that I would get from folks is that, when you declare a schema, there was no way for us to let you know, ahead of time that the Jason schema that schema would get transformed to it would be invalid per the provider. Like for example, most providers don't accept like tuple representations or, you know, there's specific restrictions on like filters and things like that. So for V4, Giulio wrote a set of helpers that basically for the AI modules that allow me to transform under the hood, the schema that you give me into a format that's compatible by the provider. and like taking any filters and things like that, that are not valid for the provider and shoving it into this description of like those properties, send it to the provider, let them generate the object, send it back, and then transform it backwards into the object that, that I want. So like, it's just like a really small example of like what before schema can do. But like, another one that usually people ask about is I have a schema with hundreds of properties. I want to make all of them optional. And right now it's like, I'm a madness to do because you need to like manually picking them and now mark them as optional or whatever, and with the four, you basically do your schema dot map fields and you provide schema dot optional key, and now you have a new schema that has all of the keys optional, which is like amazing, you know, that that's one of probably the use cases I have most heard of. Yeah.\nThe, the, the, the ability to transform schemas has evolved substantially. and like I said, we'll probably do another, maybe like the next office hours or a future office hours on just like schema stuff, because there's, there's so much to chat about. So as we mentioned, like Effect schema, both like a huge rewrite and, you'll see like a lot of comparisons with, variables or whatever. one thing that you have to keep in mind when seeing those like comparison is like first the features they provide because like some of the libraries that effort schemas compares the games and just do validation and that's it. Some of them even do not do like two way encoding and decoding, but just like validation and that's it. And so that's indeed something that makes, effect schema like heavier and slower, but the other thing that I will also, also to point out is that like. Some of those libraries, I think the latest version of thought, for example, basically use, an optimization where they use like the new function constructor in order to construct a faster way to parse and decode, objects, for example, and that's indeed faster, but the issue is that there are some environments where arbitrary JS code execution, like new function or evil is banned and so those kinds of libraries won't work in that environment. whereas with Effect schema, we try again, Effect tries to run whatever. So initially we won't take that approach, even though we know that indeed faster in the way that works, but we point mostly on like working everywhere. But that not does not exclude that in the future, they may be some experimentation about that, but at the moment, that's why you see like the performance comparison and you see the difference. Okay. And just wanting to point out that. And I think that if someone has other questions. I think Mike mentioned in my Twitch chat that they do work, but they need fallbacks to do so and the design goals of schema are also different than some of these other frameworks. the design, like schema also integrates with effect natively. So asynchronous transformations, for example, are possible, without having to do a lot of extra work with schema. asynchronous filters, I think are supported in v4 too. so yeah, the, the v4 schema is definitely much lighter than v3. but it's still going to be a, a, the, the, the design goals and the features that we're trying to support are slightly different than some of these other libraries. in particular, I think that for Zod and, and Valabot and a lot of these other libraries, codec, type, decoding and coding, when I say codec, I mean, like being able to decode and then code was, I don't want to say an afterthought, but it was, it was added after the fact. Whereas with schema, we were focused on production use cases. And so being able to both decode data coming into your application and encode data, that's going to be going out of your application or two core design goals, even from v3. So anyway, that's why, you know, these comparisons are not necessarily always the best, but listen, Zod and Valabot and the other libraries that are out there certainly all have their use cases. schema just has its own set of, yeah. Like always, it depends on what you want to do. Yeah, exactly. It depends. Classic software engineering excuse. It depends.\n\n\n## Endscreen\n \n- [Introducing Effect v4 beta 🚀 (Office Hours 17)](https://www.youtube.com/watch?v=P04R7lUR4Cc)","metadata":{"identifier":"Ej8MBEmUTNI","position":"1","height":["720","720"],"twitter:app:id:iphone":"544007664","ogUrl":"https://www.youtube.com/watch?v=Ej8MBEmUTNI","title":"Effect Schema v4 improvements & comparisons | Effect v4 Beta 🚀 - YouTube","ogImage":"https://i.ytimg.com/vi/Ej8MBEmUTNI/maxresdefault.jpg","datePublished":"2026-02-24T06:12:21-08:00","name":["Effect Schema v4 improvements & comparisons | Effect v4 Beta 🚀","Effect | TypeScript at Scale"],"al:ios:app_store_id":"544007664","al:android:package":"com.google.android.youtube","twitter:title":"Effect Schema v4 improvements & comparisons | Effect v4 Beta 🚀","duration":"PT6M30S","fb:app_id":"87741124305","al:ios:url":"vnd.youtube://www.youtube.com/watch?v=Ej8MBEmUTNI&feature=applinks","og:description":"Join the Effect community → https://discord.gg/effect-ts00:00 Effect Schema transformation and compatibility helpers01:29 Making large Schemas manageable: op...","twitter:site":"@youtube","regionsAllowed":"AD,AE,AF,AG,AI,AL,AM,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE,BF,BG,BH,BI,BJ,BL,BM,BN,BO,BQ,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CD,CF,CG,CH,CI,CK,CL,CM,CN,CO,CR,CU,CV,CW,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER,ES,ET,FI,FJ,FK,FM,FO,FR,GA,GB,GD,GE,GF,GG,GH,GI,GL,GM,GN,GP,GQ,GR,GS,GT,GU,GW,GY,HK,HM,HN,HR,HT,HU,ID,IE,IL,IM,IN,IO,IQ,IR,IS,IT,JE,JM,JO,JP,KE,KG,KH,KI,KM,KN,KP,KR,KW,KY,KZ,LA,LB,LC,LI,LK,LR,LS,LT,LU,LV,LY,MA,MC,MD,ME,MF,MG,MH,MK,ML,MM,MN,MO,MP,MQ,MR,MS,MT,MU,MV,MW,MX,MY,MZ,NA,NC,NE,NF,NG,NI,NL,NO,NP,NR,NU,NZ,OM,PA,PE,PF,PG,PH,PK,PL,PM,PN,PR,PS,PT,PW,PY,QA,RE,RO,RS,RU,RW,SA,SB,SC,SD,SE,SG,SH,SI,SJ,SK,SL,SM,SN,SO,SR,SS,ST,SV,SX,SY,SZ,TC,TD,TF,TG,TH,TJ,TK,TL,TM,TN,TO,TR,TT,TV,TW,TZ,UA,UG,UM,US,UY,UZ,VA,VC,VE,VG,VI,VN,VU,WF,WS,YE,YT,ZA,ZM,ZW","og:title":"Effect Schema v4 improvements & comparisons | Effect v4 Beta 🚀","twitter:app:name:iphone":"YouTube","ogDescription":"Join the Effect community → https://discord.gg/effect-ts00:00 Effect Schema transformation and compatibility helpers01:29 Making large Schemas manageable: op...","al:web:url":"http://www.youtube.com/watch?v=Ej8MBEmUTNI&feature=applinks","twitter:app:name:ipad":"YouTube","referrer":"origin-when-cross-origin","og:site_name":"YouTube","twitter:app:url:iphone":"vnd.youtube://www.youtube.com/watch?v=Ej8MBEmUTNI&feature=applinks","isFamilyFriendly":"true","ogTitle":"Effect Schema v4 improvements & comparisons | Effect v4 Beta 🚀","twitter:app:id:googleplay":"com.google.android.youtube","og:video:type":"text/html","genre":"Science & Technology","ogSiteName":"YouTube","og:url":"https://www.youtube.com/watch?v=Ej8MBEmUTNI","description":"Join the Effect community → https://discord.gg/effect-ts00:00 Effect Schema transformation and compatibility helpers01:29 Making large Schemas manageable: op..., Join the Effect community → https://discord.gg/effect-ts00:00 Effect Schema transformation and compatibility helpers01:29 Making large Schemas manageable: op...","og:type":"video.other","twitter:player:height":"720","theme-color":"rgba(255, 255, 255, 0.98)","og:image:height":"720","og:video:secure_url":"https://www.youtube.com/embed/Ej8MBEmUTNI","twitter:image":"https://i.ytimg.com/vi/Ej8MBEmUTNI/maxresdefault.jpg","og:image":"https://i.ytimg.com/vi/Ej8MBEmUTNI/maxresdefault.jpg","og:image:width":"1280","al:android:app_name":"YouTube","og:video:url":"https://www.youtube.com/embed/Ej8MBEmUTNI","twitter:player":"https://www.youtube.com/embed/Ej8MBEmUTNI","og:video:height":"720","viewport":["width=device-width, initial-scale=1.0, viewport-fit=cover","initial-scale=1, minimum-scale=1, width=device-width"],"userInteractionCount":["41","1233"],"language":"en","twitter:card":"player","twitter:url":"https://www.youtube.com/watch?v=Ej8MBEmUTNI","al:ios:app_name":"YouTube","playerType":"HTML5 Flash","al:android:url":"vnd.youtube://www.youtube.com/watch?v=Ej8MBEmUTNI&feature=applinks","twitter:app:url:ipad":"vnd.youtube://www.youtube.com/watch?v=Ej8MBEmUTNI&feature=applinks","twitter:app:url:googleplay":"https://www.youtube.com/watch?v=Ej8MBEmUTNI","requiresSubscription":"False","interactionType":["https://schema.org/LikeAction","https://schema.org/WatchAction"],"width":["1280","1280"],"uploadDate":"2026-02-24T06:12:21-08:00","keywords":["typescript, effect, typescript library, javascript","typescript,effect,typescript library,javascript"],"og:video:width":"1280","og:video:tag":["typescript","effect","typescript library","javascript"],"twitter:player:width":"1280","twitter:app:id:ipad":"544007664","twitter:app:name:googleplay":"YouTube","twitter:description":"Join the Effect community → https://discord.gg/effect-ts00:00 Effect Schema transformation and compatibility helpers01:29 Making large Schemas manageable: op...","favicon":"https://www.youtube.com/s/desktop/7cf77294/img/favicon_32x32.png","scrapeId":"019d3953-7d92-73ea-8ecb-7b3877e2216a","sourceURL":"https://www.youtube.com/watch?v=Ej8MBEmUTNI","url":"https://www.youtube.com/watch?v=Ej8MBEmUTNI","statusCode":200,"contentType":"text/html; charset=utf-8","timezone":"America/New_York","proxyUsed":"basic","cacheState":"miss","postprocessorsUsed":["youtube"],"indexId":"38d129da-e2dd-4081-b3fd-dd84e1380c62","creditsUsed":1}},{"url":"https://news.ycombinator.com/item?id=41791316","title":"I love Zod, but recently I've been converting to Effect's Data and ...","description":"Data and Schema fit into the ecosystem perfectly, making it really easy to compose very resilient, scalable, reliable data pipelines for example. I'm a convert.","position":5,"markdown":"| | | |\n| --- | --- | --- |\n| | | | |\n| --- | --- | --- |\n| [](https://news.ycombinator.com/) | **[Hacker News](https://news.ycombinator.com/news)** [new](https://news.ycombinator.com/newest) \\| [past](https://news.ycombinator.com/front) \\| [comments](https://news.ycombinator.com/newcomments) \\| [ask](https://news.ycombinator.com/ask) \\| [show](https://news.ycombinator.com/show) \\| [jobs](https://news.ycombinator.com/jobs) \\| [submit](https://news.ycombinator.com/submit) | [login](https://news.ycombinator.com/login?goto=item%3Fid%3D41791316) | |\n\n| | | | |\n| --- | --- | --- |\n| | | [steve\\_adams\\_86](https://news.ycombinator.com/user?id=steve_adams_86) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41791316) \\| [parent](https://news.ycombinator.com/item?id=41764163) \\| [context](https://news.ycombinator.com/item?id=41764163#41791316) \\| [favorite](https://news.ycombinator.com/fave?id=41791316&auth=1ab9cee83657e0f50d154880442ef19487968487) \\| on: [Zod: TypeScript-first schema validation with stati...](https://news.ycombinator.com/item?id=41764163 \"Zod: TypeScript-first schema validation with static type inference\")<br>I love Zod, but recently I've been converting to Effect's Data and Schema modules.<br>Previously I liked a combination of Zod and ts-pattern to create safe, pattern matching-oriented logic around my data. I find Effect is designed far better for this, so far. I'm enjoying it a lot. The Schema module has a nice convention for expressing validators, and it's very composable and flexible: [https://effect.website/docs/guides/schema/introduction](https://effect.website/docs/guides/schema/introduction)<br>There are also really nice aspects like the interoperability between Schema and Data, allowing you to safely parse data from outside your application boundary then perform safe operations like exhaustively matching on tagged types (essentially discriminated unions): [https://effect.website/docs/other/data-types/data#is-and-mat...](https://effect.website/docs/other/data-types/data#is-and-match)<br>It feels extremely productive and intuitive once you get the hang of it. I didn't expect to like it so much.<br>I think the real power here is that these modules also have full interop with the rest of Effect. Effects are like little lazy loaded logical bits that are all consistent in how they resolve, making it trivial to compose and execute logic. Data and Schema fit into the ecosystem perfectly, making it really easy to compose very resilient, scalable, reliable data pipelines for example. I'm a convert.<br>Zod is awesome if you don't want to adopt Effect wholesale, though. |\n| | |\n\n| | | |\n| --- | --- | --- |\n| | | | |\n| --- | --- | --- |\n|  | | [bjacobso](https://news.ycombinator.com/user?id=bjacobso) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41791501) \\| [next](https://news.ycombinator.com/item?id=41791316#41798387)\\[–\\]<br>I've had a very similar experience, and have been slowly moving from zod and ts-rest to @effect/schema and @effect/platform/HttpApi as well as migration to Effect Match from ts-pattern. There is a learning curve but its a pretty incredible ecosystem once you are in it for a bit.<br>I think the real turning point was typescript 5.5 (May 2024). The creator of typescript personally fixed a bug that unlocked a more natural generator syntax for Effect, which I think unlocks mainstream adoption potential.<br>[https://twitter.com/MichaelArnaldi/status/178506160889445172...](https://twitter.com/MichaelArnaldi/status/1785061608894451725) [https://github.com/microsoft/TypeScript/pull/58337](https://github.com/microsoft/TypeScript/pull/58337) | |\n| | | | |\n| --- | --- | --- |\n|  | | [morbicer](https://news.ycombinator.com/user?id=morbicer) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41791545) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791501) \\| [next](https://news.ycombinator.com/item?id=41791316#41792966)\\[–\\]<br>I feel like Effect is today's Ramda. So cool but it's going to be regretted by you and people coming after you in few years.<br>Me and my team reverted to more stupid code and we are happier. | |\n| | | | |\n| --- | --- | --- |\n|  | | [presentation](https://news.ycombinator.com/user?id=presentation) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41795345) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791545) \\| [next](https://news.ycombinator.com/item?id=41791316#41795921)\\[–\\]<br>My experience with fp-ts and io-ts was that we quickly got to a point where the team was divided into a small group of people usually with postgraduate CS degrees who really understood it, and then everyone else who saw it as black magic and were afraid to touch it.<br>Nowadays I’d rather rely on libraries that don’t require a phd to use them properly. | |\n| | | | |\n| --- | --- | --- |\n|  | | [hombre\\_fatal](https://news.ycombinator.com/user?id=hombre_fatal) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41799182) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41795345) \\| [next](https://news.ycombinator.com/item?id=41791316#41795921)\\[–\\]<br>You just gave me a flashback to scalaz [https://github.com/scalaz/scalaz](https://github.com/scalaz/scalaz) | |\n| | | | |\n| --- | --- | --- |\n|  | | [hresvelgr](https://news.ycombinator.com/user?id=hresvelgr) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41795921) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791545) \\| [prev](https://news.ycombinator.com/item?id=41791316#41795345) \\| [next](https://news.ycombinator.com/item?id=41791316#41792186)\\[–\\]<br>\\> Me and my team reverted to more stupid code and we are happier.<br>This is 100% how to write more reliable software. We are in the process of reducing our TS dependencies to effectively just express and node-postgres and everything is becoming infinitely easier to manage. | |\n| | | | |\n| --- | --- | --- |\n|  | | [BillyTheKing](https://news.ycombinator.com/user?id=BillyTheKing) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41796515) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41795921) \\| [next](https://news.ycombinator.com/item?id=41791316#41792186)\\[–\\]<br>Yes, all true - apart from treating errors as values and including them function signatures... That should simply be something every modern language should ship with | |\n| | | | |\n| --- | --- | --- |\n|  | | [Sammi](https://news.ycombinator.com/user?id=Sammi) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41796662) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41796515) \\| [next](https://news.ycombinator.com/item?id=41791316#41792186)\\[–\\]<br>I have never written any code in Go, but increasingly I am writing my TS in the style I hear Go code is written in. Very procedural, very verbose. All of the fancy indirection you get with coding everything with higher order functions just makes the program impossible to debug later. Procedural style programming lends itself to debugging, and I definitely am so dumb I need to debug my own programs.<br>I may simply be too dumb for lots of fancy functional programming. I can barely understand code when reading one line and statement at a time. Reading functions calling functions calling functions just makes me feel like gravity stopped working and I don't know which way is up. My brain too small. | |\n| | | | |\n| --- | --- | --- |\n|  | | [steve\\_adams\\_86](https://news.ycombinator.com/user?id=steve_adams_86) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41792186) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791545) \\| [prev](https://news.ycombinator.com/item?id=41791316#41795921) \\| [next](https://news.ycombinator.com/item?id=41791316#41793956)\\[–\\]<br>I agree in some contexts. Kind of like Rust, I see a place for more durable code that's harder to reason about in some cases.<br>I wouldn't use Effect for a lot of things. For some things, I'm very glad to have it. One thing Effect has going for it that Ramda didn't is that it's much less abstract and it's quite a bit more opinionated about some more complex concepts like error handling, concurrency, or scheduling.<br>Kind of like state machines. You shouldn't use them for everything. For some things, it's a bad idea not to (in my opinion).<br>Then of course subjectivity is a factor here. Some people will never like conventions like Effect, and that's fine too. Just write what feels right. | |\n| | | | |\n| --- | --- | --- |\n|  | | [Stoids](https://news.ycombinator.com/user?id=Stoids) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41793956) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791545) \\| [prev](https://news.ycombinator.com/item?id=41791316#41792186) \\| [next](https://news.ycombinator.com/item?id=41791316#41793752)\\[–\\]<br>I think going all-in on Effect in its current state is not something I'd do. However there's a subset of its functionality that I'm currently replicating with a bunch of different libraries: ts-pattern, zod, some lightweight result / option wrapper like ts-belt, etc. Pretty much trying to pretend I'm writing ML / OCaml. Having those all in one package is quite convenient. Add in TypeScript's the much needed story around retry / observability / error handling—I see why people lean into it.<br>Having experience with ZIO / FP in Scala, I'm a bit biased in seeing the value of Effect systems as a whole, but taking on the burden of explaining that mental model to team members and future maintainers is a big cost for most teams. | |\n| | | | |\n| --- | --- | --- |\n|  | | [rashkov](https://news.ycombinator.com/user?id=rashkov) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41798880) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41793956) \\| [next](https://news.ycombinator.com/item?id=41791316#41793752)\\[–\\]<br>Coming from a ReasonML / OCaml codebase (frontend react), I'm seeing a lot to love with the pattern matching and sum types. Zod is already one of my favorites (coming from [https://github.com/glennsl/bs-json](https://github.com/glennsl/bs-json)).<br>Is 'retry / observability / error handling\" something that comes from Effect? | |\n| | | | |\n| --- | --- | --- |\n|  | | [Stoids](https://news.ycombinator.com/user?id=Stoids) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41802889) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41798880) \\| [next](https://news.ycombinator.com/item?id=41791316#41793752)\\[–\\]<br>That's right, Effect lifts all types to a lazily-evaluated common type and provides combinators to work with that type, similar to RxJS with Observables and its operators.<br>Retrying\\[0\\], observability\\[1\\], and error handling\\[2\\] are first-class concerns and have built-in combinators to make dealing with those problems quite ergonomic. Having these features is a non-starter for any serious application, but unfortunately, the story around them in the TypeScript ecosystem is not great—at least as far as coherence goes. You often end up creating abstractions on top of unrelated libraries and trying to smash them together.<br>I'm a big fan of ReasonML / OCaml, and I think the future of TypeScript will involve imitating many of its code patterns.<br>\\[0\\] [https://effect.website/docs/guides/error-management/retrying](https://effect.website/docs/guides/error-management/retrying)<br>\\[1\\] [https://effect.website/docs/guides/observability/telemetry/t...](https://effect.website/docs/guides/observability/telemetry/tracing#creating-spans)<br>\\[2\\] [https://effect.website/docs/guides/error-management/expected...](https://effect.website/docs/guides/error-management/expected-errors) | |\n| | | | |\n| --- | --- | --- |\n|  | | [k\\_\\_](https://news.ycombinator.com/user?id=k__) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41793752) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791545) \\| [prev](https://news.ycombinator.com/item?id=41791316#41793956) \\| [next](https://news.ycombinator.com/item?id=41791316#41799577)\\[–\\]<br>Yes it's quite sad.<br>I liked the idea of Ramda until I saw code bases that where using it for everything.<br>I'm doing JS for over a decade now and I couldn't understand a thing. | |\n| | | | |\n| --- | --- | --- |\n|  | | [MichaelArnaldi](https://news.ycombinator.com/user?id=MichaelArnaldi) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41799577) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791545) \\| [prev](https://news.ycombinator.com/item?id=41791316#41793752) \\| [next](https://news.ycombinator.com/item?id=41791316#41794405)\\[–\\]<br>Don't judge Effect based on Rambda they have completely different objectives, Rambda focused a lot on abstractions similar to fp-ts, Effect focuses almost exclusively on concrete implementations | |\n| | | | |\n| --- | --- | --- |\n|  | | [evilduck](https://news.ycombinator.com/user?id=evilduck) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41800014) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41799577) \\| [next](https://news.ycombinator.com/item?id=41791316#41794405)\\[–\\]<br>It's not the library per se, it's that the library will require all-or-nothing buy in from your entire development team for it to be useful and persistently maintained, similar to how Rambda affected a codebase and a development team.<br>It's the same effect as adding async code to Python or Rust, suddenly the entire team and the entire codebase (and often dependency choices) must adhere to it. | |\n| | | | |\n| --- | --- | --- |\n|  | | [steve\\_adams\\_86](https://news.ycombinator.com/user?id=steve_adams_86) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41800626) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41800014) \\| [next](https://news.ycombinator.com/item?id=41791316#41794405)\\[–\\]<br>One of the things I like about Effect is that incremental adoption is easy, and you really don't have to use it everywhere.<br>You can choose to make a single flow in your application an effect program. Or you can base most of your functions around it. It's really up to you how and where it's used. If you want to use an effect within non-effect code, that's easy to do, too.<br>You can think of effects like values. The value is obtained by executing the effect. Until it's called, the effect can be placed anywhere, in any function, in a generator, within promises, etc. Once you need its value, you execute it. It's compatible with most code bases as long as you can execute it to get the value. It's really up to the developer how portable they want their effects to be. | |\n| | | | |\n| --- | --- | --- |\n|  | | [evilduck](https://news.ycombinator.com/user?id=evilduck) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41800814) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41800626) \\| [next](https://news.ycombinator.com/item?id=41791316#41794405)\\[–\\]<br>I understand, but this is very much like promises in JS. You can pass promises around without awaiting their return values too but async and/or promise code inevitably infects the rest of the codebase. I've never really seen anyone just have promises walled off in one specific module where the rest of the codebase sticks to callbacks.<br>Passing Effects around will similarly infect the entire codebase, resulting in the entire dev team who interacts with it needing to buy in. Limiting the output of Effects to a single module owned by one zealot dev undermines having it around in the first place and it'll get removed and replaced as soon as that person leaves or gives up the fight. | |\n| | | | |\n| --- | --- | --- |\n|  | | [epolanski](https://news.ycombinator.com/user?id=epolanski) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41794405) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791545) \\| [prev](https://news.ycombinator.com/item?id=41791316#41799577) \\| [next](https://news.ycombinator.com/item?id=41791316#41791565)\\[–\\]<br>Effect is not only much easier to get productive on than Ramda, but it provides an entire ecosystem.<br>Our team is full effect from two years and juniors can pick it and start working on it with ease. | |\n| | | | |\n| --- | --- | --- |\n|  | | [steve\\_adams\\_86](https://news.ycombinator.com/user?id=steve_adams_86) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41795519) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41794405) \\| [next](https://news.ycombinator.com/item?id=41791316#41791565)\\[–\\]<br>Having references to work from is essential. Their documentation doesn’t do as good of a job demonstrating that as it could, in my opinion. | |\n| | | | |\n| --- | --- | --- |\n|  | | [yunohn](https://news.ycombinator.com/user?id=yunohn) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41797794) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41795519) \\| [next](https://news.ycombinator.com/item?id=41791316#41791565)\\[–\\]<br>I’ve found that with most libraries - they always provide toy foobar style examples assuming it’ll make them approachable, but in reality, instead makes it impossible to understand the practical way to use it in real world settings. | |\n| | | | |\n| --- | --- | --- |\n|  | | [epolanski](https://news.ycombinator.com/user?id=epolanski) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41802350) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41797794) \\| [next](https://news.ycombinator.com/item?id=41791316#41799203)\\[–\\]<br>That is quite of an hard problem to solve.<br>Solutions like effect are easier to appreciate as your application starts growing in complexity beyond simple todo apps.<br>Solutions like effect/schema are easier to appreciate as soon as you start needing complex types, encoding/decoding, branded types and more.<br>I am quite confident that effect will keep growing in popularity steadily and eventually grow.<br>It took more than 5/6 years for TypeScript or React to start getting spread around the JS community. Effect is here to stay and I'm confident it will eventually be adopted by plenty of developers. | |\n| | | | |\n| --- | --- | --- |\n|  | | [hombre\\_fatal](https://news.ycombinator.com/user?id=hombre_fatal) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41799203) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41797794) \\| [prev](https://news.ycombinator.com/item?id=41791316#41802350) \\| [next](https://news.ycombinator.com/item?id=41791316#41791565)\\[–\\]<br>Reminds me of Animal / Cat / Dog examples.<br>For the love of god just use User / RegisteredUser / GuestUser and other abstractions that have some basis in the real world. | |\n| | | | |\n| --- | --- | --- |\n|  | | [bjacobso](https://news.ycombinator.com/user?id=bjacobso) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41791565) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791545) \\| [prev](https://news.ycombinator.com/item?id=41791316#41794405) \\| [next](https://news.ycombinator.com/item?id=41791316#41792966)\\[–\\]<br>that is certainly a possibility | |\n| | | | |\n| --- | --- | --- |\n|  | | [dimal](https://news.ycombinator.com/user?id=dimal) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41792966) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791501) \\| [prev](https://news.ycombinator.com/item?id=41791316#41791545) \\| [next](https://news.ycombinator.com/item?id=41791316#41792257)\\[–\\]<br>How did you find learning Effect? The sales pitch sounds great, but when I went through the docs it seemed pretty confusing to me. I’m sure there are reasons for the everything but I couldn’t grok it. In particular, I’m thinking of the Express integration example.\\[0\\] I look at that and think, I need all that just to create a server and a route? What’s the benefit there? I’m hesitant to buy into the ecosystem after looking at that. I want to like it, though.<br>\\[0\\] [https://effect.website/docs/integrations/express](https://effect.website/docs/integrations/express) | |\n| | | | |\n| --- | --- | --- |\n|  | | [obeavs](https://news.ycombinator.com/user?id=obeavs) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41793764) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41792966) \\| [next](https://news.ycombinator.com/item?id=41791316#41793246)\\[–\\]<br>Hands down, the best (free, no email) resource to learn Effect is here [https://www.typeonce.dev/course/effect-beginners-complete-ge...](https://www.typeonce.dev/course/effect-beginners-complete-getting-started), as opposed to the docs. The link referenced gives a holistic view of how to incorporate it. | |\n| | | | |\n| --- | --- | --- |\n|  | | [satvikpendem](https://news.ycombinator.com/user?id=satvikpendem) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41794857) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41793764) \\| [next](https://news.ycombinator.com/item?id=41791316#41797446)\\[–\\]<br>I've been following the author Sandro Maglione for quite a while and am on his email list, he's great. He wrote fpdart which I've used and now he seems to be all in on Effect, with XState. | |\n| | | | |\n| --- | --- | --- |\n|  | | [wruza](https://news.ycombinator.com/user?id=wruza) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41797446) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41793764) \\| [prev](https://news.ycombinator.com/item?id=41791316#41794857) \\| [next](https://news.ycombinator.com/item?id=41791316#41793246)\\[–\\]<br>That’s just another level. Only in five pages of explanations we come to something that is basically:<br>```<br> await fetch(…)<br> .catch(e =><br> new CustomError(…))<br>```<br>But with a wrapped-promise and flatmap nonsense for “better error handling”.<br>FP always goes out of the way to avoid using the language it operates in and to criticize the ways of doing something it just imagined. As if it wanted to stay as noble from unwashed peasants as it could, but has to do the same job to keep existing.<br>_how to test () => makePayment()?_ (from the link)<br>You don’t. You test constituents like request body generation and response handling. It’s inside. You can’t test your Effect-version of this code neither. It’s a strawman. | |\n| | | | |\n| --- | --- | --- |\n|  | | [theschwa](https://news.ycombinator.com/user?id=theschwa) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41793246) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41792966) \\| [prev](https://news.ycombinator.com/item?id=41791316#41793764) \\| [next](https://news.ycombinator.com/item?id=41791316#41793375)\\[–\\]<br>Yeah, looking at that example feels like jumping straight into the deep end of the pool. I think it helps going through a tutorial that breaks down the why of each piece. I really liked this tutorial on it: [https://www.typeonce.dev/course/effect-beginners-complete-ge...](https://www.typeonce.dev/course/effect-beginners-complete-getting-started) <br>Some core things from Effect though that you can see in that Express example:<br>\\\\* Break things down into Services. Effect handles dependency injection, that's typed, for services so you can easily test them and have different versions running for testing, production, etc.<br>\\\\* Fibers for threaded execution<br>\\\\* Managing resources to make sure they're properly closed with scope<br>I think a lot of these things though often aren't truly appreciated until you've had something go wrong before or you've had to build a system to manage them yourself.<br>\\* | |\n| | | | |\n| --- | --- | --- |\n|  | | [mewpmewp2](https://news.ycombinator.com/user?id=mewpmewp2) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41794687) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41793246) \\| [next](https://news.ycombinator.com/item?id=41791316#41793706)\\[–\\]<br>But I feel like I've worked with massive systems with a lot going on where nothing has gone wrong that this sort of thing specifically would solve it. I think it would just increase learning curve and make people make other types of mistakes (business logic or otherwise) because it's so much less readable and understandable. I've seen similar libraries used in the past that have caused much more worse bugs because people misunderstand how they exactly work. | |\n| | | | |\n| --- | --- | --- |\n|  | | [dimal](https://news.ycombinator.com/user?id=dimal) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41793706) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41793246) \\| [prev](https://news.ycombinator.com/item?id=41791316#41794687) \\| [next](https://news.ycombinator.com/item?id=41791316#41793375)\\[–\\]<br>Yeah, this looks like the tutorial I needed. Thanks. | |\n| | | | |\n| --- | --- | --- |\n|  | | [bjacobso](https://news.ycombinator.com/user?id=bjacobso) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41793375) \\| [root](https://news.ycombinator.com/item?id=41791316#41791501) \\| [parent](https://news.ycombinator.com/item?id=41791316#41792966) \\| [prev](https://news.ycombinator.com/item?id=41791316#41793246) \\| [next](https://news.ycombinator.com/item?id=41791316#41792257)\\[–\\]<br>I agree, some of there examples are a little overly complicated by their quest to be hyper composable. In fact they should probably remove that example. I am currently using it with Remix, and using their @effect/platform package to produce a simple web handler (request: Request) => Response (thank remix for heavily promoting the adoption of web standards).<br>I fully agree parts of the ecosystem are complex, and likely not fully ready for broad adoption. But I do think things will simplify with time, patterns will emerge, and it will be seen as react-for-the-backend, the de facto first choice. effect + schema + platform + cluster will be an extremely compelling stack. | |\n| | | | |\n| --- | --- | --- |\n|  | | [steve\\_adams\\_86](https://news.ycombinator.com/user?id=steve_adams_86) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41792257) \\| [parent](https://news.ycombinator.com/item?id=41791316#41791501) \\| [prev](https://news.ycombinator.com/item?id=41791316#41792966) \\| [next](https://news.ycombinator.com/item?id=41791316#41798387)\\[–\\]<br>I agree about the turning point. Things have improved dramatically. And I know it probably doesn't feel the same for tons of people, but I love to see generators being used in every day code.<br>The learning curve just about turned me away from it at the start, but I'm glad I stuck with it.<br>I think learning Effect would actually teach a lot of people some very useful concepts and patterns for programming in general. It's very well thought out. | |\n| | | | |\n| --- | --- | --- |\n|  | | [williamcotton](https://news.ycombinator.com/user?id=williamcotton) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41798387) \\| [prev](https://news.ycombinator.com/item?id=41791316#41791501) \\| [next](https://news.ycombinator.com/item?id=41791316#41793804)\\[–\\]<br>Why not write your code in F# and compile it to TypeScript using Fable \\[1\\]?<br>This way you can use native language features for discriminated unions, functional pipelines, and exhaustive pattern matching to model your domain instead of shoe-horning such functionality into a non-ML language!<br>Model your domain in F#, consume it in Python or C# backends and TypeScript frontends. The downside is needing to know all of these languages and run times but I think I'd rather know F# and the quirks with interacting with TypeScript than a library like Effect!<br>\\[1\\] [https://fable.io](https://fable.io/) | |\n| | | | |\n| --- | --- | --- |\n|  | | [MichaelArnaldi](https://news.ycombinator.com/user?id=MichaelArnaldi) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41799559) \\| [parent](https://news.ycombinator.com/item?id=41791316#41798387) \\| [next](https://news.ycombinator.com/item?id=41791316#41803900)\\[–\\]<br>[https://effect.website/docs/other/myths#effect-should-be-a-l...](https://effect.website/docs/other/myths#effect-should-be-a-language-or-use-a-different-language) | |\n| | | | |\n| --- | --- | --- |\n|  | | [IshKebab](https://news.ycombinator.com/user?id=IshKebab) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41803900) \\| [parent](https://news.ycombinator.com/item?id=41791316#41798387) \\| [prev](https://news.ycombinator.com/item?id=41791316#41799559) \\| [next](https://news.ycombinator.com/item?id=41791316#41799379)\\[–\\]<br>I've tried compile-to-JS languages before but their big weaknesses are:<br>1\\. Debugging can become quite a pain. Nobody likes debugging generated code.<br>2\\. You don't get to use libraries and tools from the _enormous_ JavaScript ecosystem.<br>3\\. Eventually you'll find some web feature that they haven't wrapped in your language and then you're in for FFI pain.<br>In the end I found Typescript was good enough that it wasn't worth dealing with those issues. | |\n| | | | |\n| --- | --- | --- |\n|  | | [williamcotton](https://news.ycombinator.com/user?id=williamcotton) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41804576) \\| [root](https://news.ycombinator.com/item?id=41791316#41798387) \\| [parent](https://news.ycombinator.com/item?id=41791316#41803900) \\| [next](https://news.ycombinator.com/item?id=41791316#41799379)\\[–\\]<br>Fable is still very much integrated with the runtime so there’s an expectation to handle those bullet points with inline annotations.<br>You can build an entire application in F# and compile to JS but another option is compiling to TS and calling that F# code from your TS app. I/O and views and whatnot are written in TS and the domain model is in F#. The entire model could be nothing but pure functions and resolve to a single expression! | |\n| | | | |\n| --- | --- | --- |\n|  | | [steve\\_adams\\_86](https://news.ycombinator.com/user?id=steve_adams_86) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41799379) \\| [parent](https://news.ycombinator.com/item?id=41791316#41798387) \\| [prev](https://news.ycombinator.com/item?id=41791316#41803900) \\| [next](https://news.ycombinator.com/item?id=41791316#41793804)\\[–\\]<br>This is so cool! I’ll have to try it out soon. Thanks! | |\n| | | | |\n| --- | --- | --- |\n|  | | [Aeolun](https://news.ycombinator.com/user?id=Aeolun) [on Oct 9, 2024](https://news.ycombinator.com/item?id=41793804) \\| [prev](https://news.ycombinator.com/item?id=41791316#41798387) \\| [next](https://news.ycombinator.com/item?id=41791316#41797391)\\[–\\]<br>I like the functionality, but the verbosity of the API makes me want to immediately ignore it. I feel like zod nailed the usability part. | |\n| | | | |\n| --- | --- | --- |\n|  | | [epolanski](https://news.ycombinator.com/user?id=epolanski) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41794421) \\| [parent](https://news.ycombinator.com/item?id=41791316#41793804) \\| [next](https://news.ycombinator.com/item?id=41791316#41797391)\\[–\\]<br>Schema is a much powerful tool than Zod. Zod is merely a parser, while Schema has a decoder/encoder architecture. | |\n| | | | |\n| --- | --- | --- |\n|  | | [skrebbel](https://news.ycombinator.com/user?id=skrebbel) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41797391) \\| [prev](https://news.ycombinator.com/item?id=41791316#41793804) \\| [next](https://news.ycombinator.com/item?id=41791316#41795090)\\[–\\]<br>Like Java, you can write Haskell in any language but that doesn't mean it's always a good idea. | |\n| | | | |\n| --- | --- | --- |\n|  | | [MichaelArnaldi](https://news.ycombinator.com/user?id=MichaelArnaldi) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41799599) \\| [parent](https://news.ycombinator.com/item?id=41791316#41797391) \\| [next](https://news.ycombinator.com/item?id=41791316#41795090)\\[–\\]<br>Which is why our principle with Effect is NOT to port Haskell. For example we don't use Typeclasses which are big in haskell, we lean heavily on variance which is not in Haskell. It's an ecosystem though to write production-grade TypeScript, not Haskell in TypeScript | |\n| | | | |\n| --- | --- | --- |\n|  | | [seer](https://news.ycombinator.com/user?id=seer) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41795090) \\| [prev](https://news.ycombinator.com/item?id=41791316#41797391) \\| [next](https://news.ycombinator.com/item?id=41791316#41807665)\\[–\\]<br>I’d love to hear more stories of people using Effect in production codebases.<br>It looks very similar in its ideas to fp-ts (in the “let’s bring monads, algebraic types etc to typescript” sense).<br>But I did hear from teams that embraced fp-ts that things kinda ground to a halt for them. And those were category theory enthusiasts that were very good scala devs so I’m sure they knew what they were doing with fp-ts.<br>What happened was that the typescript compile time just shot into minutes, for a moderately sized micro-service, without anything externally heavy being introduced like you could on the frontend.<br>It just turned out that Typescript compiler was not so great at tracking all the inferred types throughout the codebase.<br>So wonder if things have improved or effect uses types more intelligently so that this is not an issue. | |\n| | | | |\n| --- | --- | --- |\n|  | | [golergka](https://news.ycombinator.com/user?id=golergka) [on Oct 10, 2024](https://news.ycombinator.com/item?id=41797552) \\| [parent](https://news.ycombinator.com/item?id=41791316#41795090) \\| [next](https://news.ycombinator.com/item?id=41791316#41807665)\\[–\\]<br>\\> It looks very similar in its ideas to fp-ts (in the “let’s bring monads, algebraic types etc to typescript” sense).<br>It's the next version of fp-ts, developed by the same people, AFAIK | |\n| | | | |\n| --- | --- | --- |\n|  | | [aswerty](https://news.ycombinator.com/user?id=aswerty) [on Oct 11, 2024](https://news.ycombinator.com/item?id=41807665) \\| [prev](https://news.ycombinator.com/item?id=41791316#41795090)\\[–\\]<br>Effect reminds me more of something like NestJS - essentially an end to end application framework that takes over your whole application.<br>Rather disappoint to see something like this being plugged as an alternative to something like zod which is a nice library that stays in its corner and has a nice fixed scope to it's functionality. | | |\n| \n\n| |\n| --- |\n| |\n\n[Guidelines](https://news.ycombinator.com/newsguidelines.html) \\| [FAQ](https://news.ycombinator.com/newsfaq.html) \\| [Lists](https://news.ycombinator.com/lists) \\| [API](https://github.com/HackerNews/API) \\| [Security](https://news.ycombinator.com/security.html) \\| [Legal](https://www.ycombinator.com/legal/) \\| [Apply to YC](https://www.ycombinator.com/apply/) \\| [Contact](mailto:hn@ycombinator.com)\n\nSearch: |","metadata":{"referrer":"origin","title":"I love Zod, but recently I've been converting to Effect's Data and Schema module... | Hacker News","language":"en","viewport":"width=device-width, initial-scale=1.0","favicon":"https://news.ycombinator.com/y18.svg","scrapeId":"019d3953-7d92-73ea-8ecb-7c527e1ad46a","sourceURL":"https://news.ycombinator.com/item?id=41791316","url":"https://news.ycombinator.com/item?id=41791316","statusCode":200,"contentType":"text/html; charset=utf-8","timezone":"America/New_York","proxyUsed":"basic","cacheState":"miss","indexId":"01185769-ebb3-45ad-8e29-eab6dd349ec5","creditsUsed":1}}]}} |