News for hackers. Stuff that matters.
Re:An approach to optimizing TypeScript type checking perfor... by MonstraG on Wednesday August 14, 2024 @05:59AM (#41244404)
Can you share what was the problem, just in case we have it too?
Re:An approach to optimizing TypeScript type checking perfor... by eddd-ddde on Wednesday August 14, 2024 @12:49PM (#41248090)
I'd bet it had to do with complex templates.

I've had typescript break on me when using libraries like elysia that go full send on their templates.

Re:An approach to optimizing TypeScript type checking perfor... by kevingadd on Wednesday August 14, 2024 @02:55PM (#41249337)
We had little strings that encoded call signatures, like "iiff" for int int float float. Someone cooked up a way to have typescript validate the strings at build time, but the way it does typechecks against string literals like that seems to cause every string literal in your entire compilation to get validated in advance to figure out whether it could possibly be that specific type. Each possible value - let's say we had 'f', 'i', and 'l' originally and then we added a fourth option for 'd' - caused the typecheck time to magnify by increasing the possible options. IIRC.