What is Nostr?
jcbrand / JC Brand
npub1pur…nndd
2023-07-27 07:49:25

jcbrand on Nostr: Quite a while back, I read about how the #Svelte devs used JSDoc type hints together ...

Quite a while back, I read about how the #Svelte devs used JSDoc type hints together with the #TypeScript compiler to add types to Svelte while keeping the actual code #JavaScript.

I've decided to do the same with the #XMPP library Strophe.js

https://github.com/strophe/strophejs

Strophe now contains type declaration files generated from the JSDoc type hints (not yet released).

My experience is a bit mixed.

Writing JSDoc types is more verbose and feels a bit more clunky than writing TypeScript.

But on the other hand, you avoid introducing a compilation step and the code itself doesn't have to change much.

For relatively small libraries like Strophe it's worth considering.

Author Public Key
npub1purzvv7zzxqymk9q53qmjvlvlrwhy4dsyjt77nxjym9m77e62wtsnlnndd