flaviait / ng2-jspm-template

A template for a quick development workflow with angular 2 and jspm
MIT License
14 stars 3 forks source link

Use @types modules instead of typings #32

Closed svi3c closed 8 years ago

svi3c commented 8 years ago

@DorianGrey

DorianGrey commented 8 years ago

Hm... is there any reason to not use the types-support of plugin-typescript as described here? That would prevent to manually link the particular index.d.ts files in tsconfig.json (regularly, it's possible to add a types entry there, but that one only works with properly with node's resolution mechanism).

svi3c commented 8 years ago

I'll have a look at that. Didn't notice the configuration option yet.

svi3c commented 8 years ago

Hmm ... I tried https://github.com/frankwallis/plugin-typescript#types for jasmine and lodash, but it did not work for me. The typings are not found.

DorianGrey commented 8 years ago

Hm... I can reproduce this problem, however, I'm still wondering why it doesn't work fine. This version is also used in the angular-example and (from what I've seen) works fine there. So we're either using it in a wrong way, or it's a bug in the plugin. I've added a corresponding commit here for further investigation (we may just cut it off in case we won't get this working).

@frankwallis , do you have an idea if we're using this feature in a wrong way here?

frankwallis commented 8 years ago

Sorry for taking so long to respond. I have released a fix for the lodash issue in plugin-typescript@5.2.4.

For the jasmine one you need to add

/// <reference types="jasmine"/>

to the top of todo.service.spec.js to instruct the plugin to load these types. This is similar to doing import 'jasmine' but that would fail at runtime in this situation.

DorianGrey commented 8 years ago

Thanks for the update - I've updated the dependencies and added the ref to todo.service.spec.ts, and it works fine now.

@svi3c , since I've also had to merge with master, please have a second look at this. LGTM, but ...