Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Support TypeScript #15

Open
7 tasks
alexlafroscia opened this issue May 30, 2017 · 2 comments
Open
7 tasks

Support TypeScript #15

alexlafroscia opened this issue May 30, 2017 · 2 comments

Comments

@alexlafroscia
Copy link
Collaborator

alexlafroscia commented May 30, 2017

  • Prompt user to see if they want TS support
    • Support TS flag as an argument as well
  • Automatically install additional required TS development dependencies
  • Generate TS files for app files
    • index.js
    • Style utility
  • Generate TS files for additional components without asking again for the user's preference

Useful links

@mattdsteele
Copy link

mattdsteele commented Jun 14, 2017

Off topic a bit, but I'm curious how you were thinking of handling "Generate TS files for app files".

We're looking to build an internal generator and provide TypeScript as an option, but I don't really want to have to maintain both a .js and a .ts version of each file.

The least bad option I can think I was considering having the "canonical" files be written in TypeScript, and then if the user chooses to use JS code, we'd run the sources through tsc with target: es2015, and emit those files.

But, I haven't seen this in any other generators, so I'm interested in what your thoughts were. Cheers!

@alexlafroscia
Copy link
Collaborator Author

I haven't really thought much about it at all, really. I don't use TypeScript at all, but it's something I'd like to support here since we have the definitions and @Hotell is so passionate about it ;)

I think your idea of making the TS files the "canonical" ones and then transpiring away anything not in JS when generating the JS versions would be interesting.

However, since the Skate source is going to be in Flow, it might make more sense to do that with Flow instead (having the types in there by default and optionally removing them when generating a new component).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants