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

all-definitions.d.ts referenced where? #1

Closed
mattiLeBlanc opened this issue Feb 5, 2016 · 9 comments
Closed

all-definitions.d.ts referenced where? #1

mattiLeBlanc opened this issue Feb 5, 2016 · 9 comments

Comments

@mattiLeBlanc
Copy link

Hi,

Thanks for your skeleton. It helped me a lot in getting angular + meteor + typescript to work.
Just wondered where the all-definitions.d.ts is loaded, cause you combine the custom and tsd here, I assumed that would be referenced in the tsd.json as the bundle file?

@Namek
Copy link
Owner

Namek commented Feb 6, 2016

As you said, all-definitions.d.ts bundles our custom typings and tsd's types and it's listed in tsconfig.json

tsd itself is deprecated right now, it would be better to transform it to https://github.com/typings/typings (more here: DefinitelyTyped/tsd#269). PRs are welcomed 😉

Also please note that there's a newer version of angular-meteor which simplifies some bits: http://info.meteor.com/blog/angular-meteor-1.3

@mattiLeBlanc
Copy link
Author

Yes, I am running the latest Angular 1.3. However the blogpost doesn't mention anything about TypeScript since that is only used in Angular 2, right. Angular 1.4 probably runs mostly with es6.
However that is besides the point.

So if I understand correctly, the tsd is deprecated (now already.. I just started using it...darn). I am having a tsd.json which has the bundle option pointing to the tsd.d.ts. I also have the tsconfig.json in where I have referenced the files as you do in your skeleton.
Is that something we can automate, or every time I create a new TS file for controller or service I have to register it in that file?

I will have a look at those typings links you mentioned.

Thanks.

***edit: That new Typing package looks great, I will migrate immediately.

@Namek
Copy link
Owner

Namek commented Feb 6, 2016

TypeScript is internally used in Angular 2. But I decided to use it on top of Angular 1.x anyway because it helps with development (types for the win!). In the end TypeScript is transpiled to JavaScript anyway, so it will work with A1. That was the point of my article - explain configuration of Angular + TypeScript combo aaaand add Meteor into that also. I've spent a huge number of hours on it then, not sure how up to date it is right now since I moved to Angular 2 recently and I'm not playing with Meteor right now (but I plan to for sure!).

tsconfig.json has files section which you probably want to update. Atom editor (with atom-typescript plugin) updated it for me automatically when filesGlob was configured properly. Right now I code in TypeScript with PhpStorm (from JetBrains) and in this editor I have to do it manually, unfortunately. List of file in this config helps linter and compiler to pick proper files. In PhpStorm if I try to import some service/controller/whatever_my_code which is not listed in there then PhpStorm shows an error on import line and tells me I have to include the file in tsconfig.json (or compiler will ignore it! probably).

If you happen to transform tsd to `typings successfully and pure template will work then you could PR it to me, it could be useful to someone else in future.

@mattiLeBlanc
Copy link
Author

Have you looked at Angular2now (https://github.com/pbastowski/angular2-now). I might switch to that instead of using the Meteor package pbastowski:typescript.

I actually building for a production environment for a financial company, so I have to advocate using certain technologies that have been proven. Angular 2 is still to much beta ( i think ) so working in A1.4 using A2 style seems to be the best solution for now.

For IDE I use Sublime3 and Code (which has very nice TS integration).

When I have update my project I will do the same for the skeleton and PR it, no worries.

@mattiLeBlanc
Copy link
Author

About the files section in the tsconfig.json: for Visual Studio Code it works as follows: if I don't specify the files in the json file, Code tells me it will look for all the TS files himself.
If I do specify them, then it will only use those the are specified.
Same for Webstorm maybe?

@Namek
Copy link
Owner

Namek commented Feb 6, 2016

Have you looked at Angular2now (https://github.com/pbastowski/angular2-now). I might switch to that instead of using the Meteor package pbastowski:typescript.

That's a choice between having TypeScript or having migration path to A2. If you start a new project and really want a stable environment then I'm not sure about that exchange.

Few months ago I found that were about 4 projects that supposed to be a migration pack. In blogpost I've linked to ngForward and this https://docs.google.com/document/d/1xvBZoFuNq9hsgRhPPZOJC-Z48AHEbIBPlOCBTSD8m0Y/edit which notes angular2-now too. But I think it may not be stable as much or even more as Angular 2 itself is. Probably won't break much things but things like this one still happen: http://angularjs.blogspot.com/2016/02/angular-2-templates-will-it-parse.html (they changed some syntax 3 days ago)

Maybe you should use A1.5 if you plan migration to A2 in the future? http://angularjs.blogspot.com/2016/02/angular-150-ennoblement-facilitation.html

I actually building for a production environment for a financial company, so I have to advocate using certain technologies that have been proven. Angular 2 is still to much beta ( i think ) so working in A1.4 using A2 style seems to be the best solution for now.

Honestly, I agree. Routing in A2 lacks some features and I've read somewhere that they are going to redesign it. The rest of A2 looks OK to me (note I don't use server-side rendering and such things).

And as I argumtented before, angular2-now doesn't sound "proven" for me.

For IDE I use Sublime3 and Code (which has very nice TS integration).

Good to know. Last time I used it was terrible integration or none. I came from Sublime to Atom and then to PhpStorm. Tried VSCode too but in some of our projects we use PHP and my development improved a little thanks to PhpStorm (intellisense, code-completion, better linting) so... yeah, that's obvious.

@mattiLeBlanc
Copy link
Author

I had a chat with Pbastowski and he mentions that his angula2now is only syntactic sugar on top of angular 1.4 or any future 1.x versions. He uses it for a couple production projects without any issues.
I reckon it is still in Typescript so I will have a look at it next week after I deliver my prototype.

About IDE: Typescript integration in Sublime3 is a bit clunky, but I love the speed and taboverlay of Sublime. Code is great with the intellisense. It's based on Chrome if I am correct and it features a similar package system. Pretty good. Only think I don't like is not having tabs of open files like in Sublime.

@Namek Namek closed this as completed Feb 8, 2016
@Namek
Copy link
Owner

Namek commented Feb 15, 2016

@mattiLeBlanc Just a small note to IDEs: Looks like tsconfig.json property made for atom: { rewriteTsconfig: true } works in PhpStorm too. So it's cool. I also got some info from JetBrains employee that the next PhpStorm version is going to have improved support for TypeScript.

@mattiLeBlanc
Copy link
Author

okay. good to know.

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

No branches or pull requests

2 participants