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

Typescript support #51

Closed
7 tasks done
ngbinh opened this issue Sep 17, 2014 · 14 comments
Closed
7 tasks done

Typescript support #51

ngbinh opened this issue Sep 17, 2014 · 14 comments

Comments

@ngbinh
Copy link
Contributor

ngbinh commented Sep 17, 2014

  • Test for TypeScript app
  • Modify build to support TypeScript
  • Use tsd to automatically pull in references
  • Test for TypeScript modules, controller and route
  • Correct implementation of route utils
  • Correct TypeScript templates
  • Support other types
@dustinspecker
Copy link
Owner

Typescript is something I'd like to include in this generator (possibly Dart). Unfortunately, I don't have any experience with Typescript, so this may be a while.

@dustinspecker
Copy link
Owner

Hi,

I've been looking into TypeScript the last few days and have a few questions regarding your opinion, if you have time.

https://github.com/Keats/ng-boilerplate seems like a nice starting point. I haven't found a use for TypeScript's modules, though. Do you typically create modules when working with TypeScript? Importing the modules in a main app module doesn't sound too flexible, which are the only examples of modules used in Angular I've found.

I'm completely on board for adding TypeScript's typing, interfaces, and classes; I just want to make sure I'm not overlooking TypeScript's modules. I will probably have time to get these added soon.

@ngbinh
Copy link
Contributor Author

ngbinh commented Oct 30, 2014

Great! I am also not sure about Typescript module because it seems to share the same functionalities as angular module.

Also, I will be able to help with adding Typescript because I need it soon in a project.

@ngbinh
Copy link
Contributor Author

ngbinh commented Nov 1, 2014

I will work on this in a couple of days. Please let me know if you already started on this.

@dustinspecker
Copy link
Owner

Sounds good. I haven't started on it.

@ngbinh
Copy link
Contributor Author

ngbinh commented Nov 3, 2014

Feel free to add more tasks or take on any of them. By the look of it, I feel like utils/route is the more challenging one.

@ngbinh
Copy link
Contributor Author

ngbinh commented Nov 3, 2014

As for Typescript and AngularJs module, I feel like the current best solution is to have generate a new Typescript module along side with AngularJs module.

@dustinspecker
Copy link
Owner

I looked into this some more. TypeScript modules will need to be used, especially when passing functions is enabled. TypeScript modules allow us to have multiple functions with the same name (config, etc.) in the application, otherwise throws a compile error. Also, classes will have to be defined before we pass it to angular.module().controller(), etc. since TypeScript compiles it to JavaScript variable instead of function, so this causes hoisting issues. I'll try to get these changes added later this week/weekend, which should just about get this done. Then just the Karma issue.

@ngbinh
Copy link
Contributor Author

ngbinh commented Dec 16, 2014

Working on Karma one now

@dustinspecker
Copy link
Owner

I think I have the available typings pulled in. It also runs tsd reinstall && tsd rebundle at setup to create the typings/tsd.d.ts file. Currently, I'm using tsd@next. I've updated the app source templates and those should be working. I think there are a few typings missing. I haven't looked at the test templates, yet, but I'll have time the next couple of days to cover this and the temp directory.

@ngbinh
Copy link
Contributor Author

ngbinh commented Dec 26, 2014

Great! Thanks

@ngbinh
Copy link
Contributor Author

ngbinh commented Jan 17, 2015

FYI, I've been using TypeScript in ng-poly in production for a while without major problem. Obviously, the module system can be improved but it is not a major problem for us.

@dustinspecker
Copy link
Owner

That's great to hear. Do you guys have any suggestions for improving the modules?

The Gulpfiles have been updated to build the app and tests in a tmp directory for unit tests. The templates are updated. Unfortunately, there is an issue with angular-protractor and jQuery conflicting (DefinitelyTyped/DefinitelyTyped#2734) for e2e tests.

@ngbinh
Copy link
Contributor Author

ngbinh commented Jan 22, 2015

Awesome! Thanks a lot! I will update our build to the latest version.

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