DEV Community

Cover image for JavaScript vs. TypeScript for Open Source: Seeking the Community's Thoughts πŸ€”

JavaScript vs. TypeScript for Open Source: Seeking the Community's Thoughts πŸ€”

OpenSource on September 22, 2023

Hey there, fellow devs! We're at a crossroads with our open-source project, Webcrumbs, and would love your perspective. We're deliberating between...
Collapse
 
redbar0n profile image
Magne • Edited

I recommend either TS with types greyed out (color-wise) in the IDE (so they don't clutter reading of the JS code), or JSDoc TS. Types are especially important for OSS libraries that others use and rely on, but beware that you might have to create some complex typings from time to time (can be time consuming, hence the DHH drama), to give your API consumers the best experience.

Collapse
 
usulpro profile image
Oleg Proskurin

Hey!

Typescript has become almost a standard nowadays. Especially if you are providing any library that other developers will use. Moreover, the typescript cons you mentioned are not so critical, let me comment on them:

  • you will have a compilation step in any case even without a typescript
  • the learning curve is not so difficult, rather on the contrary, in my experience, new developers are more comfortable onboarding a project with a typescript

Another disadvantage of typescript that you did not mention is that if you take typing seriously, you will have to think through twice as many things on the project and this will require additional costs, of course. Now it’s up to you to decide whether it’s worth investing in it.

Happy coding! :)

Collapse
 
opensourcee profile image
OpenSource Webcrumbs

Thank you, my friend.

Collapse
 
syeo66 profile image
Red Ochsenbein (he/him) • Edited

I think one point simply asks for static typing: the plugin interface. However this would still leave the question open JSDoc or Typescript. I think deployment is simpler when using JSDoc because it does not require a build step. But Typescript is probably easier to maintain than proper JSDoc (with its rather cumbersome syntax for more complex stuff)

Collapse
 
opensourcee profile image
OpenSource Webcrumbs

Really appreciate. Cheers

Collapse
 
peerreynders profile image
peerreynders

Apart from the DHH drama I think the tension really is TS vs TS JSDoc.

See my comments here.

Collapse
 
opensourcee profile image
OpenSource Webcrumbs

We’ll get there! Thanks, friend