News for hackers. Stuff that matters.
Re:TypeScript team released an explorer for performance tuning by mcluck on Saturday May 13, 2023 @09:42AM (#35928294)
You're mixing a couple of ideas. There is a proposal[1] to allow for type annotations in the browser but it's only a subset of what's possible in TS. As for barreling/bundling, that's never been a goal for TypeScript. That's handled by tools like Webpack and ESBuild. In fact, there's an effort going the opposite direction. As browsers support ES style modules, we don't need to bundle anymore as the browser will load the relevant files as needed

[1] https://github.com/tc39/proposal-type-annotations

[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...

Re:TypeScript team released an explorer for performance tuning by jeroenhd on Saturday May 13, 2023 @10:45AM (#35928899)
I like the idea of JS modules but they don't entirely negate the need for bundling. Sending a single compressed, tree shaken, minified JS file down the pipe can be a lot more efficient than waiting for the browser to load all those files.

Theoretically HTTP/2 push could've helped here, forcing the necessary files into the browser cache, but that's been removed from browsers.

Re:TypeScript team released an explorer for performance tuning by mcluck on Saturday May 13, 2023 @10:55AM (#35928991)
Agreed. To me, browser support for modules is great for debugging but is not a suitable replacement for producing an optimized set of bundles