Це відео не доступне.
Перепрошуємо.
Catch Type Errors at Runtime with Zod: An Intro to this JavaScript Library
Вставка
- Опубліковано 5 сер 2024
- Zod is a runtime type checking library for JavaScript that can help you catch type errors before they cause problems in your code. In this tutorial, you'll learn how to use Zod to define strict schemas for your data and ensure that your variables always have the correct type at runtime. By following best practices for type safety, you can write more reliable and maintainable code.
This tutorial covers the primary use case of Zod and some of the cool helper methods it has. By the end of the video, you'll have an understanding of how to start integrating it into your project and why it is growing in popularity.
🐱 Repository for code in the video:
github.com/Jimmydalecleveland...
~~~~~~
00:00 - What is Zod and why is it gaining popularity?
01:12 - Repo starting point quick walkthrough
02:51 - Standard ways to Type a fetch result
05:23 - Adding Zod to get runtime type checking
08:33 - Zod parsed results error output
10:03 - Fixing the error with Zod enforced actual fetch response
11:51 - Zod validation methods
15:08 - Transforming returned data with Zod
16:35 - Wrap-up and thoughts
~~~~~~
Follow Jimmy Cleveland's doings:
twitter: / jimmydcleveland
blog: blog.jimmydc.com/
#typescript #zod
Very nicely explained.☺️☺️☺️☺️
Just to be clearer for the beginners, the Person at 8:15 is not a type, it's schema. Although I know people sometimes call both types informally speaking. Nice tutorial, thanks.
That seems really cool and useful. Thanks for the introduction.
good to see you're back
Thank you, it has been a good while. Had a crazy year, but I'm making an effort to get back to making videos consistently.
clean, enough and precise.
Thanks.
Thanks man.
the only thing I really cared about was gh pr status when I found out about the cli. didn't even know about that docs page.
Awesome. I think you might have commented on the wrong video, though.
@@SwashbucklingwithCode Wow I don't even know how that happened 😂
Thank you for the great tutorial video.
You are awesome
Love the video. Keep up good work!
Thank you.
I was waiting for this video since you created the repo yesterday
Nice, I am always curious who is watching out for those sneak peaks.
Super cool man, I really like your content. Honestly surprised you don't have 10x subs yet
Thank you, kindly. I am working on getting back to consistent creation this year so we'll see what happens.
Arktype is great too
Great content! and your voice sounds extremely good - do you mind sharing your recording setup?
Thanks, that's always nice to hear because I've put countless hours into my audio setup.
On this video I have a Shure SM7b, running into a cloudlifter, into a dbx 286s pre-amp, into the focusrite scarlett 2i2 which goes to the computer.
I use OBS to record, but I also use Screenflow at times.
@11:30 - So if I had data coming in and I made a schema and typed it, but then wanted to use that data in a UI component that showed a cut-down version I could created a different schema, parse the data, and it would transform it and check it at the same time? that's pretty cool
I heard you saying "no-demon" instead of "node-mon" or "node-monitor" and now I can't unlisten it 😂
indeed. github.com/remy/nodemon/blob/master/README.md#pronunciation
@@SwashbucklingwithCode I wasn't being offensive, it was just funny. I like your content, keep it up
@@mohammedabdelgawad4176 No worries, I didn't take it that way. I was just raising awareness that it is a very common debate.
I actually used to pronounce it `node-mon`, and have heard the node-monitor argument. But you should check out the logo of the package and look up `daemon` if you aren't familiar with the term.
long time no see?
Indeed.
Wow, great help. Thanks.
But what about MultiLanguage Apps ? (users can change the language of my App at runtime via a "language switcher... I'm using vue-i18n)
At a certain moment, you're giving the hardcoded message 'films must be an array of valid strings' .
In other words.... How can I make this "dynamic", based on the language my user has seletec in my app ?
Any help or hint would be appreciated (a demo vid would even be better :) )
Thanks in advance.
Please send this to DHH lol
Thank you patrick bateman!!!