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

Migrate to Typescript 2.x and @types #177

Closed
Hotell opened this issue Nov 16, 2016 · 1 comment
Closed

Migrate to Typescript 2.x and @types #177

Hotell opened this issue Nov 16, 2016 · 1 comment

Comments

@Hotell
Copy link
Member

Hotell commented Nov 16, 2016

remove deprecated typings dependencies and expose separate file for angular type definitions extension ( for consumers of deprecated provide from ng-metadata/core)

When this is resolved, consumers which are using deprecated provide within angular 1 , .service,.directive,.filter for example: .service( ...provide(MyService) ), will have to explicitly import reference for this new type definition file from theirs global.d.ts project file like this:

// ./global.d.ts
/// <reference path="./node_modules/ng-metadata/manual_typings/angular-extension.d.ts" />

or if they are using files and include field within tsconfig.json

{
  "include":[
    "src/**/*.ts"
  ],
  "files": [
    "node_modules/ng-metadata/manual_typings/angular-extension.d.ts"
  ],
  "exclude": [
    "node_modules"
  ]
}

NOTE:
This will be a BREAKING CHANGE, so expect major version bump!

Hotell added a commit that referenced this issue Nov 20, 2016
…t them to source

- bump to typescript@next which resolves issues with type declaration generation
- extract angular module type overrides to separate file which should by included within consumer app
- make global.d.ts truly global
- use only ng.* namespace for types ( no angular )
- update tsconfig to make tsc faster, stronger ;)
- fix compile errors introduced by latest ts 2.1 with better any type inference
- fix NgModule decorator options types to properly allow registering downgraded ng2 entities

Closes #175, #177

BREAKING CHANGE:

We now officialy support only angular typings provided via npm `@types/*` and also typescript 2.x

- your existing typings provided by `typings` might not work
- from now on if you wanna use deprecated `provide` function from `ng-metadata/core` with registration within `angular.module().directive|service|filter` you have to explicitly include angular types extension provided by ng-metadata from `node_modules/ng-metadata/manual_typings/angular-extension.d.ts`

Before:
```typescript
// global.d.ts
/// <reference path="../node_modules/ng-metadata/manual_typings/globals.d.ts" />
```

After:
```typescript
/// <reference path="../node_modules/ng-metadata/manual_typings/angular-extension.d.ts" />
```

or you can include it from within your tsconfig.json like this:
```json
{
  "include":[
    "src/**/*.ts"
  ],
  "files": [
    "node_modules/ng-metadata/manual_typings/angular-extension.d.ts"
  ],
  "exclude": [
    "node_modules"
  ]
}
```
@Hotell
Copy link
Member Author

Hotell commented Nov 20, 2016

Closed by 3153bca

@Hotell Hotell closed this as completed Nov 20, 2016
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

1 participant