Precompilation is not the same as generation.
12.06.2025 14:03 β π 0 π 0 π¬ 0 π 0@chorobin.bsky.social
π Type spacer
Precompilation is not the same as generation.
12.06.2025 14:03 β π 0 π 0 π¬ 0 π 0Precompiled types require check time and emit which is slower than inference. You just live with stale types for longer
12.06.2025 14:02 β π 0 π 0 π¬ 1 π 0Honestly 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
06.06.2025 18:24 β π 1 π 0 π¬ 0 π 0Its 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
06.06.2025 17:16 β π 1 π 0 π¬ 1 π 0But 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.
06.06.2025 17:07 β π 1 π 0 π¬ 1 π 0Its 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
06.06.2025 17:04 β π 1 π 0 π¬ 1 π 0Now is the time to design for typescript and write plenty of types
24.05.2025 13:28 β π 1 π 0 π¬ 0 π 0Just think how many more types we can write now
23.05.2025 20:50 β π 1 π 0 π¬ 1 π 0tsgo is really incredible
23.05.2025 20:38 β π 1 π 0 π¬ 1 π 0Also feels less natural to me
21.05.2025 16:35 β π 1 π 0 π¬ 0 π 0Mapped types feel too verbose for this purpose
21.05.2025 16:34 β π 1 π 0 π¬ 1 π 0`extends any` is my favourite use of `any` to trigger conditional type distribution.
21.05.2025 16:33 β π 1 π 0 π¬ 1 π 0In the end. Its about 'rich types', adding precise types where it matters most
10.05.2025 21:56 β π 1 π 0 π¬ 1 π 0Or should it be the most suitable type? Or are we saying 'type-safe' stuff just cares about TypeScript. If so, that is sad.
10.05.2025 21:48 β π 1 π 0 π¬ 0 π 0The 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?
10.05.2025 19:46 β π 3 π 0 π¬ 2 π 0I just see them as if expressions
20.04.2025 09:11 β π 2 π 0 π¬ 0 π 0Types 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
19.04.2025 18:38 β π 3 π 0 π¬ 1 π 0Maybe a unpopular opinion but type level code actually looks nice after you get used to it
19.04.2025 18:31 β π 4 π 0 π¬ 2 π 0I 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
13.03.2025 10:43 β π 1 π 0 π¬ 0 π 0Realisation 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.
13.03.2025 09:35 β π 2 π 0 π¬ 1 π 0There 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.
12.03.2025 13:41 β π 1 π 0 π¬ 0 π 0I want to hope types will get more ambitious with a faster typescript. Not more sloppy. That would be sad
12.03.2025 08:56 β π 3 π 0 π¬ 1 π 0Completely gobsmacked. Never thought I would see the day this type checks in less than a second
11.03.2025 17:38 β π 4 π 0 π¬ 0 π 0I use mapped types when i want to transform an object or tuple
10.03.2025 19:21 β π 0 π 0 π¬ 0 π 0I prefer to use distributive conditionals to transform unions
10.03.2025 19:20 β π 0 π 0 π¬ 0 π 0I prefer to compose types bottom up with interfaces rather than top down with Omit or Pick
10.03.2025 19:20 β π 0 π 0 π¬ 0 π 0Mapped types are great. I just see them used in places where I would not all the time
10.03.2025 19:18 β π 1 π 0 π¬ 3 π 0Of course intuitions on this is good for library authors to build. Devs should just keep thinking in terms of structural typing imo
06.03.2025 19:28 β π 0 π 0 π¬ 0 π 0And you can go even further by adding variance annotations
06.03.2025 19:26 β π 1 π 0 π¬ 1 π 0So sometimes you can just replace an anonymous object literal type with a named type
06.03.2025 19:25 β π 1 π 0 π¬ 1 π 0