Live data from Hacker News

TS to JSDoc Conversion

github.com

11–20 of 163 posts

Re: TS to JSDoc Conversion

#12
post #5
post #3

Earlier quoted context omitted.

> As a Svelte compiler developer, debugging without a build step greatly simplifies compiler development. Previously, debugging was complicated by the fact that we had to debug using the build step. In addition, using JSDoc does not affect compiler’s development safety because the type is almost equivalent to TS. > Of course, Svelte developers (not compiler developers) will still be provided type definition files as…

ts-node [1]: am i a joke to you? [1] https://www.npmjs.com/package/ts-node

ts-node is responsible for my favourite error message in all of computing.

Yes better than: 'Error: success' or 'keyboard not found: press F1 to continue'

> ts-node: Unknown file extension: ts.

Someone will reply for a technical reason about this (mentioning .mts or package.json settings or whatever) but that doesn't change the fact that a program whose only job is to run ts files should know what a ts file is. GitHub issue: https://github.com/TypeStrong/ts-node/issues/1967

tsx or @digitak/esrun both work out of the box.

Re: TS to JSDoc Conversion

#14
It always makes me chuckle when a bunch of non-contributors come out of the woodwork to provide their opinion on a change which will affect them not at all.

Re: TS to JSDoc Conversion

#16

Why would anyone do this?

In general, your code is still valid JavaScript and can run in any browser or node environment. Typescript probably is not going to disappear, but if it would, your code wouldn‘t have to change. And you don’t loose your types, because the typescript compiler can interpret jsdoc as if you were using typescript directly.

Re: TS to JSDoc Conversion

#19
If I remember right, symfony (php framework) has comments that affect how the code runs which as far as I’m concerned means they’re not comments at all but actually code masquerading as comments. Reading about JSDoc gives me the same uneasy feeling, even if it’s not quite the same thing.

Edit:

Here’s one example, you can define your routes in symfony using comments. Not only that, but it’s actually the officially recommended way of doing things. Absolute madness.

https://symfony.com/doc/current/routing.html

Post reply on HN