Skip to content

[HELP WANTED] Add types for TS/Flow #1812

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

Open
Awk34 opened this issue Apr 21, 2016 · 1 comment
Open

[HELP WANTED] Add types for TS/Flow #1812

Awk34 opened this issue Apr 21, 2016 · 1 comment
Assignees
Milestone

Comments

@Awk34
Copy link
Member

Awk34 commented Apr 21, 2016

Add type annotations for TypeScript & Flow.

As of 3.7.0-beta.1, the generator runs template files through EJS, then Babel, and then a beutifier before writing them to your scaffold directory. This means that now we can include things like type definitions, and have an option to include them or not. You can see the first type annotation I added here: auth.service.js#L23.

It would be a fairly large undertaking to manually add type annotations to every file in the whole project, so I'm looking to the community for help. Here's what to do if you'd like to help:

  • branch off of the canary branch
  • templates are located in the templates folder.
  • it would be easiest if type definitions submitted work with both TypeScript and Flow
  • you can include TS/Flow specific code by using EJS (use filters.ts and filters.flow)
<%_ if(filters.ts) { _%>
interface thing {
  func(value: any): string;
}<% } %>

Comment here if you'd like to help out.

@Awk34 Awk34 added the major label Apr 21, 2016
@Awk34 Awk34 added this to the Soon milestone Apr 21, 2016
@Awk34 Awk34 changed the title Add types for TS/Flow [HELP WANTED] Add types for TS/Flow Apr 24, 2016
@Koslun Koslun self-assigned this Jun 17, 2016
Koslun added a commit that referenced this issue Jun 20, 2016
Adds type annotations to most javascript files in the project.

Closes #1812
@Koslun
Copy link
Member

Koslun commented Jun 26, 2016

So most of the client is typed in the ts-stuff branch, however almost all of it is scoped to only ts. Could change some of the things that does not inherit from TypeScript definition files to also work with flow. As Flow does not, and seemingly not in the short-term will, support typescript definition files, see flow issue 7.

Particularly useful to split auth functions on client into asynchronous and synchronous versions. Can then at least type the synchronous versions with flow while the asynchronous uses angular promises and thus likely need to stay typed only with TypeScript.

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

2 participants