Sign in

Christopher Horobin

@chorobin.bsky.social
97 followers 35 following 100 posts

🌌 Type spacer

PostsRepliesMedia
Christopher Horobin @chorobin.bsky.social · 12/06/2025
Precompilation is not the same as generation.
000
Christopher Horobin @chorobin.bsky.social · 12/06/2025
Precompiled types require check time and emit which is slower than inference. You just live with stale types for longer
100
Christopher Horobin @chorobin.bsky.social · 06/06/2025
Honestly its likely not a very documented topic. Also I am pretty certain TS does an awful lot of caching regardless of if you are making and using loads of utility types. Best thing is letting instantiation and type counts plus tracing guide you
010
Christopher Horobin @chorobin.bsky.social · 06/06/2025
Its also worth checking both instatiations and type count. They are both useful, when both go down its a win-win. But if one goes up and the other goes down, it can probably vary which is faster
110
Christopher Horobin @chorobin.bsky.social · 06/06/2025
But its not always the case though. Sometimes you want A and B to be instantiated lazily, when they are used. And you only want to do the work for A and not B only when A is used.
110
Christopher Horobin @chorobin.bsky.social · 06/06/2025
Its probably the caching. If you know both A and B are always used in the majority of cases then having a shared util type which does the work once can definitely help
110
Christopher Horobin @chorobin.bsky.social · 24/05/2025
Now is the time to design for typescript and write plenty of types
010
Christopher Horobin @chorobin.bsky.social · 23/05/2025
Just think how many more types we can write now
110
Christopher Horobin @chorobin.bsky.social · 23/05/2025
tsgo is really incredible
110
Christopher Horobin @chorobin.bsky.social · 21/05/2025
Also feels less natural to me
010
Christopher Horobin @chorobin.bsky.social · 21/05/2025
Mapped types feel too verbose for this purpose
110
Christopher Horobin @chorobin.bsky.social · 21/05/2025
`extends any` is my favourite use of `any` to trigger conditional type distribution.
110
Christopher Horobin @chorobin.bsky.social · 10/05/2025
In the end. Its about 'rich types', adding precise types where it matters most
110
Christopher Horobin @chorobin.bsky.social · 10/05/2025
Or should it be the most suitable type? Or are we saying 'type-safe' stuff just cares about TypeScript. If so, that is sad.
010
Christopher Horobin @chorobin.bsky.social · 10/05/2025
The term 'type-safe' is used rather a lot. Is `string` 'type-safe'? Depends. Maybe we should be referring to the most precise type for 'type-safety'? But do we?
230
Christopher Horobin @chorobin.bsky.social · 20/04/2025
I just see them as if expressions
010
Christopher Horobin @chorobin.bsky.social · 19/04/2025
Types are pure functions. There are no side effects possible, like ever. The language is also quite small. I personally find this combination makes it easy to reason
120
Christopher Horobin @chorobin.bsky.social · 19/04/2025
Maybe a unpopular opinion but type level code actually looks nice after you get used to it
240
Christopher Horobin @chorobin.bsky.social · 13/03/2025
I think the designer of those languages has a better understanding of what language to choose for a code base they know very well than maybe anybody on the outside
010
Christopher Horobin @chorobin.bsky.social · 13/03/2025
Realisation that my first language was delphi as a child because my father liked it. My first actual toy projects in college were in c#, spent years in that language. Now I have spent 9 years in typescript.
120
Christopher Horobin @chorobin.bsky.social · 12/03/2025
There are some footguns which I have learnt to avoid regarding performance. If the compiler is 10 times faster then definitely some quirks become way less noticable. I wonder if things like conflicting properties with intersections might still be noticable.
010
Christopher Horobin @chorobin.bsky.social · 12/03/2025
I want to hope types will get more ambitious with a faster typescript. Not more sloppy. That would be sad
130
Christopher Horobin @chorobin.bsky.social · 11/03/2025
Completely gobsmacked. Never thought I would see the day this type checks in less than a second
040
Christopher Horobin @chorobin.bsky.social · 10/03/2025
I use mapped types when i want to transform an object or tuple
000
Christopher Horobin @chorobin.bsky.social · 10/03/2025
I prefer to use distributive conditionals to transform unions
000
Christopher Horobin @chorobin.bsky.social · 10/03/2025
I prefer to compose types bottom up with interfaces rather than top down with Omit or Pick
000
Christopher Horobin @chorobin.bsky.social · 10/03/2025
Mapped types are great. I just see them used in places where I would not all the time
310
Christopher Horobin @chorobin.bsky.social · 06/03/2025
Of course intuitions on this is good for library authors to build. Devs should just keep thinking in terms of structural typing imo
000
Christopher Horobin @chorobin.bsky.social · 06/03/2025
And you can go even further by adding variance annotations
110
Christopher Horobin @chorobin.bsky.social · 06/03/2025
So sometimes you can just replace an anonymous object literal type with a named type
110
Christopher Horobin @chorobin.bsky.social · 06/03/2025
Its cool that while TS is perceived to be completely structurally typed on the outside, deep structural relations can be optimised away by looking at type parameters
110
Christopher Horobin @chorobin.bsky.social · 25/02/2025
I have been using react for the best part of a decade, a few years a go I was pretty rooted in it. I would not have been pausing
010
Christopher Horobin @chorobin.bsky.social · 25/02/2025
Choosing between react and solid is going to make me pause for a bit
110
Christopher Horobin @chorobin.bsky.social · 23/02/2025
Intersections also distribute over unions. (A | B) & C = A & C | B & C. If not wanted then this can also slow things for object types but actually for primitive types this seems faster than conditonal distribution sometimes
010
Christopher Horobin @chorobin.bsky.social · 23/02/2025
Understanding that & {} can expand or prettify types can also impact things. You only want to do this when necessary to make things look nice.
000
Christopher Horobin @chorobin.bsky.social · 23/02/2025
Its also preferable not to use Omit to avoid conflicting properties and compose your types bottom up rather than top down
000
Christopher Horobin @chorobin.bsky.social · 23/02/2025
You want to avoid types which have conflicting properties
100
Christopher Horobin @chorobin.bsky.social · 23/02/2025
I like intersections. They just have a few nuances
310
Christopher Horobin @chorobin.bsky.social · 22/02/2025
There are becoming fewer reasons I'd choose react for an SPA
020
Christopher Horobin @chorobin.bsky.social · 17/02/2025
I always liked reaching for stuff when I needed it. I liked this about react from the beginning. I like this about router/start now
031
Reposted by Christopher Horobin
Colin McDonnell 💎 Zod @colinhacks.com · 27/01/2025
A lot of frameworks and tools already accept Standard Schemas! Huge shoutout to the early adopters: tRPC, Tanstack Form, Tanstack Router, UploadThing and t3-env, OpenAuth, Renoun, and more 🙏 @jayair.bsky.social @katt.dev @chorobin.bsky.social @jumr.dev @souporserious.com @awad.dev @unnoq.com
4593
Christopher Horobin @chorobin.bsky.social · 17/01/2025
Foget types. Time to board
020
Christopher Horobin @chorobin.bsky.social · 24/12/2024
Yeah, this one is not fun. I think last year had more fun tasks
010
Christopher Horobin @chorobin.bsky.social · 23/12/2024
Easier than yesterday imo
010
Christopher Horobin @chorobin.bsky.social · 23/12/2024
I've completed Upgrade the Assembly Line - Advent of TypeScript 2024 adventofts.com/events/2024/23
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
140
Christopher Horobin @chorobin.bsky.social · 22/12/2024
But otherewise, i will regret saying. Come at me bro
010
Christopher Horobin @chorobin.bsky.social · 22/12/2024
I've completed A JSON Parsing Emergency - Advent of TypeScript 2024 adventofts.com/events/2024/22 The difficulty is doing these last few on my mobile in between doing festive things with family
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
110
Christopher Horobin @chorobin.bsky.social · 21/12/2024
Yeah, its just building on the previous ones
010
Christopher Horobin @chorobin.bsky.social · 21/12/2024
I've completed 🎩Bernard's New Demands 2: Electric Boogaloo - Advent of TypeScript 2024 adventofts.com/events/2024/21 Enjoying this
adventofts.com
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
040
Christopher Horobin @chorobin.bsky.social · 20/12/2024
My favourite is this because it seems types can be instantiated lazily when properties are used on a interface. But the test cases obviously fully instantiate the types so it does not show
010