Skip to content

Commit

Permalink
feat(angular): Updates for Angular 7
Browse files Browse the repository at this point in the history
As already sketched in #423,
we are already using Angular 7 with uirouter/angular over at opf/openproject
and meanwhile in production as well, so we can safely attest that the current
version of uirouter works unchanged with even the recent Angular 7.2.2 release
with only some minor hassle during the upgrade due to the peer depedndency.

This PR tries to add the dependency and a downstream test.

I had to bump the local typescript version to ensure RxJS is being
built, without it `ngc` will output the following errors

node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected.

This is due to this issue: ReactiveX/rxjs#4511
Using the newest typescript also uncovered an issue in `uiSrefStatus.ts`.

In all downstream tests with TS < 2.8., I pinned rxjs to avoid the same
issue.
  • Loading branch information
oliverguenther authored and christopherthielen committed Feb 4, 2019
1 parent 960048e commit 7f3132a
Show file tree
Hide file tree
Showing 37 changed files with 26,239 additions and 12 deletions.
1 change: 1 addition & 0 deletions downstream_projects.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"angular5": "./test-angular-versions/v5",
"angular6": "./test-angular-versions/v6",
"angular7": "./test-angular-versions/v7",
"typescript2.3": "./test-typescript-versions/typescript2.3",
"typescript2.4": "./test-typescript-versions/typescript2.4",
"typescript2.5": "./test-typescript-versions/typescript2.5",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"@uirouter/rx": "0.5.0"
},
"peerDependencies": {
"@angular/common": "^5.0.0 || ^6.0.0",
"@angular/core": "^5.0.0 || ^6.0.0",
"@angular/router": "^5.0.0 || ^6.0.0"
"@angular/common": "^5.0.0 || ^6.0.0 || ^7.0.0",
"@angular/core": "^5.0.0 || ^6.0.0 || ^7.0.0",
"@angular/router": "^5.0.0 || ^6.0.0 || ^7.0.0"
},
"devDependencies": {
"@angular/animations": "^6.1.2",
Expand Down Expand Up @@ -90,7 +90,7 @@
"ts-loader": "^3.5.0",
"tslib": "^1.9.3",
"tslint": "^5.11.0",
"typescript": "~2.7.2",
"typescript": "^3.2.4",
"webpack": "^3.11.0",
"webpack-dev-server": "^3.1.4",
"zone.js": "^0.8.20"
Expand Down
2 changes: 1 addition & 1 deletion src/directives/uiSrefStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class UISrefStatus {
this._srefChangesSub = this._srefs.changes.subscribe(srefs => this._srefs$.next(srefs));

const targetStates$: Observable<TargetState[]> = this._srefs$.pipe(
switchMap((srefs: UISref[]) => combineLatest<TargetState>(srefs.map(sref => sref.targetState$)))
switchMap((srefs: UISref[]) => combineLatest<TargetState[]>(srefs.map(sref => sref.targetState$)))
);

// Calculate the status of each UISref based on the transition event.
Expand Down
Loading

0 comments on commit 7f3132a

Please sign in to comment.