Christopher Horobin @chorobin.bsky.social · 12/06/2025Precompilation is not the same as generation. 000
Christopher Horobin @chorobin.bsky.social · 12/06/2025Precompiled 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/2025Honestly 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/2025Its 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/2025But 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/2025Its 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/2025Now is the time to design for typescript and write plenty of types 010
Christopher Horobin @chorobin.bsky.social · 23/05/2025Just think how many more types we can write now 110
Christopher Horobin @chorobin.bsky.social · 21/05/2025Mapped 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/2025In the end. Its about 'rich types', adding precise types where it matters most 110
Christopher Horobin @chorobin.bsky.social · 10/05/2025Or 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/2025The 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 · 19/04/2025Types 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/2025Maybe a unpopular opinion but type level code actually looks nice after you get used to it 240
Christopher Horobin @chorobin.bsky.social · 13/03/2025I 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/2025Realisation 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/2025There 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/2025I 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/2025Completely gobsmacked. Never thought I would see the day this type checks in less than a second 040
Christopher Horobin @chorobin.bsky.social · 10/03/2025I use mapped types when i want to transform an object or tuple 000
Christopher Horobin @chorobin.bsky.social · 10/03/2025I prefer to use distributive conditionals to transform unions 000
Christopher Horobin @chorobin.bsky.social · 10/03/2025I prefer to compose types bottom up with interfaces rather than top down with Omit or Pick 000
Christopher Horobin @chorobin.bsky.social · 10/03/2025Mapped 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/2025Of 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/2025And you can go even further by adding variance annotations 110
Christopher Horobin @chorobin.bsky.social · 06/03/2025So sometimes you can just replace an anonymous object literal type with a named type 110
Christopher Horobin @chorobin.bsky.social · 06/03/2025Its 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/2025I 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/2025Choosing between react and solid is going to make me pause for a bit 110
Christopher Horobin @chorobin.bsky.social · 23/02/2025Intersections 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/2025Understanding 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/2025Its 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/2025You want to avoid types which have conflicting properties 100
Christopher Horobin @chorobin.bsky.social · 23/02/2025I like intersections. They just have a few nuances 310
Christopher Horobin @chorobin.bsky.social · 22/02/2025There are becoming fewer reasons I'd choose react for an SPA 020
Christopher Horobin @chorobin.bsky.social · 17/02/2025I 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 HorobinColin McDonnell 💎 Zod @colinhacks.com · 27/01/2025A 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 · 24/12/2024Yeah, this one is not fun. I think last year had more fun tasks 010
Christopher Horobin @chorobin.bsky.social · 23/12/2024I've completed Upgrade the Assembly Line - Advent of TypeScript 2024 adventofts.com/events/2024/23adventofts.comAdvent of TypeScriptAdvent 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/2024But otherewise, i will regret saying. Come at me bro 010
Christopher Horobin @chorobin.bsky.social · 22/12/2024I'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 familyadventofts.comAdvent of TypeScriptAdvent 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/2024Yeah, its just building on the previous ones 010
Christopher Horobin @chorobin.bsky.social · 21/12/2024I've completed 🎩Bernard's New Demands 2: Electric Boogaloo - Advent of TypeScript 2024 adventofts.com/events/2024/21 Enjoying thisadventofts.comAdvent of TypeScriptAdvent 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/2024My 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