Christopher Horobin
chorobin.bsky.social
Christopher Horobin
@chorobin.bsky.social
🌌 Type spacer
Precompilation is not the same as generation.
June 12, 2025 at 2:03 PM
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
June 6, 2025 at 6:24 PM
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
June 6, 2025 at 5:16 PM
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.
June 6, 2025 at 5:07 PM
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
June 6, 2025 at 5:04 PM
Now is the time to design for typescript and write plenty of types
May 24, 2025 at 1:28 PM
Just think how many more types we can write now
May 23, 2025 at 8:50 PM
Also feels less natural to me
May 21, 2025 at 4:35 PM
Mapped types feel too verbose for this purpose
May 21, 2025 at 4:34 PM
In the end. Its about 'rich types', adding precise types where it matters most
May 10, 2025 at 9:56 PM
Or should it be the most suitable type? Or are we saying 'type-safe' stuff just cares about TypeScript. If so, that is sad.
May 10, 2025 at 9:48 PM
I just see them as if expressions
April 20, 2025 at 9:11 AM
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
April 19, 2025 at 6:38 PM
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
March 13, 2025 at 10:43 AM
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.
March 12, 2025 at 1:41 PM
I use mapped types when i want to transform an object or tuple
March 10, 2025 at 7:21 PM
I prefer to use distributive conditionals to transform unions
March 10, 2025 at 7:20 PM