8
votes

I'm using VS 2015 update 3, Angular 2.1.2, Typescript 2.0.6

Can someone please clarify what typings versus npm @types versus whatever other hard to find documentation on something there is this month?

Or just point the way to documentation on what and how to use these things. Preferably the docs should be up to date.

Also, in a related sense, how does one uninstall. Everywhere I look there are helpful extensions to install packages, but nothing to uninstall that I can tell at least. I installed the Package Installer extension, but it seems rather limited.

The pain of using this stuff in Visual Studio is making want to walk away and do MVC again. Maybe it's just me, but it doesn't seem like it ought be this difficult.

1
@types is newer and supposed to be the future. Uninstall what, exactly? The angular packages? npm uninstall. There's an entire toolchain on top of Angular 2 for modern client web development and it's worth the time and investment to learn it if you think the framework itself is what you want to work with. If you don't, or if it's overkill then you are free to drop it from your work. - silentsod
Thanks. Where do I find this information out? Is there something official saying that? Sorry, but there is just so much stale information it seems, that someone that hasn't been doing it day after day is at a real disadvantage. That doesn't seem like a great way to get adoption of things. - Brandon
Have a look at this post (Simplified Declaration File (.d.ts) Acquisition section). - Aleksey L.
I just did an Angular 1.x app with Typescript 1.6 or so, but I don't really have the say to drop things, the place I work decides that in most respects. I realize there is an npm uninstall command, but when using an IDE like VS 2015 I was hoping I don't have to open up command prompts to do things? Kinda pulling my hair out with getting the right thing to use and dealiing with versions and dependencies etc...it feels like I'm back in Java land of 15 years ago on this. - Brandon
Ok, Aleksey, that link is helpful. I got Package Installer for VS 2015 from Mads Kristensen and it takes care of installing for several things including npm and typings, but no uninstall. I guess from this I need to dump using typings though and only use \@types from my package.json? The Kristensen tool doesn't seem to find anything for \@types unfortunately. - Brandon

1 Answers

7
votes

Use @types ( don't use typings )

Pros:

  • Under package.json ( update is done with npm update )
  • No need for separate packages ( typings ), files ( typings.json )...
  • Under node_modules ( cleaner directory structure )

Simplified Declaration File (.d.ts) Acquisition

https://blogs.msdn.microsoft.com/typescript/2016/09/22/announcing-typescript-2-0/