![Matt Pocock](/img/default-banner.jpg)
- 163
- 6 347 962
Matt Pocock
Приєднався 14 бер 2017
Become a TypeScript wizard with tips, tricks and tutorials. Plus, updates from the latest TypeScript releases (and other open source awesomeness).
TypeScript 5.5 is a BANGER
0:00 Intro
0:12 Regex Checking
1:08 ${configDir}
2:23 isolatedDeclarations
4:35 My book!
5:33 Type Predicate Inference
8:17 Final Stuff
Sign up to learn more about my upcoming book:
www.totaltypescript.com/newsletter
Follow Matt on Twitter
mattpocockuk
Join the Discord:
mattpocock.com/discord
0:12 Regex Checking
1:08 ${configDir}
2:23 isolatedDeclarations
4:35 My book!
5:33 Type Predicate Inference
8:17 Final Stuff
Sign up to learn more about my upcoming book:
www.totaltypescript.com/newsletter
Follow Matt on Twitter
mattpocockuk
Join the Discord:
mattpocock.com/discord
Переглядів: 60 363
Відео
My "as few deps as possible" monorepo setup
Переглядів 32 тис.Місяць тому
Become a TypeScript Wizard with my free beginners TypeScript Course: www.totaltypescript.com/tutorials/beginners-typescript Follow Matt on Twitter mattpocockuk Join the Discord: mattpocock.com/discord
Everyone's talking about gql.tada
Переглядів 43 тис.4 місяці тому
00:00 Magical Inference 00:57 Language Server 02:16 gql.tada 03:34 TypeScript Performance Docs: github.com/0no-co/gql.tada Phil's Tweet: _philpl/status/1748084361939886437 My book: github.com/total-typescript/total-typescript-book Become a TypeScript Wizard with my free beginners TypeScript Course: www.totaltypescript.com/tutorials/beginners-typescript Follow Matt on Twitter twitter...
8 TypeScript Tips To Expand Your Mind (and improve your code)
Переглядів 78 тис.5 місяців тому
8 TypeScript Tips To Expand Your Mind (and improve your code)
Most React devs don’t understand generic components
Переглядів 47 тис.5 місяців тому
Most React devs don’t understand generic components
Most TS devs don't understand 'satisfies'
Переглядів 54 тис.6 місяців тому
Most TS devs don't understand 'satisfies'
TypeScript 5.3 is a no-brainer upgrade
Переглядів 87 тис.7 місяців тому
TypeScript 5.3 is a no-brainer upgrade
Rethink your life choices before you do this...
Переглядів 29 тис.8 місяців тому
Rethink your life choices before you do this...
Import vs Require: The Biggest JavaScript Divide
Переглядів 50 тис.9 місяців тому
Import vs Require: The Biggest JavaScript Divide
Dynamic objects should NOT be this hard
Переглядів 37 тис.10 місяців тому
Dynamic objects should NOT be this hard
as const: the most underrated TypeScript feature
Переглядів 113 тис.10 місяців тому
as const: the most underrated TypeScript feature
The empty object is TypeScript's weirdest type
Переглядів 26 тис.11 місяців тому
The empty object is TypeScript's weirdest type
Don't put your types in .d.ts files
Переглядів 130 тис.11 місяців тому
Don't put your types in .d.ts files
TypeScript just unblocked React Server Components
Переглядів 32 тис.Рік тому
TypeScript just unblocked React Server Components
Should you still be using Redux in 2023?
Переглядів 52 тис.Рік тому
Should you still be using Redux in 2023?
Dan Abramov asked me to help fix React
Переглядів 33 тис.Рік тому
Dan Abramov asked me to help fix React
Codegen: The good, the bad and the ugly
Переглядів 30 тис.Рік тому
Codegen: The good, the bad and the ugly
very very thanks for this video.really helpful
that safe zod fetch was amazing! i use zod all the time, but i usually do the parsing manually after a fetch with schemas I have declared in a schemas.ts file
would really appreciate if you could make a generic small course of 10 exercises.
Come on, man! Truthiness doesn't work for the type inference because 0 while being a number is still considered false, so !!member makes no distinction between 0 and null.
With JSX.Element can we do something like JSX.Element<SpecificComponent> to only allow specific react components?
No, and you can't do that with ReactElement either. It just seems like you can, but it doesn't work.
If your large code base has js files that are typed with .d.ts files then surely you want skipLibCheck to be false correct?
Yes, sadly
Why use any in the Record<string, any> instead of unknown?
People actually use namespace in TypeScript? Can you give us some use cases for namespace (I guess module as well)? Thank you in advance! 🙏
really useful thank you
Simple yet useful solution, thanks!
Video is too fast. No sentence breaks, very difficult to follow.
The idea that redux was ever boiler-plate heavy wa actually never true for any developer who took a little trouble to reduce it. And I still use the "old" versions.
This also means you just reserved MyComponent( or whatever you called it) and it can't be used elsewhere unless you shadow it, not fun if it's Button, I could be wrong though I kinda just guessed it based on what I know
Reserved it? What do you mean?
@@mattpocockuk I thought a namespace was accessible project-wide without importing, but I found that's incorrect. You need to import it to use it, which means you can use a named import and it won't interfere with other declarations like Button if the namespace is called Button
Why not `React.ComponentProps<typeof MyComponent>`?
I guess because it's just too much code just to type the damn prop 😅
It worked. Thanks for sharing. But also resulted in an eslint warning @typescript-eslint/no-redeclare
I'm getting kinda imposter syndrome, please explain if we really use such tricky advanced concepts in coding, or is it okay if I'm using simple intermediate level code to get my stuff done, without engaging in fancy stuff like this. Btw, amazing video 🔥🔥!!
You can get 90+% the experience with a non-TS backend too. Just generate your TS client from your backend’s OpenAPI spec
Cool!
similar to as const?
They could have given us a "deepconst" or "fullconst" keyword.
This would diverge too far from JS
thanks for the video... do you have one where you show how to configure prism with a turborepo ? if not, would you be willing to make a practical video? please?
just use zod
that's a pretty deceiving TS example you took. TS can be really unreadable sometimes. Typescript hasn't really been quite helpfull to me I really tried and found out all it does is slowing me down when I need to ship a product really fast
> TS can be really unreadable sometimes. Agree, but JSDoc examples with equivalent behavior are always more verbose.
Also, shipping is easy, maintaining is hard.
use option from fp ts
It's funny, I watched this video when it was released, and now I started a new job and we're not using type: "module". Seems like I'm the only one that cares about it.
I got happy for a sec until i saw that .filter(Boolean) still doesn't infer types properly
Never use “as something” in typescript! It is wrong! You need to use const obj = <const>{ . . . }; Because “as” tells typescript to forgot anything about what he knows before and just “shut up and listen what I telling you”
This is not true for as const. as any, yes. as const, no.
next: let count = 1 // get type: 1 count++ count // get type 2
This works in a more useful way already: let a; a = 'abc'; // string a = 123; // number
JavaScript is one big step backwards for mankind
I would love to see an updated video for releasing a npm package. Specificaly, where you also walkthrough how to configure the github actions and getting it completely released. You said nothing about it in this video. There are also a few mistakes in this video, e.g. you never added the release script. Love your videos in general, but would love a better video about this topic
Typescript 5.5 broke global type definitions in our project and we dk how to update 😢
Just use vanilla JS 😂
the question here is whether your ide could find you all the usages when you pass a string instead of an enum value
🤔
seems like using regexes doesn't narrow types down either, e.g. const isAlphaNumeric = (input: string | undefined) => input !== undefined && /^[a-z0-9]+$/i.test(input) won't return `input is string` but just `boolean`
Yep, that isn't in scope
When Matt uploads a new video, we know it’s going to be a new useful knowledge. You’re awesome..❤
But a type guard is absent
What are advantages of namespaces over ComponentProps<T>? Or maybe it's just a curiosity?
so cool, I am new to know React.ComponentProps