Zod + Generics is HEAVEN

preview_player
Показать описание
Using Zod as the source of your types is extremely productive. With a couple of simple generics, you can power amazingly powerful abstractions with minimal type annotations.

Become a TypeScript Wizard with Matt's free TypeScript tutorials:

Follow Matt on Twitter

0:00 What is Zod?
0:47 Building a form library
2:23 Building a REST API
4:10 Summary
Рекомендации по теме
Комментарии
Автор

hey, your content is very informative, I think it could be even better if you had smooth transitions to where you add lines of code, since it may be a bit hard to follow when you’re jumping between different lines

erlendryan
Автор

Hey, Matt. Great vid as always! But yeah, it was a little hard to follow with all those sudden transitions and jumps around the code. If those could be a little smoother, this video would be an absolute banger!

Really love your videos - they’ve helped me massively improve my own development and understanding of TS. Leaving this comment as a fan of your content who just wants to see you put the best stuff out there.

rishiraj_dhar
Автор

Hi! This is hopefuly a constructive critic since I like the channel. This video editing style of removing spaces and silences may work for content such as Fireship's, which are mainly small snippets of info/jokes, but (for me at least) don't work for long code explanation like yours; pauses matter, they give emphasis and structure to speech. Keep up the good work!

aleserantes
Автор

One suggestion is to slow it down alittle bit. I don’t mind the fast pace, but as others pointed out, it’s just too hard to follow the code with many camera jumps. Thanks for the content, I’m getting up to speed with typescript and I feel like your content has helped the most.

wickedjutto
Автор

This is great information, but its really hard to follow. The pacing is too fast and the jump cuts to different parts of the code make my head spin 😅

eternallueforever
Автор

Agree with previous comments that although those videos aim to be as condensed as possible, at this point, it's really hard to focus watching them.
With so many jump cuts, it's very hard to keep track where in the codebase you currently are, as eyes need few seconds to figure it out.
Maybe you could experiment more with typing instead of copy/pasting, and scrolling, rather than jumping between sections?

kamilogorek
Автор

TypeScript guys are finally moving towards Rust's serde which existed for years and provides more typesafety than TS+zod can ever have.

TheTmLev
Автор

To fest transition hard to to keep up and a little bit annoying. That how I feel when watching this video. Love your content because of this give a comment hope that help.

barelmishal
Автор

I can't believe how many videos of yours I've gone through in the last few days because you manage to distill so much information into 4-minute videos. I've been looking for reasons why Zod will solve some problems for us and this has sold me.

JulianColeman
Автор

Nice timing, Astro 2.0 came out yesterday with one of the biggest new features being Markdown frontmatter validation using Zod.

tomasznocon
Автор

Hey Mat! Amazing video content, one thing that I could suggest is to zoom-out a little when showing code, I personally find a bit hard to follow when the code is too large like this.
Amazing content nonetheless!

rychardvale
Автор

Zod is now at the center of a project I've been working on. I use a single schema to validate form inputs, database writes, requests from the browser, and to apply types going back to the browser responding to requests!

One question... Zod has a .describe() method that only accepts strings. I've been using it to add data dictionary descriptions so I know the purpose of a particular field in the database. I'd love for it to accept objects so I could add things like: {
dictionary: "Address line 1,
formInputLabel: "Address 1",
formInputId: "address1",
formInputPlaceholder: "Enter your address",
formInputHelperText: "<some other helper text for fields that need it>"
}

The use case is simply that I could identify a single source for these things as part of the original schema. So, for example, if I have a new user form and and edit user form, and I want to change any of these items, I could change it in one spot and have it update across the forms.

At runtime, nothing stops this, but Zod throws type errors in the editor if you add an object into the .describe() method. Any ideas on how this could be extended without updating the core library?

pupfriend
Автор

Zod is absolutely amazing, since you start using it, you never want to stop

DanielRios
Автор

Don't change a thing, these are amazing.

MrCrooot
Автор

Hey Matt, are you trying to do a lot like Fireship? Dont get me wrong his videos are great, but I think your content had a different format which in many ways I found that it suit best your approach. But hey, keep rocking and experimenting if that's whats happening. I am glad and thankful you are doing all this effort in making great content. Cheers

hugodsa
Автор

it's so hard to get what's going on with all the sudden transitions. Love the way you explain though, keep up the good work

Oussama-uogf
Автор

Lol, okay I feel a bit better seeing others not being able to follow along, I'll have to watch this a few times to grasp it...I felt like I had it on 1.5x anyway, I wouldn't change too much, I like all your videos

matthewbeardsley
Автор

Help! There are pieces of my mind everywhere, after that bombastic tip.

bemgcmk
Автор

It would be great if you provide a link to the source code as Jack Herrington does

andrewblotski
Автор

Faster than Flash,
informative but I have no idea what went where. Blazing Fast Tips indeed

lsagar