TypeScript FINALLY fixed this...

preview_player
Показать описание
TypeScript 5.5 is coming and it promises to solve a massive developer experience issue thats been with us for a while. We're getting inferred type predicates, control flow narrowing for indexed accessess and regex syntax checking!

-------
Рекомендации по теме
Комментарии
Автор

Have you run into one of these issues before? Excited for 5.5?

JollyCoding
Автор

1:17 that accidental asterisk terrified the shit out of me

everyumclust
Автор

Good fixes and a great showcase. Thank you.

IkraamDev
Автор

That array.filter was so frustrating at the moment. So glad they finally fixed that.

wardxela
Автор

finally filter works as expected, thanks for the video 👍

antonarbus
Автор

Filter type inferences I have been wanting for as long as i have used typescript, especially with JSDoc where you can't directly say Object is Type, I am going to be updating so quickly when this comes out I can't wait

HtotheG
Автор

Damn, that's so sick. I always wished for this, but wasn't holding my breath- what a nice surprise.

evanrosz
Автор

The dumb filter intellisense always annoy me, this is the greatest change in a while.

jesteriruka
Автор

It is why I learnt reduce method. Always bothered me that I had to filter array, then map it, and then add type checks again because it forgets which type it should be.

virtual
Автор

I'm so happy to know I won't need `.filter((data): data is Exclude<typeof data, null> => !!data)` anymore!

FernandoMumbach
Автор

Holy 🐄 I've been figuring these issues a lot lately

realbigsquid
Автор

Nice. I hit this problem all the time.

jinushaun
Автор

what if obj[key] return another object the next time you call it after the check?

guai
Автор

For the constant index accesses, it seems very helpful, but will that really be okay? Sure the regular indexing won't cause any side effects, but proxies exist! It'd be severe abuse of notation, but theoretically `proxy[key]` needn't return the same value, or even the same type of value both times, right? Will TypeScript be able to understand this, or will we be able to tell it that explicitly somehow? Or is this just broken with no fix?

ilonachan
Автор

fuck yeah, digestible typescript news, let's go ;-)

Caldaron
Автор

Finally, this feature was way overdue.

darksinge
Автор

So it got a string instead of a "schtring" - great.
And more awesome, typescript finally recognizes types !!
Then i bailed out.

guruware
Автор

But don't get too optimistic with predicates, things like `.filter(Boolean)` or `.filter(item => !!item)` won't do. You can't be too lazy with your predicates.

aram
Автор

Hope it doesn't make typescript slower than it already is.

zeteya
Автор

Nice showcase ty! Sidenote: you should really put some effort to learn how to properly touch type, its painful to watch

imornar