Log inSign up
Alex / KATT 🐱
8,638 posts
Image
user avatar
Alex / KATT 🐱
@alexdotjs
👋 I'm Alex & I tweet about web dev stuff 🧙‍♂️ Open-sourcerer & fully-stacked typescripter. 👉 Creator of @trpcio, work @square, scout @a16z
Malmö, Sweden
katt.dev
Born December 7
Joined July 2010
1,871
Following
28.9K
Followers
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Nov 21, 2022
    @trpcio 10.0.0 is now officially out! 🚀🚀 See the blog post below 👇 👇 👇
    Image
    Announcing tRPC v10 | tRPC
    From trpc.io
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Nov 3, 2022
    This week I've been working on a declarative isomorphic permission library. On the backend we create Prisma `WhereInput`s & on the frontend we get rules like this hopefully will OSS it soon
    Image
    00:00
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Sep 20, 2023
    TIL that this is correct syntax and that `finally` runs after the return of the function #junior4lyfe
    Image
    164K
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Sep 19, 2022
    Heyheheyheyhey!!!👋 I got something exciting to share! We just released the version 10 beta of tRPC! 🚀 Go have a look! 👇👇 (also, the website has gotten a real facelift recently 👀)
    Image
    tRPC - Move Fast and Break Nothing. End-to-end typesafe APIs made easy. | tRPC
    From trpc.io
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Apr 26, 2022
    One of my favorite little ts utils ``` export type Maybe<T> = T | undefined | null; ```
    Image
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Jul 15, 2021
    Building UI is harder than building backend
    Image
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Nov 18, 2022
    The types are strong in this pic
    Image
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Feb 5, 2022
    Did ya know you probably should be using `interface` rather than `type` where possible? There's a section about this in the official wiki on ts performance
    Image
    Performance
    From github.com
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Jan 12, 2021
    me in 2021 after a 5 year long monogamous relationship with react
    Image
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Nov 5, 2022
    This is what I'd do. The way you typecast an unsafe object doesn't really matter, just ensure it's the right type instead.
    Image
    // OPTION 1: Type the return statement 
async function getUser() {
  const res = await fetch("user");
  return res.json() as User;
}

// OPTION 2: Type the function's signature 
async function getUser(): Promise<User> {
  const res = await fetch("user");
  return res.json();
}

// OPTION 3: Type both the return and the function 
async function getUser(): Promise<User> {
  const res = await fetch("user");
  return res.json() as User;
}
    user avatar
    Cory House
    @housecor
    Nov 5, 2022
    TypeScript decision: How should a function that calls fetch be typed? Options: 1. Type the return statement 2. Type the function's signature 3. Type both Poll in the next tweet 👇 #typescript
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Nov 1, 2022
    My mental model of how React renders my app is broken (again)
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Nov 29, 2022
    tRPC will likely require TypeScript 4.9 pretty soon, does that satisfy you?
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Jan 6, 2023
    are they big enough for you?
    Image
    120K
  • user avatar
    Alex / KATT 🐱
    @alexdotjs
    Oct 28, 2022
    Spent some time hacking with @trpcio + @nextjs 13 - 🚀 Use tRPC in RSC &/or in client - ♾ Made infinite scrolling with the first page being RSC SSR'd - 🔒 Hacked next-auth to work It's ugly & code is quite messy, don't judge github.com/trpc/next-13 / rsc.trpc.io
    Image
    GitHub - trpc/next-13: experimental playground for tRPC + next.js 13
    From github.com

New to X?

Sign up now to get your own personalized timeline!

Create account

By signing up, you agree to the Terms of Service and Privacy Policy, including Cookie Use.

Terms·Privacy·Cookies·Accessibility·Ads Info·© 2026 X Corp.
Don't miss what's happening
People on X are the first to know.
Log inSign up
Advertisement
Advertisement