
9 min read
A field guide to TypeScript narrowing
typeof, in, discriminated unions and custom type guards: how the compiler follows your control flow, and how to help it when it can't.
- TypeScript
Alex Rivera · 8 posts
Notes on building for the web: TypeScript, React, servers and the small things in between.
8 posts

9 min read
typeof, in, discriminated unions and custom type guards: how the compiler follows your control flow, and how to help it when it can't.

8 min read
Cache-Control, ETags and stale-while-revalidate: what each header promises, who honours it, and the three settings that cover most sites.

7 min read
Send the shell first and fill in slow parts as they resolve. A walk through Suspense boundaries, loading states and what the user actually sees.

6 min read
No debugger, no repro, one angry graph. How to narrow down a production problem with logs, timing and a written list of guesses.

5 min read
Argument parsing, colors, exit codes and shipping a single binary: everything you need to turn a script into a tool your team will actually use.

7 min read
Expand, migrate, contract: renaming a column while the old code is still running, in three deploys you can each roll back.

8 min read
Good names, fewer booleans and types that make wrong calls fail to compile. Notes from reviewing a few hundred pull requests against a shared library.

4 min read
Decision records for small teams: one page, five headings, written the day you decide. Why they beat a long design doc nobody updates.