Hacker News new | ask | show | jobs
by IggleSniggle 1677 days ago
Is what you’re asking for possible?

JavaScript can walk both directions on a dependency graph. You can import two things and inject the first dependency into the second.

So, unless you want to “structure your project a certain way,” you’re out of luck. If you ARE willing to conform to those patterns then you can get incremental builds.

As it happens, you can get something similar within a file by declaring a type interface, telling the compiler “you don’t need to walk the interior of this function because look see here’s the signature,” but you lose the power and dynamism of implicit types / complex generics by doing this.

I could be wrong about this; it’s been a minute since ts was my daily driver.