КОМЕНТАРІ •

  • @TomDoesTech
    @TomDoesTech Рік тому +203

    My favourite feature of Zod is that it, by default (configurable), will remove fields from an object that aren't defined in the schema. So it makes it safe to pass a parsed object straight into your DB without having to pick or omit fields.

    • @semyaza555
      @semyaza555 Рік тому +14

      How tf did I not know that.

    • @GiveMeSomeMeshuggah
      @GiveMeSomeMeshuggah Рік тому +15

      Or, on the flip side, you can use it to validate partial database records so that the don’t include sensitive columns and send them straight to an end user

    • @belkocik
      @belkocik Рік тому

      @TomDoesTech would love to see that in your upcoming video :D

    • @rand0mtv660
      @rand0mtv660 Рік тому

      @@GiveMeSomeMeshuggah wouldn't it make more sense to not query that data from the database in the first place? If you already know you cannot show it, why even query it? Or maybe I'm misunderstanding something.

    • @TomDoesTech
      @TomDoesTech Рік тому

      @@GiveMeSomeMeshuggah that is brilliant!

  • @jeremykothe2847
    @jeremykothe2847 Рік тому +204

    I love you, dude, but why the recent clickbait storm?

    • @ApexJnr
      @ApexJnr Рік тому +40

      bills

    • @jaydeep-p
      @jaydeep-p Рік тому +83

      Recent? Lol clickbait is the foundation of this channel

    • @tavin136
      @tavin136 Рік тому +15

      Not so sure if it is really a clickbait, because zod validates values at runtime while giving you the type safety typescript provides, and the later can only enforce type safety at compile time. So he is right imo.

    • @TheJobCompany
      @TheJobCompany Рік тому +2

      marketing

    • @jeremykothe2847
      @jeremykothe2847 Рік тому +4

      @@tavin136 nothing in the title mentioned zod, nothing in the thumbnail hinted at it. It was "TS BAD!?" click to find out more. Theo loves TS, and the answer was "NO IT ISN"T", so it was the classic bait and switch. If anything you mentioned was hinted at, I'd have watched and enjoyed.

  • @ricardomonge2769
    @ricardomonge2769 Рік тому

    Thanks for this kind of content. Really useful!

  • @PhilipAlexanderHassialis
    @PhilipAlexanderHassialis Рік тому +3

    Excellent video. Zod is a masterpiece in engineering. Also now that you mentioned react-hook-form, give some love to react-ts-form - you 'll like what you see, I am sure.
    P.S. isn't it about to get a clapperboard or somehow introduce the functionality through e.g. hand clapping? The audio isn't entirely synced, at least on my end :S

  • @KarlOlofsson
    @KarlOlofsson Рік тому +1

    This is pretty commonplace if you do automated quality control. Strong typing, validation libraries and test tools for business logic go hand-in-hand 😋

  • @Leto2ndAtreides
    @Leto2ndAtreides Рік тому +2

    It's nice having someone share this information - because I hadn't bothered looking for these solutions when I built my own.
    Will be useful on future projects (or existing - depends on spare time)
    👍

  • @tellyisko6908
    @tellyisko6908 Рік тому +3

    Hey Theo can you make a video for a list of libraries that you always use most of the time in a project. I didn't know a lot of libraries until I got employed with an existing code base. I wish I knew how to use those when I was learning to get things better.

  • @rand0mtv660
    @rand0mtv660 Рік тому +17

    What I like about these validators like Yup and Zod is the way schema is written. It's so easy to read and understand what the schema represents or expects. Also, creating a type from that schema is a super powerful thing. You can just infer type of that schema and use that with useForm() from react-hook-form. Working with forms has never been so nice until I started combining react-hook-form with one of these validator libraries. It also allows developers with less experience to build consistent form experiences.
    I personally use Yup just because in few instances of validating stuff in frontend forms it just had the ability to add better custom error messages and I could validate enums more easily. For example I get a user role enum type from backend and I loop over that enum to create options for a select dropdown, so that when a new user is created, you can pick a role to assign to it. Using Yup, I can easily validate that role selected is one of expected roles from that enum. Yup just handled these few scenarios in a nicer way and when I compared it to Zod. Zod just couldn't do some of these without too much ridiculous code or not even do something at all, but it's a library that I'll definitely re-evaluate frequently. Since I write frontend only, I really don't need Zod for more complex validations that I might do on backend.

    • @binaakene7942
      @binaakene7942 Рік тому

      Was about to even ask what the difference between this and yup is. Seems exactly like what yup has been doing for a while but it’s getting so much hype

    • @Microphunktv-jb3kj
      @Microphunktv-jb3kj Рік тому

      prisma+tRPC+zod is pretty nice combo :D

    • @jlf_
      @jlf_ Рік тому

      yup without strict() is useless and actually was a problem for me. It actually accepts array of strings if you have a .string()

    • @butterfly7562
      @butterfly7562 Рік тому

      I also use yup because zod produces some strange type errors

  • @karixening
    @karixening Рік тому +5

    if (typeof unknown !== 'object' || unknown === null || !('username' in unknown) || typeof unknown.username !== 'string' ....)
    is how you go from unknown to an object using type narrowing.

    • @DubiousNachos
      @DubiousNachos Рік тому +1

      That "typeof unknown === null" would just be "unknown === null". The typeof operator always returns a string and doesn't have a null case.

    • @karixening
      @karixening Рік тому

      @@DubiousNachos oh yeah, you're right. That was a typo.

  • @vellysongsremix8463
    @vellysongsremix8463 Рік тому +1

    We've come full circle! Need to bring a statically typed language for web haha

  • @ClaudioBrogliato
    @ClaudioBrogliato Рік тому +3

    This is very interesting, if you couple it with a code generator tool that generates models starting from a self documented api (e.g. swagger) that'd make a nice stack.

  • @codeChuck
    @codeChuck 5 місяців тому

    Tried to use zod in Express backend ~9m ago. Very useful! It helps to reliably deliver backend workloads to a react frontend (admin panel with product listings).

  • @Vietnamkid1993
    @Vietnamkid1993 Рік тому

    Great video, looking forward to add it to my tool belt

  • @ofmouseandman1316
    @ofmouseandman1316 Рік тому +6

    I feel Zod is the exact opposite philosophy of Reflect MetaData: Make Code generate TypeSafety... wherhas Reflect metadata uses Types to be used as code.... after understing that I feel that ORMs such as TypeOrm who uses it only try to "hack" TS for a purpose that it is not made to, and moved to Prisma. But, after thinkering a bit with Zod I feel it could be the starting point of a nice ORM

  • @ivokovacevic5221
    @ivokovacevic5221 Рік тому +3

    Last time I checked, Zod had big performance issues. I hope they solved that. It might be worth giving Zod another chance

  • @RyanTipps
    @RyanTipps Рік тому +1

    Colin explains on his blog why Yup's type inferences are wrong - biggest issue is that "the yup package treats all object properties as optional by default. Yet the inferred type indicates that all properties are required. 😕"

  • @NeilTheFisher
    @NeilTheFisher Рік тому +3

    You can actually make typescript "run" if you use something like typia, which validates json against your typescript types.
    Getting it working with tRPC is a little tedious though since it's geared towards zod so much

  • @davealma88
    @davealma88 10 місяців тому

    Great video, it help me to know how zod works!!

  • @shivamjhaa
    @shivamjhaa Рік тому

    Damn... your thumbnail game is on next level 🤟

  • @seannewell397
    @seannewell397 Рік тому +8

    First 3 seconds = 1 like. Zod is always worth a like. A thousand likes.
    But your face, your hair, your presence theo - priceless.

  • @polynoise
    @polynoise Рік тому

    Added to my project now :) thanks!

  • @alexandervashchuk7795
    @alexandervashchuk7795 4 місяці тому

    thanks for the video!

  • @hrahman3123
    @hrahman3123 Рік тому +1

    This oddly feels like yup. Haven’t dug into the differences but that’s my thought when I saw Zod for the first time

    • @Novagenesis
      @Novagenesis Рік тому

      Zod has better type-inference than Yup last I looked. Otherwise, not a lot of differences. Both are great libraries. I LOVE Zod's type-inference, though.
      One thing I hated about Typescript was having to build types AND validators against my interfaces, and knowing that if they fell out of sync all hell could break loose. Zod solves that.

  • @nexxel
    @nexxel Рік тому +3

    Parse, don't validate!

  • @BigluisVargas
    @BigluisVargas 5 місяців тому

    The one for typescript is class-validator. By itself typescript does not validate the objects at runtime

  • @Kairos26
    @Kairos26 Рік тому

    damn
    u makin me hyped to learn this

  • @Wielorybkek
    @Wielorybkek 7 місяців тому

    great explanation!

  • @SeraphicRav
    @SeraphicRav Рік тому +2

    What about sinclair/Typebox? It is 5 times more downloaded than Zod people are talking about, 2 times more than Joi that I am using but lack type inferring.

    • @Novagenesis
      @Novagenesis Рік тому +1

      Sinclair keeps bugging people in reddit to swap to typebox, but he got really whiny at me and deleted a bunch of his comments when I tried to discuss it with him. That genuinely concerns me about the long-term life of the library because that kind of behavior has been a predictor of project-abandonment in the past. A lot of people have mentioned that typebox's download-count is artificially large because it is in a common `jest` dependency and jest stacks are downloaded automatically a LOT... so I don't know if I'd say typebox is anywhere near as stable/big as Zod yet. Of course, Zod is pretty small, too, compared to ajv.
      Flip-side, typebox has 22 contributors last I looked. Far fewer than zod, but "not 1 or 2". I think if the library felt less like OSS marketing hype and had trpc integration (or documented trpc integration), I would consider trying it out.

  • @dixztube
    @dixztube Рік тому

    Nobody, I mean nobody does the typescript better than me. I mean nobody.

  • @animanaut
    @animanaut Рік тому

    there is a cocept called "make illegal states unrepresentable” comming from functional languages like fsharp/haskell/scala using the type system. not sure if that is applicable for ts/js, but i would like to hear your opinion on it.

  • @chawkichalladia1812
    @chawkichalladia1812 Рік тому

    I never used zod, but I used yup a long time ago. if my memory is not failing me, didn't yup do the same things?

  • @MysterKnajt
    @MysterKnajt Рік тому

    Is there a need to use ZOD for graphql response and rest-api response?
    Personally i think there is no need for graphql, but for rest-api it's considerable, because the response could not be validated on BE side. WDYT?

    • @colinmcd94
      @colinmcd94 Рік тому

      Nope graphQL frameworks will do all your runtime validation for you typically.

  • @lacherolachero9409
    @lacherolachero9409 Рік тому

    You mentioned, it gives the ability to write a validator one time in one place to validate both frontend and backend, how would you implement it in a monolith contains backend with express and frontend built by (any), would you export validations to external npm package? or how would you structure the project

    • @VictorMainaKinuthia
      @VictorMainaKinuthia Рік тому

      Since your app is a monolith, both the backend and the front end are in the same code base. I guess all you’d have to do is import the validator in both files, and let SSR do its thing. Could be wrong, though.

  • @danbizirean4196
    @danbizirean4196 Рік тому

    Inference part iz amazing.

  • @SimonCoulton
    @SimonCoulton Рік тому

    Yup was a game changer. Zod is even better.

  • @GabrielMartinez-ez9ue
    @GabrielMartinez-ez9ue Рік тому +4

    If you were to start TS again, how would you migrate a JS project to a TS? I am looking into migrating mine to TS and start learning on the go.

    • @offroaders123
      @offroaders123 Рік тому +3

      I recently have been doing this with my projects, and I think I found a nice way to do it! I can make a demo example for you if this doesn't help explain it very well.
      First I add a tsconfig.json file to the root of my project. You can allow the TypeScript compiler to check your vanilla JavaScript files too, by setting both the `compilerOptions` properties `allowJS` and `checkJS` to true. This will start showing type errors for your code right in your editor, just like a full TypeScript file does.
      Then, you can go through each of your existing files, and add JSDoc type annotation comments, which are usable by the TypeScript compiler.
      Eventually, once you have all of your types specified using JSDoc, it is much easier to move the files over from `.js` to `.ts`, because your already took care of all the type errors. In your editor, it may give you an option to `infer types from JSDoc`, after your rename your files to `.ts`.
      This was a nice way for me to learn how to add type definitions before having to learn how the TypeScript syntax works, as the two are kind of separate steps in my mind.
      There may be some confusing parts to work out along the way, but this has seemed to work very well for my own codebases. Hopefully this helped at least a little bit!
      Here's some resources that I found to help me find this out:
      www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html
      www.mobiquity.com/insights/typescript-to-javascript-with-jsdoc-and-back

    • @GabrielMartinez-ez9ue
      @GabrielMartinez-ez9ue Рік тому +2

      @@offroaders123 WOW... THANKS A LOT. You have been an incredible help. Wish more people would respond that detailed to messages! 😃😁

    • @offroaders123
      @offroaders123 Рік тому

      @@GabrielMartinez-ez9ue So glad I could help! I was worried that was too long too, haha.

  • @blue_name_warrior
    @blue_name_warrior 3 місяці тому

    This turns out to be a copilot ad lol

  • @luissolanodev
    @luissolanodev Рік тому

    Great video! I'm curious on why you say we hopefully won't need zod for validating external APIs though

    • @tini_
      @tini_ Рік тому +1

      I think it is meant to say, "hopefully you won't need to validate an external API" (regardless of with zod or somehow else) since a good API would not randomly change the schema returned and break your client. They should more likely version the API if necessary.

  • @MarioLopez-eu8tj
    @MarioLopez-eu8tj Рік тому

    Let's get that platinum youtube button.

  • @alexnovikov1609
    @alexnovikov1609 Рік тому

    Thanks!

  • @iGaMeProDZ
    @iGaMeProDZ Рік тому

    Hey, I have a question, is the T3 stack SEO friendly? also is it good for medium to big app?

  • @JB-fh1bb
    @JB-fh1bb Рік тому

    I really need to see the results of running the code to understand it. The lack of it killed this vid for me.

  • @xReDxTuRtLeZx
    @xReDxTuRtLeZx Рік тому +1

    interesting vid theo. does it matter how many libraries we use, as long as they are useful? my college professor told us to reinvent the wheel every time because "libraries are inefficient for what you need" but i feel like that makes no sense because libraries are meant to help...

    • @AkosLukacs42
      @AkosLukacs42 Рік тому +1

      Your professor might have a bit of "not invented here" syndrome.
      On a more serious note: any library you use, and any code you write is a liability. You must use your judgement to decide between writing it yourself, or choosing a library.

  • @denislukashevich5486
    @denislukashevich5486 Рік тому

    It'd be very nice to show exact flows of Yup before just throwing it to the bin :) Especially since there already was one video about Zod (general deserves it though)

    • @ivanpartida7467
      @ivanpartida7467 Рік тому

      Read Colin's essay about the designing of Zod, there he mentions Yup's type inference is wrong.

  • @kristijanvidovic8986
    @kristijanvidovic8986 Рік тому

    Which VS Code theme is this, can somebody tell me please?

  • @jii808
    @jii808 Рік тому

    Are you mostly using zod for user input and in API routes to check incoming body data?

  • @chaczyk113
    @chaczyk113 Рік тому

    I don't know... Maybe for some backend object definitions Zod might be fine, but on Front for forms validation, Yup is way more better! Zod is really pain in the ass for validating complex forms, whre yup has some handy features.

  • @luctielen
    @luctielen Рік тому

    Zod is amazing!
    But don't look at the source if you want to sleep at night 😅

  • @the-old-channel
    @the-old-channel Рік тому +8

    Hot take: superstruct is superior to Zod. You should seriously consider it when choosing a validation library. It is first class supported by tRPC, has awesome TS experience and more extensible design paradigm (composition instead of fluent). It also has a smaller bundle size than Zod and runs faster.

  • @Michael-Martell
    @Michael-Martell Рік тому

    So, Zod is used in addition to a typescript setup, or does it replace the necessity of Typescript in a project?

  • @dev__adi
    @dev__adi Рік тому +1

    let me guess, it's about zod

  • @Disorrder
    @Disorrder Рік тому

    It's not in scope of responsibility of TS to check string's length or validate as email. There is also class-validator doing same thing btw.
    Typed languages only validate types, not values!

    • @benscherer7256
      @benscherer7256 Рік тому

      Ts also can’t validate incoming unknown data at runtime.
      Zod does both validation and creates the ts types

  • @arturamorfati
    @arturamorfati Рік тому

    nice shirt, theo

  • @riolly
    @riolly Рік тому

    My stupid explanation would be.. (front end validation + backend validation) * simplicity = zod.

  • @aldrickdev
    @aldrickdev Рік тому

    Reminds me of Pydantic for Python

  • @Alex-uf2ie
    @Alex-uf2ie Рік тому +2

    5:07 demontized

  • @jamessunderland9284
    @jamessunderland9284 Рік тому +3

    Fellow YC alum here. Gotta respectfully disagree with you. Runtime type checking is a recipe for disaster. I got my first post Mortem at Airbnb for someone thinking this was a good idea (visa vi an internal ruby gem). 500s do not benefit users! Data validation is a good idea, but is not the same thing as type checking. One of the biggest benefits of isomorphic typed systems is that in theory type validation becomes unnecessary at runtime (even for rpc and http calls). Confusing data validation and type safety is one of the biggest confusions I notice in junior and mid level engineers using typescript these days.

    • @t3dotgg
      @t3dotgg Рік тому

      I've seen devs confusing this maybe twice ever but i'll keep an eye out for it

    • @Novagenesis
      @Novagenesis Рік тому +2

      This is a weird mirror-image take to my own.
      I hated on Typescript *because* people confused data validation with type safety. Type safety serves no purpose for your external interfaces or any interfaces that might go out of sync.
      Because of that, I used to prefer javascript with runtime type checking. That's sorta the "classic" way. You're not wrong that 500s don't benefit users, but it's still usually better than processing a bad request as if it were a good one. It's a balance, and something like Zod can be implemented to be as flexible as you can allow (only validating the pieces you need) if that is a real concern. But then, in my almost-20-years in the industry, I've never touched an API that was allowed to reach prod without some sort of runtime type checking.
      The reason I like zod as a Runtime type-checker is because of its compile-time inferences. Some of your "500" situations could actually get caught by the typescript compiler.

  • @vidigitusmarketing862
    @vidigitusmarketing862 Рік тому +1

    Zod is great!
    Why do I have the impression that Javascript it's all about typing now? Since Typescript came in, all the Javascript's biggest concerns is suddently typing. Anyway, I still think Typescript makes a lot of sence and packages like Zod and Trpc are also essencial for the industry.

    • @snehanshuphukon728
      @snehanshuphukon728 Рік тому

      JavaScript is a powerful language. Typescript makes it safe and fun to use. So it being all about typing is a good thing in my opinion.

    • @ABC-ip6jq
      @ABC-ip6jq Рік тому

      @@snehanshuphukon728 I think Typescript sometimes gives people a false feeling of safety. As many people I come across mistake typescript running on execution. Also, a wrongly assumed/typed variable or function return is way more prone to lead to errors than the Javascript equivalent where you take for granted that you have to handle every type or data structure.
      However, if you don't enforce types and are aware of when and where it acts, Typescript is great.

    • @shrin210
      @shrin210 11 місяців тому

      ​@@snehanshuphukon728Is typescript really fun ? 🫤

  • @tentacle_sama3822
    @tentacle_sama3822 Рік тому

    sounds a lot like Dart

  • @ts8960
    @ts8960 Рік тому

    zod doesnt stop at the first error for each field and its a waste of performance

  • @yavko
    @yavko Рік тому +3

    I wrote my own validator that just uses the built in classes in js, and works fine for me

    • @EdJones99
      @EdJones99 Рік тому +4

      You should release it as an npm package

  • @Louisi9
    @Louisi9 Рік тому

    I personally prefer Yup, not really for any other reason than being able to use it with Formik natively.

    • @shrin210
      @shrin210 11 місяців тому

      You should probably start using react-hook-form first

  • @mcgruff0972
    @mcgruff0972 Рік тому +1

    Are we just reinventing C#/Java classes at this point?

    • @doc8527
      @doc8527 Рік тому

      nope, it's completely irrelevant to class, don't treat concept behind based on the syntax.
      it's more about static/dynamic and runtime/compile type checking inside or between application like frontend &backend.
      Though I felt the runtime check from zod or yup might have performance tradeoff. Just not sure how much it will cost.

  • @AditSharda
    @AditSharda Рік тому

    They should add this into TRPC without needing any extra line of code. Okay, maybe a flag to enable/disable it.

    • @TomDoesTech
      @TomDoesTech Рік тому

      What do you mean? You can use Zod schemas with tRPC natively

  • @cazterk
    @cazterk Рік тому

    what's the differebce with, "Yup?"

  • @EdJones99
    @EdJones99 Рік тому

    Zod is great, I'm surprised to see so many negative comments here.

  • @UwU-dx5hu
    @UwU-dx5hu 9 місяців тому

    Where is kal el?

  • @tigidou3344
    @tigidou3344 Рік тому

    Perso, I never found any utility from TS.

  • @bullettime2808
    @bullettime2808 Рік тому

    zod is great but it's slow af
    edit: I mean it makes Typescript slow so stuff like intellisense take a long time to popup

  • @Indigo00757
    @Indigo00757 Рік тому

    5:07 😂

  • @ocean3323
    @ocean3323 Рік тому

    Sounds like serde in rust, but serde is actually better

  • @brokebull
    @brokebull Рік тому

    Looks like yup with better npm trends as zod

  • @tornikebuchukuri4114
    @tornikebuchukuri4114 Рік тому

    what's the point of typescript if you're using a 3rd party library for typechecking? I get ts doesn't typecheck on runtime, which zod does but it just does not make any sense, it's just more logical to use a normal language with types rather than do this kind of crap.

  • @seannewell397
    @seannewell397 Рік тому

    Anyone else think SDKS / APIs/ other libs should ship with zod schemas to power their TS types? Too cumbersome?

    • @nazarshvets7501
      @nazarshvets7501 Рік тому

      No. A lots of BE frameworks have their own specification to providing public api. U cannot force them to do your job. Also it might be not TS Backend at all
      U should generate validators from OpenAPI Spec/GQL via codegen, or just manualy create them

    • @TomDoesTech
      @TomDoesTech Рік тому

      We do this for an internal SDK that publishes and consumes kafka messages. The schema is stored in the SDK and you can't publish a message for a specific topic if parsing throws.

  • @sitcomrave
    @sitcomrave Рік тому

    Isn't `ajv` and `typia` is better players in this field ?

  • @AtomicCodeX
    @AtomicCodeX Рік тому

    I do agree that typescript can be over kill
    But 2 videos ago you said typescript is good without the types, and it's not why you should use it, and now this 😂😂
    Just admit you have an agenda with JS
    Ps I fully agree I never use typescript as typescript, I just use it in the background, and if a data type needs to be that type, I use their types in production with packages like this.
    Especially before adding it to a database...
    I thought it was common sense though

    • @DubiousNachos
      @DubiousNachos Рік тому

      I think Theo's argument is that as a consumer of libraries and built-in APIs, you don't need the Typescript-specific syntax 90% of the time. The language server is just going to run for you in the background and catch the majority of issues with just type inference.
      And most of the time when you do need to add typing, it's to add definitions to "boundary types" that can't easily be inferred - function parameters, type parameters for things like maps/arrays, the return type of fetch.
      Compile-time type safety is the only thing you're shooting for - screwing around with the type layer and making all these convoluted types is fun, but isn't always needed to reach that goal.
      As usual, Theo is vocalizing his opinions in a really strong way that isn't really open to nuance. I think he's right that most developers can get away with TypeScript that mostly looks like JavaScript, but when you do need to make something really general-use that isn't available as a library, that knowledge of how to work with the type layer - how to treat it as a functional language in itself - is the only way to make things work without lying to the compiler.

  • @pegak
    @pegak Рік тому +2

    I am much bigger fan of fp-ts. Upcoming fp-ts/schema is even more breathtaking than Zod! What do you think of it? 😊

    • @SuperQuwertz
      @SuperQuwertz Рік тому

      I want to understand fp-ts but the docs- Q_Q

  • @MrJester831
    @MrJester831 Рік тому +4

    Real talk: this works even better in Rust

  • @zombizombi
    @zombizombi 9 місяців тому

    Javascript/Typescript are madness. When you need a library to ensure type safety... so glad I left web dev. I sometimes wonder if the only people who use javascript/typescript learned them as their first languages and just don't know any different.

  • @bashbunni
    @bashbunni Рік тому +5

    First, nerds

  • @jrgalyen
    @jrgalyen Рік тому

    So with zod, we have to duplicate typescript. Tremendous stupid. What is way cooler? ajv

  • @wesscat
    @wesscat Рік тому +2

    If want to assert every type in a dynamically typed language, then it's better to learn static languages.

    • @NathanHedglin
      @NathanHedglin Рік тому

      Exactly. JavaScript developers are terrible devs. 1,000 libraries just to fix JavaScript.

  • @elson_correia
    @elson_correia 10 місяців тому

    Crazy how people are shocked with TS now. Solutions like zod are just patches to things software engineers should already be checking but dont because they dont understand what TS is actually doing and trust it.
    TS is NOT a language, its a tool same level as a linter.
    You dont need zod. You need common sense and programming skills.

  • @AndyQuinteroM
    @AndyQuinteroM Рік тому +1

    Or..... use rust 🤓

    • @NathanHedglin
      @NathanHedglin Рік тому

      Or at least Purescript which is 100% type safe and compiles to JS, Go and C++

  • @nomadshiba
    @nomadshiba Рік тому

    zod isnt that great tbh

  • @putsstrat
    @putsstrat Рік тому

    well isnt yup doing the same thing !

    • @t3dotgg
      @t3dotgg Рік тому +4

      Watch like 45 more seconds and I directly mention this lmao

    • @putsstrat
      @putsstrat Рік тому

      @@t3dotgg i did xd

    • @praneshkmr
      @praneshkmr Рік тому

      I dont think we can do discriminated union with Yup

    • @TomDoesTech
      @TomDoesTech Рік тому +3

      Yup doesn't play nicely with TypeScript. You can infer types with Zod really easily and accurately. So if you have a function where the params are validated with Zod, you can infer the type from the schema so you have type checking for the dev and runtime validation.

    • @putsstrat
      @putsstrat Рік тому

      @@praneshkmr you can always make your own test utils to cover any variation of data type , schema , data consistency and/or dependencies using tests . That wasn't my point .

  • @kingt1tus
    @kingt1tus Рік тому

    schemawax is my favorite of these kind of libraries

  • @NathanHedglin
    @NathanHedglin Рік тому

    Purescript. There problem solved

  • @kirsanov2008
    @kirsanov2008 Рік тому

    I am absolutely sure that zod deserves $ alias in todays JS world like it used to be for jQuery

  • @mjerez6029
    @mjerez6029 Рік тому +1

    Please check deepkit. Thats another whole new level!

  • @berrodev
    @berrodev Рік тому

    I made a video about ZOD and viewers doesn’t seem to like this library (according my channel) 🥲

    • @TomDoesTech
      @TomDoesTech Рік тому

      I read the comments on your video and they are ummm, interesting. Great video btw