👋 I'm Alex & I tweet about web dev stuff Creator of @trpcio, work @square, scout @a16z

Malmö, Sweden
Ok, I don't completely hate this. Do you? tsplay.dev/mZ5GEN
I really dislike writing type predicates/typeguards for `.filter()` - what other solutions are there other than using `.flatMap()`? `flatMap` works but it slows down JS unnecessarily and makes the code not look like you're filtering something
22
4
86
43,410
with some invalid usage hint tsplay.dev/NdDo0N
1
2
2,001
I really dislike writing type predicates/typeguards for `.filter()` - what other solutions are there other than using `.flatMap()`? `flatMap` works but it slows down JS unnecessarily and makes the code not look like you're filtering something
TypeScript tip 💡 Use `.flatMap()` to filter items in a type-safe manner. Try it 👉 typescriptlang.org/play?targ…
8
3
87
76,141
Alex / KATT 🐱 retweeted
Just squash and merge my god some devs have too much free time
63
59
1,498
202,920
Alex / KATT 🐱 retweeted
PSA, because it's surprising how many people don't realise this. - You don't need to use @nextjs to use @trpcio - You also might not need tRPC if you're using App Router - tRPC works wonderfully in express, fastify, aws lambda, edge/fetch, or standalone, with simple SPA
4
5
59
9,380
At what point did you decide to migrate your app to a monorepo tool (Nx, Turbo, etc) and what were the main motivations for it?
25
1
35
12,944
Alex / KATT 🐱 retweeted
Relatable 😂
2
1
11
3,520
Alex / KATT 🐱 retweeted
components / hooks / types / utils (and constants) is the split I'm seeing in many codebases, yet it's the one I dislike the most. It groups by type, not by domain. "useTheme" will live next to "useTodo", but not next to ThemeProvider ... why?
138
178
1,773
514,730
Alex / KATT 🐱 retweeted
after shipping gql.tada, it didn’t take long for someone to open an issue with a huge 7MB schema 🏋️ on every edit, TS took a whole 8s to type-check 😅 We just shipped a fix and it now takes ... <40ms ❤️‍🔥 I'm flabbergasted myself.. 🧵 for how we debugged this
7
38
459
103,108
Alex / KATT 🐱 retweeted
Is there any library out there that has proper `declaration: true` support in @pnpmjs monorepos? The symlinking to the `.pnpm` folder really hurts TypeScript's module detection. Works in every other package manager and with `node-linker=hoisted` but that kinda stinks...
5
2
19
7,322
Alex / KATT 🐱 retweeted
we taught TypeScript to understand GraphQL queries! 🎉 today we’re releasing gql.tada, which infers types for GraphQL docs right in TS as you type them! together with our LSP plugin, this is the smoothest GraphQL client experience yet ✨
47
140
1,143
332,518
The inferred type of 'iGive' cannot be named without a reference to 'up.ts'
3
17
4,237
Alex / KATT 🐱 retweeted
We've just* passed 30k stars on @github!! 🤩
25.000⭐️ and still going. Thank you all 🙏
5
7
134
63,677
Anyone has a version of the TS-equivalent of `Math.max()` lying around? typescriptlang.org/play?#cod…
3
16
5,817