Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we move to TypeScript? #388

Closed
fahad19 opened this issue Dec 18, 2017 · 5 comments
Closed

Should we move to TypeScript? #388

fahad19 opened this issue Dec 18, 2017 · 5 comments

Comments

@fahad19
Copy link
Member

fahad19 commented Dec 18, 2017

This is an issue for collecting feedback on whether writing FrintJS source in TypeScript is a good idea or not.

Some questions that I would like everyone to answer:

  • Does it add value? How?
  • What are the disadvantages?
  • Our manually written typings are out of sync, would it help maintenance by moving to TS?

If all positive:

  • Who can volunteer to help?
@fahad19 fahad19 changed the title TypeScript Should we move to TypeScript? Dec 18, 2017
@markvincze
Copy link
Contributor

In short: I'd absolutely support it.

Pros:

  • Makes code more reliable, the static compilation is a first safety net before unit tests are run.
  • Type definition files don't have to be maintained manually.
    (And maybe the structured comments are also better picked up by the tooling this way? I'm not sure)
  • It's easier to jump in development and discover what certain types/functions can do due to the type system holding our hands.

Cons:

  • Some TypeScript knowledge will be needed to do development on frint, this might discourage people who don't know or like it.
    (On the other hand it might make frint more interesting for TypeScript-fans 🙂)
  • Maybe the webpack/lerna/etc. config has to become more complicated?

I'd be happy to help, but can't make promises, I'm not sure how much free time I'll have :/.

@asci
Copy link
Contributor

asci commented Dec 18, 2017

Any particular way you want to write it (like C#ish way or more Flow-ish)?

We have an experience using TypeScript in our projects and what I see so far — it really matters which features will you use. Sometimes doesn't look like JS and new concepts could lead to some new issues.

Also, tooling is matter — to get most of the typescript is it better to use VSCode\Webstorm. But there still could be some problems: for example, we found an issue with tslint using async\await.

So for me would be cool to see the way you want to use it (like a guide or so)

@discosultan
Copy link
Contributor

Overall I favor the idea and I think it makes sense since we already support TypeScript through type definition files.

Pros:

  • It is easy to forget to update type definitions. Confusing consumers with stale definitions is worse than not having them at all. With source being in TypeScript, we lose this problem completely.
  • Very nice development experience for newcomers. Editors such as VS Code can provide excellent
    autocompletion, navigation and refactoring support.
  • Less bugs due to checking a large set of problems at transpile time as opposed to runtime.

Cons:

  • The source code becomes a lot more verbose.
  • Requires additional TypeScript tooling to be setup. No everyone is a fan of TypeScript and some external contributors may be turned off by this.

@fahad19 fahad19 changed the title Should we move to TypeScript? Migrate to TypeScript Feb 14, 2018
@fahad19 fahad19 changed the title Migrate to TypeScript Should we move to TypeScript? Feb 14, 2018
@fahad19
Copy link
Member Author

fahad19 commented Feb 14, 2018

Refs #406

@fahad19
Copy link
Member Author

fahad19 commented Feb 14, 2018

Yes, we are migrating.

@fahad19 fahad19 closed this as completed Feb 14, 2018
@fahad19 fahad19 mentioned this issue Feb 14, 2018
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants