3 ms·
> Take it from a massive TypeScript nerd: JSDoc is not an anti-TypeScript position to take. It is the same powerful static analysis without the build step. Ahu
by tobyhinloopen 10mo ago
> Take it from a massive TypeScript nerd: JSDoc is not an anti-TypeScript position to take. It is the same powerful static analysis without the build step.
Ahum https://nodejs.org/en/learn/typescript/run-natively https://nodejs.org/en/learn/typescript/run-natively
- eevilspock 10mo agothat's limited to node. won't work in a browser.
- tobyhinloopen 10mo agoOh right I forgot Javascript also runs in a browser
- spoiler 10mo agoTechnically there's still a build step happening under the hood! But another benefit of shifting TS into JSDoc comments is that it also works in browsers. That being said, while I understand the aversion to unnecessary complexity, I'm personally fine with a build step to remove TS. It's a much nicer syntax IMO. And with tools like `swc` for type stripping, it's pretty snappy too.