Matt Pocock
Matt Pocock
  • 163
  • 6 347 962
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
Переглядів: 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
Declaring globals isn't that hard
Переглядів 29 тис.5 місяців тому
Declaring globals isn't that hard
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...
The TSConfig Cheat Sheet
Переглядів 33 тис.8 місяців тому
The TSConfig Cheat Sheet
'.js' files in TypeScript - why?!
Переглядів 20 тис.8 місяців тому
'.js' files in TypeScript - why?!
Import vs Require: The Biggest JavaScript Divide
Переглядів 50 тис.9 місяців тому
Import vs Require: The Biggest JavaScript Divide
TypeScript 5.3 First Look
Переглядів 41 тис.10 місяців тому
TypeScript 5.3 First Look
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
Everyone's talking about Valibot
Переглядів 46 тис.11 місяців тому
Everyone's talking about Valibot
Fix your useRefs with ElementRef
Переглядів 18 тис.11 місяців тому
Fix your useRefs with ElementRef
The empty object is TypeScript's weirdest type
Переглядів 26 тис.11 місяців тому
The empty object is TypeScript's weirdest type
Will this code error?
Переглядів 20 тис.11 місяців тому
Will this code error?
Don't put your types in .d.ts files
Переглядів 130 тис.11 місяців тому
Don't put your types in .d.ts files
var, const, let... now ‘using’?
Переглядів 228 тис.Рік тому
var, const, let... now ‘using’?
The TS Playground has PLUGINS
Переглядів 14 тис.Рік тому
The TS Playground has PLUGINS
TypeScript just unblocked React Server Components
Переглядів 32 тис.Рік тому
TypeScript just unblocked React Server Components
You're typing process.env wrong
Переглядів 56 тис.Рік тому
You're typing process.env wrong
Everyone's talking about ArkType
Переглядів 46 тис.Рік тому
Everyone's talking about ArkType
Everyone's talking about HOTScript
Переглядів 40 тис.Рік тому
Everyone's talking about HOTScript
This TS naming convention is weird
Переглядів 116 тис.Рік тому
This TS naming convention is weird
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

