CREATOR OF SVELTE From TS TO JSDoc??

preview_player
Показать описание
Recorded live on twitch, GET IN

MY MAIN YT CHANNEL: Has well edited engineering videos

Discord

Рекомендации по теме
Комментарии
Автор

My biggest issues with TypeScript, aside from having a compilation step, is that some devs tend to go nuts with the TypeScript.

AttilaButurla
Автор

The declarationMap: true ts compiler config generates maps for the d.ts files, so if you have an npm package with the dist folder, and the src folder, you can have direct mapping to the ts files for ctrl/cmd+click. (see RXJS)

lajosviktor
Автор

from a library development perspective it makes perfect sense. im not sure if people will understand this nuance before making the switch to jsdoc though LOL

Zashxq
Автор

We don't use TS where I work thus I heavily rely on JSDocs. Great to know there's a repo I can borrow ideas from. But given the choice, TS all the way.

collinslagat
Автор

Guy makes some good arguments. As a security focused individual, I do like the idea of cleaner code to audit; encouraging function descriptions may result in identifying logic issues, not just typing issues.

AlecMaly
Автор

The more I learn about Rich, the bigger the fan I become. He's just smart and pragmatic, so I'm just going to learn Svelte and know that my tech stack is in good hands.

Xe
Автор

things are going to shake up again once the types as comments proposal gets added to JS.

Dev-Siri
Автор

The biggest reason for people needing to go to source is mainly not to change stuff, but to figure out what the hack is going on because very rarely anything is documented properly.

superalexreal
Автор

This sounds like some solid reasoning on why to use JSDoc for library code. Never really thought about it this way.

jon
Автор

Thanks for the bluesky link, it must have been tough to find.

TankorSmash
Автор

The solution seems to be compiling to js + jsdoc instead of d.ts, or native TS support in browsers/node

jonathancrowder
Автор

Rich's argument is the reason why I use Deno exclusively for the last 5-6 months for my personal projects. When you go to definitions Deno actually shows you the typescript code that's running. No bs .d.ts . Still today I have not found a solid reason not to go with Deno when doing TS/JS work.

georgespanos
Автор

Am I the only one to get Rick Rolled after clicking on Rich's "Blue Sky" link 😭

mohamedaalabou
Автор

The reasoning sounds solid, but I really like TS as an extra layer for "classic" products, if you work in a non Netflix company (sorry for the shade) you will see how much issues it prevents, if you get strict with it, all the "of undefined" and "of null" issues, plus, it is a nice safeguard and doc when working with people having different levels. It is true though, that devs who don't have sufficient knowledge tend to spend a huge amount of time trying to fix types, but most of those are actual issues that would need solving anyway. Inferred types do a lot of heavy lifting too and I like them. Now what I don't like about TS is the false sense of security when dealing with REST api results per example, or when people use any or as unknown as T. But, overall in product teams, I find it really benificial.

real_ouss
Автор

Me as a laravel developer always hopping into vendor code

yungifez
Автор

I love the callout about "Typescript wizards"!

So much of what I've seen from YouTube's Typescript wizard seem to suggest we should actually use a bunch of rather complicated types filled with tons of logic which honestly no one can read without really sitting down and thinking about it for a while. That nonsense helps no one, types are there to help write and read code correctly and ideally save some time but all that goes away if I'm writing and reading types endlessly instead of writing more meaningful code. Keep types but keep them as simple and straightforward as possible, no need to keep them DRY if it's gonna cause headaches!

baka_baca
Автор

If this came from an avid TypeScript aficionado I would look deep into the reasoning and thoughts behind it. But Svelte has always dragged their feet when it comes to TS support. So I don't think this decision bears much weight in the grand scheme of things.

DrsHWolfenstein
Автор

I think that jsdoc can greatly benefit from some type of type hint where your editor adds the types next to your function arguments for example, like what happens in rust when you have an implicitly typed variable. That would basically solve the readability problem.

mathijsfrank
Автор

wait what did you put in rich's bluesky link 🤣

vivsh.
Автор

also i got completely blindsided by rich's argument about changing vendor code. i didn't dive too deep into js before jumping into js and coming from the c world where that is a daydream I didn't even think typescript sucked at that. I would give up that for proper types any day though. when rich said why wouldn't you want to write your library in js, I had so many points. lmao.

sortof