Hacker News new | ask | show | jobs
by deckard1 1206 days ago
that sounds needlessly wasteful. You can trivially strip TS out of JS before sending off to the client. You're still going to need to check TS in the build/CI step (i.e. the time consuming part) before doing anything so you've gained exactly nothing.
1 comments

"You can trivially strip TS out of JS before sending off to the client"

To quote you, that sounds needlessly wasteful to me. Also I prefer not needing to deal with SourceMaps or different source when debugging. So it's quite the contrary: I gain a lot. Different strokes for different folks.

I understand your reasoning but it seems to be focused more around developer time rather than bundle size and user experience if I am not mistaken.

The ratio between built code size and source size can easily reach orders of magnitude in TypeScript projects with exhaustive types.

Sending all that code to the user is wasteful, and this wastefulness is multiplied by X end users, as opposed to the development process which is centralized.

From a money perspective the picture is different of course.

I would still love to be able to execute TS directly in the browser, but this is purely a DX thing.