КОМЕНТАРІ

  • @leopardgaming0144
    @leopardgaming0144 5 годин тому

    very very thanks for this video.really helpful

  • @magnuserikkeenrobot1117
    @magnuserikkeenrobot1117 6 годин тому

    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

  • @magnuserikkeenrobot1117
    @magnuserikkeenrobot1117 6 годин тому

    would really appreciate if you could make a generic small course of 10 exercises.

  • @acf2802
    @acf2802 10 годин тому

    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.

  • @vojtaost
    @vojtaost День тому

    With JSX.Element can we do something like JSX.Element<SpecificComponent> to only allow specific react components?

    • @mattpocockuk
      @mattpocockuk День тому

      No, and you can't do that with ReactElement either. It just seems like you can, but it doesn't work.

  • @LetalisLatrodectus
    @LetalisLatrodectus 2 дні тому

    If your large code base has js files that are typed with .d.ts files then surely you want skipLibCheck to be false correct?

  • @LetalisLatrodectus
    @LetalisLatrodectus 2 дні тому

    Why use any in the Record<string, any> instead of unknown?

  • @KPSChannel
    @KPSChannel 3 дні тому

    People actually use namespace in TypeScript? Can you give us some use cases for namespace (I guess module as well)? Thank you in advance! 🙏

  • @lakshanperera9735
    @lakshanperera9735 3 дні тому

    really useful thank you

  • @ingvarr6235
    @ingvarr6235 3 дні тому

    Simple yet useful solution, thanks!

  • @gantamk
    @gantamk 3 дні тому

    Video is too fast. No sentence breaks, very difficult to follow.

  • @tesilab994
    @tesilab994 4 дні тому

    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.

  • @yassinesafraoui
    @yassinesafraoui 4 дні тому

    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

    • @mattpocockuk
      @mattpocockuk 3 дні тому

      Reserved it? What do you mean?

    • @yassinesafraoui
      @yassinesafraoui 2 дні тому

      @@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

  • @mickmister
    @mickmister 4 дні тому

    Why not `React.ComponentProps<typeof MyComponent>`?

    • @yassinesafraoui
      @yassinesafraoui 4 дні тому

      I guess because it's just too much code just to type the damn prop 😅

  • @technical_hq
    @technical_hq 5 днів тому

    It worked. Thanks for sharing. But also resulted in an eslint warning @typescript-eslint/no-redeclare

  • @mrvaibh0
    @mrvaibh0 6 днів тому

    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 🔥🔥!!

  • @kabal911
    @kabal911 6 днів тому

    You can get 90+% the experience with a non-TS backend too. Just generate your TS client from your backend’s OpenAPI spec

  • @WilliamShrek
    @WilliamShrek 7 днів тому

    Cool!

  • @zul.overflow
    @zul.overflow 7 днів тому

    similar to as const?

  • @kbsanders
    @kbsanders 7 днів тому

    They could have given us a "deepconst" or "fullconst" keyword.

    • @mattpocockuk
      @mattpocockuk 7 днів тому

      This would diverge too far from JS

  • @Grishopping
    @Grishopping 7 днів тому

    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?

  • @mrlectus
    @mrlectus 7 днів тому

    just use zod

  • @petsco3623
    @petsco3623 8 днів тому

    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

    • @mattpocockuk
      @mattpocockuk 7 днів тому

      > TS can be really unreadable sometimes. Agree, but JSDoc examples with equivalent behavior are always more verbose.

    • @mattpocockuk
      @mattpocockuk 7 днів тому

      Also, shipping is easy, maintaining is hard.

  • @aizensoskue3880
    @aizensoskue3880 8 днів тому

    use option from fp ts

  • @helleye311
    @helleye311 8 днів тому

    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.

  • @nicko3151
    @nicko3151 8 днів тому

    I got happy for a sec until i saw that .filter(Boolean) still doesn't infer types properly

  • @JohnHiz
    @JohnHiz 8 днів тому

    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”

    • @mattpocockuk
      @mattpocockuk 8 днів тому

      This is not true for as const. as any, yes. as const, no.

  • @nomadshiba
    @nomadshiba 9 днів тому

    next: let count = 1 // get type: 1 count++ count // get type 2

    • @mattpocockuk
      @mattpocockuk 8 днів тому

      This works in a more useful way already: let a; a = 'abc'; // string a = 123; // number

  • @smit17xp
    @smit17xp 9 днів тому

    JavaScript is one big step backwards for mankind

  • @Skaar18
    @Skaar18 9 днів тому

    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

  • @vitalysuper3193
    @vitalysuper3193 9 днів тому

    Typescript 5.5 broke global type definitions in our project and we dk how to update 😢

  • @georgechanturidze1409
    @georgechanturidze1409 9 днів тому

    Just use vanilla JS 😂

  • @guai9632
    @guai9632 9 днів тому

    the question here is whether your ide could find you all the usages when you pass a string instead of an enum value

  • @robertsandiford6223
    @robertsandiford6223 9 днів тому

    🤔

  • @Y390R
    @Y390R 9 днів тому

    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`

  • @hamdaniash-siddiq5021
    @hamdaniash-siddiq5021 9 днів тому

    When Matt uploads a new video, we know it’s going to be a new useful knowledge. You’re awesome..❤

  • @andriiv7033
    @andriiv7033 10 днів тому

    But a type guard is absent

  • @marcinparda3403
    @marcinparda3403 10 днів тому

    What are advantages of namespaces over ComponentProps<T>? Or maybe it's just a curiosity?

  • @K.Huynh.
    @K.Huynh. 10 днів тому

    so cool, I am new to know React.ComponentProps