Re:Why is the JavaScript ecosystem like this
by alkonaut on Wednesday January 04, 2023 @05:02PM
(#34252516)
To switch from JS to TS I’m willing to give up absolutely anything. I’d do five minute build times per small source file to do TS.
[ Parent
| on HN ]
Re:Why is the JavaScript ecosystem like this
by javajosh on Wednesday January 04, 2023 @06:10PM
(#34253316)
TS is probably as good as transpilers get. It really is quite good. I like that it maps one ts file into one js file and creates readable code (although output is normally bundled so readability is lost). I like that ts aids dev discovery in tools (intellisense) at write-time. But ts still needs a build step, and that's a big down-side to the immediacy of "plain" javascript.
If browser vendors bundled tsc or its equivalent then we'd both be stoked.
Re:Why is the JavaScript ecosystem like this
by ElectricalUnion on Thursday January 05, 2023 @11:39AM
(#34262452)
> If browser vendors bundled tsc or its equivalent then we'd both be stoked.
Not exactly this, but there was a proposal that would allow for typescript type hints to be considered as normal JS syntax: (in the same way python PEP 484 – Type Hints are considered optional type hints)
https://github.com/tc39/proposal-type-annotations
Deno on the server side is pretty cool and uses https://swc.rs/ (Speedy Web Compiler) - doesn't take forever to start, but kinda implements typescript as if it was just a type annotations without the more in-depth actual type checking, so it is possible.
Re:Why is the JavaScript ecosystem like this
by erik_seaberg on Thursday January 05, 2023 @03:19PM
(#34265920)
Having a build step is our only hope of being able to extend and customize the language.