Re:Svelte is migrating from TypeScript to JSDoc
by bottlepalm on Wednesday May 10, 2023 @05:41PM
(#35893907)
What if TypeScript could compile to JS with JSDoc instead of source maps? Would that solve this for everyone?
[ Parent
| on HN ]
Re:Svelte is migrating from TypeScript to JSDoc
by mtone on Thursday May 11, 2023 @03:51AM
(#35899119)
There was talk about introducing type syntax as valid but ignored in the JS language, making TS valid JS.
It would take forever to become mainstream but if node and major browsers started to support this tomorrow, along with ESM modules we could drop TS compilation and bundling entirely during development, safely publish npm packages as TS (even a bundled TS) and simplify tooling for monorepos, IDEs, etc.
Unfortunately that wouldn't solve dealing with templates like JSX/TSX or future language syntax/features.
https://devblogs.microsoft.com/typescript/a-proposal-for-typ...
Re:Svelte is migrating from TypeScript to JSDoc
by bottlepalm on Friday May 12, 2023 @02:06PM
(#35919823)
Right yea that solution would be many years out and doesn't work for JSX. As opposed to compiling to JS/JSDoc which could be done today and should solve our problems with stepping into NPM package code without dead ends.