Everyone's talking about gql.tada
5:06
Declaring globals isn't that hard
3:50
The TSConfig Cheat Sheet
5:36
8 ай бұрын
'.js' files in TypeScript - why?!
3:16
TypeScript 5.3 First Look
6:25
10 ай бұрын
Everyone's talking about Valibot
4:42
Fix your useRefs with ElementRef
2:10
Will this code error?
1:56
11 ай бұрын
The TS Playground has PLUGINS
2:43
You're typing process.env wrong
3:22
Everyone's talking about ArkType
2:48
Пікірлер
@JohnHiz
@JohnHiz 16 сағат бұрын
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 14 сағат бұрын
This is not true for as const. as any, yes. as const, no.
@nomadshiba
@nomadshiba 22 сағат бұрын
next: let count = 1 // get type: 1 count++ count // get type 2
@mattpocockuk
@mattpocockuk 18 сағат бұрын
This works in a more useful way already: let a; a = 'abc'; // string a = 123; // number
@smit17xp
@smit17xp Күн бұрын
JavaScript is one big step backwards for mankind
@Skaar18
@Skaar18 Күн бұрын
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 Күн бұрын
Typescript 5.5 broke global type definitions in our project and we dk how to update 😢
@georgechanturidze1409
@georgechanturidze1409 Күн бұрын
Just use vanilla JS 😂
@guai9632
@guai9632 Күн бұрын
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 Күн бұрын
🤔
@Y390R
@Y390R Күн бұрын
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`
@mattpocockuk
@mattpocockuk Күн бұрын
Yep, that isn't in scope
@hamdaniash-siddiq5021
@hamdaniash-siddiq5021 Күн бұрын
When Matt uploads a new video, we know it’s going to be a new useful knowledge. You’re awesome..❤
@andriiv7033
@andriiv7033 Күн бұрын
But a type guard is absent
@marcinparda3403
@marcinparda3403 2 күн бұрын
What are advantages of namespaces over ComponentProps<T>? Or maybe it's just a curiosity?
@K.Huynh.
@K.Huynh. 2 күн бұрын
so cool, I am new to know React.ComponentProps
@zwanz0r
@zwanz0r 2 күн бұрын
Lol. The reason why `!!maybeNumber` doesn't work is that 0 is falsy 😅
@mattpocockuk
@mattpocockuk 2 күн бұрын
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?
@zwanz0r
@zwanz0r 2 күн бұрын
@@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 !!
@adamhenriksson6007
@adamhenriksson6007 2 күн бұрын
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.
@mattpocockuk
@mattpocockuk 2 күн бұрын
Outputs should be colocated with their inputs, no? Your setup sounds full of implicit dependencies.
@adamhenriksson6007
@adamhenriksson6007 2 күн бұрын
​@@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.
@AtomicCodeX
@AtomicCodeX 2 күн бұрын
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 😆
@thisweekinreact
@thisweekinreact 2 күн бұрын
Great release 👌 Indexed access type narrowing is also cool
@yamogebrewold8620
@yamogebrewold8620 2 күн бұрын
I would like the video to explain what Turbo is and why I would need it.
@RedStone576
@RedStone576 15 сағат бұрын
fireship already made a video about turborepo 2 years ago