question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After considering the differences between Flow and TypeScript 2.0 I’m thinking I’d like to try moving decaffeinate to TypeScript 2.0. @alangpierce’s comment is pretty spot-on in terms of where the two projects stand. There probably isn’t enough benefit to justify the switch purely on technical merit. However, both @alangpierce and I have been looking for an opportunity to dig deeper into TypeScript and using decaffeinate for that purpose seems reasonable.

Why?

  • In my experience, my editor (WebStorm) has better support for TypeScript than for Flow.
  • TypeScript has superior tooling, especially around bringing types in from the @types npm namespace and automatic generation of .d.ts files.
  • Now that strictNullChecks is an option, my favorite feature from Flow is also in TypeScript (non-nullable types).
  • Configuring babel is somewhat of a headache, and I really only ever use the es2015 preset plus a handful of things, all of which are supported by TypeScript.

Roadmap

  • coffee-lex (https://github.com/decaffeinate/coffee-lex/pull/77)
    • remove .flowconfig
    • add tsconfig.json
    • rename sources to use .ts extension
    • configure rollup
    • fix type errors
    • ~emit types for dist files~ (https://github.com/rollup/rollup-plugin-typescript/issues/54)
    • refactor token types to use an enum (breaking change, assign explicit number values to prevent reordering issues)
    • remove coffee-lex.js.flow once all other projects are converted
  • decaffeinate-parser
    • add tsconfig.json
    • rename sources to use .ts extension
    • configure rollup
    • fix type errors
  • decaffeinate-traverse
    • remove .flowconfig
    • add tsconfig.json
    • rename sources to use .ts extension
    • configure rollup
    • fix type errors
  • decaffeinate
    • remove .flowconfig
    • add tsconfig.json
    • rename sources to use .ts extension
    • configure rollup
    • fix type errors

I don’t want this to interfere with any of your work, @alangpierce, so I’ll try to do things in small chunks that are unlikely to cause problems.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
alangpiercecommented, Jul 10, 2017

The core decaffeinate project is 100% TypeScript now, so I’m going to call this a success and close the issue. Technically decaffeinate-traverse is still JavaScript, but it’s not used at the moment, so seems low priority. It also might be nice to move bulk-decaffeinate and decaffeinate-examples to TS eventually, but I’ll call that out of scope for now. Given that decaffeinate produces JavaScript, might be nice to have at least a little plain JavaScript. 😄

2reactions
alangpiercecommented, Dec 1, 2016

Yep, I’m sure @types/mocha is better, I’m certainly new to all this stuff. I’ll probably put up a PR for that this weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript: JavaScript With Syntax For Types.
TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale. Try TypeScript Now. Online or...
Read more >
TypeScript - Wikipedia
TypeScript is a free and open source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript and...
Read more >
TypeScript is a superset of JavaScript that compiles ... - GitHub
TypeScript is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript ...
Read more >
TypeScript Introduction - W3Schools
TypeScript is a syntactic superset of JavaScript which adds static typing. This basically means that TypeScript adds syntax on top of JavaScript, ...
Read more >
TypeScript - The Basics - YouTube
TypeScript has forever altered the lives of JavaScript developers. Learn why TS is so awesome and the basic concepts required to be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found