TypeScript 5.3 Beta | Prime Reacts

preview_player
Показать описание
Recorded live on twitch, GET IN

MY MAIN YT CHANNEL: Has well edited engineering videos

Discord

Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
Рекомендации по теме
Комментарии
Автор

Duck typing: If it quacks like a duck, it is a duck.

Cow typing: It's a cow if we say it is

lostsauce
Автор

Conspiracy theory: The real reason they stopped parsing jsdocs is because they have started to see them as competition....

canadiannomad_once_again
Автор

As a non-Javascript, non-Typescript programmer I couldn't stop laughing through most of this video.

Nichiyoobiko
Автор

The switch(true) thing is a good example of something that is very janky that 99% of devs would never use. However, the fact that it did not work properly before and now does is still an objectively good thing. The language needs to be correct and this was a clear gap in the type narrowing system. Just because most people would intuitively go for if's does not invalidate the need to make this type of thing work properly. If I've learned anything is that just because I can't think of a use-case for something doesn't mean there isn't one. If the TS team decided to give this effort, I'm sure there was someone who had a very valid use case for it.

reilem
Автор

Good lord i am so happy that since WebAssembly exists, we can use different languages in the frontend.

voidwalker
Автор

I write my software in assembly because the perf enhancements will finally get me a sixth user.

doctorgears
Автор

For just a hot second, I actually thought he'd be excited about TS 🤡

ernestodelgato
Автор

"That's the sound of bun having to support yet another thing" except this is already supported, its the bun import macro stuff you hated so much that you claimed change how JS does it they just implemented it before anyone else XD

TurtleKwitty
Автор

`import ... with ...` is a JS/ECMAScript feature already; TypeSript just added support for it

(It was added to ECMAScript because import statements in vanilla JS already request the URL and interpret it as JS regardless of the file extension, so you couldn't do JSON imports at all. To add non-JS imports, they had to add new syntax to be backward-compatible with the existing JS import syntax. TS, on the other hand, can support both syntaxes, which makes the `with` syntax less useful in TS.)

GrantGryczan
Автор

I always write class functions as fields, because then "this" just works without binding. I consider it the lesser of two evils.

emilemil
Автор

TS team are spending a lot of time shipping stuff that doesn't matter, I believe they need to work on the performance, I'm working on a codebase with 5k ts files and every time I'm trying to rename a symbol or use intellisense, it gets stuck forever. I'm pretty sure so many people having the same issue.

TheMxA_
Автор

About the instance field methods: there is (was?) indeed a usecase. In React Class Components you would write your event handlers (eg for onClick) as an instance field arrow function because of the issues with this. That way you always point to that field instead of creating a new function that captures this.
Because of Function Components and hooks I haven’t used it for years. But as a memory optimization enthusiast you‘d probably like this more than useCallback.

StefanvonderKrone
Автор

I do lots of runtime dynamic composition and analysis of objects and pattern matching and like most of this.

supercompooper
Автор

Switch true is kinda because JavaScript doesn’t yet have pattern matching, this gets you a little closer

CanRau
Автор

funny a recent video by that Theo guy he was talking about why he liked that switch (true) syntax for TypeScript

chiefsmurph
Автор

That's hilarious how Prime is one of the most famous TS/JS haters and yet he doing a lot of it at work. So do I )

rodion_bozhenko
Автор

bun already has(? idk the whole story) import attributes. look up Bun Macros for example.

tezismith
Автор

@ThePrimeTime the only time 5:30 is acceptable is if you have cases that fall into each other and frankly even that is not as easy to read so the savings there are nil.

falven
Автор

Yes, JS is too slow for good tooling, but the appeal is that devs who primarily use JS can maintain and contribute to the tooling they use. Nothing wrong with learning a new language, but the mental shift is a barrier for a lot of people. This enables the users of a language to contribute to that language's ecosystem more easily, in a more comfortable way.

docmars
Автор

switch(true) is a let wight match from Rust. you can throw in the default, and get the error if you got a null ref.

zeocamo