gramps-graphql / gramps--legacy

The core data source combination engine of GrAMPS.

Home Page:https://gramps.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move to Typescript

jlengstorf opened this issue · comments

Still interested in moving to TS? 1.0 issue mentioned 'revisiting' this?

I have mixed feelings about it. On the one hand, I like the idea of strongly typed code. On the other, I worry that it makes the codebase inaccessible to a large portion of developers. (For example, I'm going to have to actually learn TS if we make this switch, as opposed to the passing familiarity I have now. I probably wouldn't work through that for an OSS project I didn't maintain.)

So maybe there's a question to answer before making the call: is there a measurable benefit of moving to TS vs. keeping our test coverage at 100% in plain JS?

On the consumer side: you should at least provide typings, so consumers of the library get type safety when using Typescript themselves. Maybe you can create a separate issue for that, I can PR that quite easily (after #63 becomes final).

On the development side: I believe there are a lot of benefits for using Typescript, most importantly the strong typing.
I recently came across this article: https://stackify.com/typescript-vs-javascript-migrate/

I just did a tiny bit of TS: Urigo/graphql-cli#78 🤓

I definitely agree about typings. Issue created: #65

I'll read this article and think a little more on whether or not we should fully convert.

The linter doesn't really like what you did there 😄 https://circleci.com/gh/graphql-cli/graphql-cli/106