Navigate Select ESC Close

WTF Typescript?! (The Standup)

2025-07-08 Science & Technology
198.2k
4.8k
808
ThePrimeTime
ThePrimeTime
1.1m subscribers

Unlock all features

FREE: Get instant access to 10 AI summaries, chats, or transcripts per day.

Description

🔗 Sponsored by Sentry https://sentry.io | Code breaks, fix it faster 📌 Chapters: 00:00:00 - Intro 00:00:42 - Who’s actually a “web developer”? 00:02:31 - Trash’s live intro & TypeScript presentation setup 00:03:59 - Sentry #ad 00:04:38 - Excess property checks in TS 00:09:42 - WTF: Object spreads silence type errors 00:14:30 - React prop spreading madness 00:18:22 - Structural vs duck typing debate 00:24:00 - WTF: Enums and why everyone hates them 00:27:45 - Enum strings vs numbers behavior 00:33:10 - Why enums in Node are cursed 00:36:55 - Safer enum alternatives using const objects 00:43:10 - TS quirks: Boolean filter keeps undefined in types 00:46:40 - TSReset: The “CSS reset” for TypeScript 00:49:01 - WTF: Empty object {} lets everything through 00:52:32 - Doom rendered in TypeScript type system 00:54:00 - Type-level math in TS (it’s real) 00:56:33 - Scaling hell: TS performance bottlenecks 01:00:01 - Flamegraphs and fighting TS perf without docs 01:04:55 - TS inference vs explicit typing in large codebases 01:09:30 - Prime’s favorite TS bug strikes again 01:14:01 - Casey breaks down the compiler logic 01:17:50 - Is this a TypeScript bug or a feature? 01:22:44 - Final thoughts and community love --- **Topics Covered:** • TypeScript excess property checks • Enums vs object literals • Structural vs duck typing • TS compiler edge cases • WTFs that break your mental model • Type-level math • Performance debugging hell • Massive monorepo pain points • The one TypeScript bug Prime can’t let go

Top Comments (10)

@jacobsteel1142 2025-07-08

I can't believe I'm watching a show called the standup and everybody is sat down. My disappointment is immeasurable.

1.4k 16 replies
@brutosmomentos7355 2025-07-08

I would really appreciate some sort of indicator in the video titles of Standup episode. Much love, great podcast.

554 12 replies
@p3anutty 2025-07-09

I must admit that Casey is a win for this kind of videos. He is so invested into everything which makes the talks deep and interesting. Instead of just bashing on memes, he is trying to understand them and then decide. Super valuable to be part of this process. Thanks!

539 1 replies
@matthewgiallourakis7645 2025-07-08

`(number | string)[]` is a heterogeneous array where any element can be number or string. `number[] | string[]` is a homogenous array where elements are either all numbers or all strings.

386 35 replies
@russellclarey2319 2025-07-08

01:09:30 This is a well known topic in type systems called "type covariance". A container type is covariant if it preserves the subtyping relationships of contained types, i.e. since `number` is a subtype of `number | string` then `number[]` is a subtype of `(number | string)[]`. The issue is having covariant mutable container types is not sound (that's why everyone calls this a bug in TS). Languages that track mutability often have covariant immutable container types (no bug if you can't push to the array) but invariant mutable container types. Other languages have to choose either (a) don't have covariant container types, (b) have them but throw a runtime error when they're used in an unsound way, or (c) have them and just ignore the issue (like TS). It seems like since the TS type system is already unsound in many other ways (`any`, casting, etc) the TS team purposefully chose to have container types be covariant because it is useful in many cases and it's safe if you don't mutate the container.

211 19 replies
@liquidpebbles 2025-07-08

I really want to witness Casey and the gang fix a TS compiler bug. Even if there's no pull request, just seeing a quick and dirty fix to a bug we're now all familiar with in compiler code would be sick.

125 2 replies
@Newilander 2025-07-09

Anyone wondering about that enum difference from 16:22: TLDR: There’s no reverse mapping (e.g., "valueA": "A") because string values are not guaranteed to be unique, and creating reverse mappings for strings could lead to ambiguity or complexity. For numeric enums, TypeScript creates a bidirectional mapping (a reverse mapping) between the enum member names and their values. This means you can access an enum member by its numeric value because TypeScript generates an object with both name-to-value and value-to-name mappings. enum NumericEnum { A = 1, B = 2, } TypeScript compiles this enum into an object like this: { A: 1, B: 2, 1: "A", 2: "B", } For string enums, TypeScript does not create a reverse mapping. String enums are compiled into an object that maps enum member names to their string values, but not the other way around. enum StringEnum { A = "valueA", B = "valueB", } TypeScript compiles the enum into an object like this: { A: "valueA", B: "valueB", }

103 9 replies
@Betadesk 2025-07-14

Casey discovering how "const" works is hilarious

61 1 replies
@vaushfan9200 2025-07-08

Casey’s lighting makes him look like Two-Face from the Batman animated series

30 1 replies
@dauraktv 2025-07-08

Missed opportunity to call this “Everything AI Doesn’t Know About Typescript”

3

Unlock the Data Inside
Turn Videos into Knowledge

  • Get FREE 10/day: transcripts, summaries, chats
  • Chat with videos, export text & PDF
  • $1 free API credit for RAG, chatbots & research

Free forever plan • All features unlocked

App screenshot