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

Malmö, Sweden
Does anyone have some non-trivial examples of `useFormState()` usage? Liiike: - client-side validation - optimistic updates - form lib (like react-hook-form) integration? - nested form values - how to structure the return to display errors, previous form data submit etc
11
3
46
13,091
RT @buildsghost: Before you go out and do a bunch of TypeScript magic to avoid JSX nesting, remember you can also just do something like th…
21
is this the way to globally disable caching in @nextjs? (I find automatically enabled caching too scary to use)
17
9
153
60,184
I think I might've been unnecessarily anxious about this. Any call to `cookies()` - which all private stuff depends on - automatically opts nextjs out of the caching
2
1,509
I think I might've been unnecessarily anxious about this. Any call to `cookies()` - which all private stuff depends on - automatically opts nextjs out of the caching
is this the way to globally disable caching in @nextjs? (I find automatically enabled caching too scary to use)
6
58
16,781
Yo @microsoft, if you ain't paying @AndaristRake for all his work on @typescript yet, you should start yesterday
Repro would be appreciated, with that on hand i can investigate it later
11
7
147
33,136
Did you know that you can use @trpcio as the data layer in @nextjs to get a lightweight & secure layer with auth-checked code & runtime validated input/outputs? You don't even need to use trpc routers, client, or the react libs We should probably make a blog post about dis 👀
Interesting Next.js RSC security article 💡 TIL that using Layout for checking auth/payment is not great The layout might not be accessible, but the page content can still leak through the RSC endpoint 😬 Using a middleware is a better protection
20
8
240
33,054
New toy available! Esp excited about: - Object.groupBy - Preserved Narrowing in Closures Following Last Assignments - NoInfer devblogs.microsoft.com/types…
2
1
22
3,409
Alex / KATT 🐱 retweeted
New life improvement in @trpcio 😱 Enabled:false 😎 skipToken When implementing this, I realized how much work @TkDodo @jullerino @alexdotjs @tannerlinsley and others are putting so we have good DX. We should appreciate them more!
3
5
82
13,565
remember vision pro?
3
20
4,202
Alex / KATT 🐱 retweeted
One of my mistakes when building products used to be adding dependencies too early. Don't add a cache store until your database starts slowing down and you've tried optimizing it with indexes. Even then, start with a basic in-memory cache before adding Redis or Memcached. Don't add a full-text search engine until you've pushed your database as much as you can with whatever full-text search features it has. Don't add a message queue until your background jobs are starting to struggle with the load. Even then, start with a simple in-process queue, or see if you can use your database as a queue. Only then should you consider adding RabbitMQ, Kafka, or whatever. Every new dependency comes with a cost, one more thing to maintain, and one more thing that can go wrong. These are the things you should avoid as long as you can.
19
56
475
50,460
Did some fixes on a socket.io Objective-C client 13 years ago
9
2,195
"While building a feature, we performed a database migration command locally, but it incorrectly pointed to the production environment instead, which dropped all tables in production." I'm surprised this sort of incedent doesn't happen more frequently tbh I've had prod access to dbs in most places I've worked and even knowing I sit on the credentials make me paranoid
On February 21st, Resend experienced an outage that affected all users due to a database migration that went wrong. Here's a summary of what happened, how the incident was resolved, and the changes we're making moving forward. resend.com/blog/incident-rep…
12
146
49,065
Alex / KATT 🐱 retweeted
"Thou shalt mock nothing [except third party services] in tests" - @alexdotjs Do you agree?
46
4
125
59,221
Alex / KATT 🐱 retweeted
Integration tests > Unit tests 🤗
Replying to @housecor
Thou shalt mock nothing [except third party services] in tests
1
2
13
2,112
very flattering to have @trpcio being mentioned in the React-blog as a known point of reference on how server actions work
3
4
114
8,921
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
more tests - prevent widening of list item etc tsplay.dev/Nron2m
1
2
1,753