![Matt Pocock](/img/default-banner.jpg)
- Видео 163
- Просмотров 6 304 794
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
Просмотров: 51 830
Видео
My "as few deps as possible" monorepo setup
Просмотров 31 тыс.Месяц назад
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)
Просмотров 77 тыс.4 месяца назад
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'
Просмотров 53 тыс.5 месяцев назад
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
Просмотров 112 тыс.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
Просмотров 129 тыс.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
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`
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
Lol. The reason why `!!maybeNumber` doesn't work is that 0 is falsy 😅
Lots of people are replying this, but that still means the type would be inferred correctly. It's just a subset of number instead of number. In an 'if' statement, this works. Why not trigger type predicate inference there?
@@mattpocockuk yeah, also figured that after responding. I think maybe because Boolean is also a constructor? There might not be a way to type that yet (a constructor with a type guard as a side effect). Not sure about !!
I mean having tons of stuff in root_dir/dist seems a lot more preferable and sensible honestly. It seems a lot worse to have to chase down all the different build artifacts across node_modules every time you want to build from a clean slate. You kinda want your libs to be static and without artifacts. It's already a nightmare to debug dependency issues as it is.
Outputs should be colocated with their inputs, no? Your setup sounds full of implicit dependencies.
@@mattpocockuk An example would be an orm-plugin for a node-backend. It makes sense to create the sqlite dev file as an artifact in root. Same for plugins generating json API specs consumed by docs endpoint generators like swagger. There are probably a lot more examples. As far as I know there is no way for libraries to generate a npm command in root package.json which invokes cleanup for its own (or all) package.json files in node_modules. This means that state in the tree is hidden making bugs really hard to track down until all problems are mysteriously solved when dev reinstalls node_modules. If npm has, or implements in the future, a standardized optional cleanup command that also invokes all package cleanup commands in node_modules, this problem might be solved given that library developers implement this new convention.
Thank you for this I chose to use types even though I use c# on the backend But I use types cuz I was like fuck it, I’m not using inheritance 😆
Great release 👌 Indexed access type narrowing is also cool
I would like the video to explain what Turbo is and why I would need it.
I think your audio does not sync with the video
commonjs is here to stay
Congratulations on your book; I'm really looking forward to using the regular expression validation feature
cool feature, but it is still an inconvenience the name of namespace need to match the name of a component. That means you need to update both when refactoring code. Ideal behaviour would be giving the namespace a name and making it export the component by default i guess
nevermind, it will complicate code quite a bit
I think the namespace should also be exported. Can’t get this to work without also exporting the namespace.
Nope, it works!
You will need the .ts file to be included in tsconfig.
It was. Not sure what’s weird about my setup but if I import MyComponent from a different ts file, MyComponent.Props doesn’t exist. Probably a weirdness with my setting but I haven’t had the time to make a clean reproducible setup for testing.
Does exporting like that interfere with ComponentProps<T> ?
No!
how did you animate it?
there is a d.ts file generation issue that's been open in tsup for months that this might fix
I try to define explicit return types wherever applicable. It should be the default, just like all strict programming languages.
waiting for the book
Can we use it in a big project ? 🤔
Yes!
7:30 does not work because !!0 is false and !!1 is true
I mean, it'll still filter to a subset of number - and this works in an 'if' statement. So I am a bit surprised that it doesn't work.