Skip to content

Commit 36652f1

Browse files
authored
chore: Angular 16 support (#985)
* bump to Angular 16 * Entry components are phased out since Angular 16 * Remove entryComponents references from tests * scaffold test-files for other angular versions * point towards @boxmein's fork with Angular 16 support * remove v15 test * resolve some peer dependency errors * ignore ajv * revert to sample-app-angular@master
1 parent 59d5a46 commit 36652f1

28 files changed

+2351
-1663
lines changed

downstream_projects.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"packageDir": "./dist",
33
"projects": {
44
"sample-app-angular": "https://github.com/ui-router/sample-app-angular.git",
5-
"angular15": "./test-angular-versions/v15",
6-
"typescript48": "./test-typescript-versions/typescript4.8"
5+
"typescript48": "./test-typescript-versions/typescript4.8",
6+
"angular16": "./test-angular-versions/v16",
7+
"typescript49": "./test-typescript-versions/typescript4.9"
78
}
89
}

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@uirouter/angular",
33
"description": "State-based routing for Angular",
4-
"version": "11.1.0",
4+
"version": "12.0.0",
55
"scripts": {
66
"clean": "shx rm -rf lib lib-esm _bundles _doc dist",
77
"compile": "npm run clean && ngc",
@@ -43,39 +43,39 @@
4343
"license": "MIT",
4444
"distDir": "dist",
4545
"peerDependencies": {
46-
"@angular/common": "^15.0.0",
47-
"@angular/core": "^15.0.0",
46+
"@angular/common": "^16.0.0",
47+
"@angular/core": "^16.0.0",
4848
"@uirouter/core": "^6.0.8",
4949
"@uirouter/rx": "^1.0.0"
5050
},
5151
"devDependencies": {
52-
"@angular-devkit/build-angular": "^15.0.0",
53-
"@angular/animations": "^15.0.0",
54-
"@angular/common": "^15.0.0",
55-
"@angular/compiler": "^15.0.0",
56-
"@angular/compiler-cli": "^15.0.0",
57-
"@angular/core": "^15.0.0",
58-
"@angular/platform-browser": "^15.0.0",
59-
"@angular/platform-browser-dynamic": "^15.0.0",
52+
"@angular-devkit/build-angular": "^16.0.0",
53+
"@angular/animations": "^16.0.0",
54+
"@angular/common": "^16.0.0",
55+
"@angular/compiler": "^16.0.0",
56+
"@angular/compiler-cli": "^16.0.0",
57+
"@angular/core": "^16.0.0",
58+
"@angular/platform-browser": "^16.0.0",
59+
"@angular/platform-browser-dynamic": "^16.0.0",
6060
"@types/jest": "^27.0.3",
6161
"@types/jquery": "^3.5.9",
6262
"@uirouter/core": "^6.0.8",
6363
"@uirouter/publish-scripts": "2.6.0",
6464
"@uirouter/rx": "^1.0.0",
6565
"husky": "^7.0.4",
66-
"jest": "^28.0.0",
67-
"jest-preset-angular": "^12.2.3",
68-
"ng-packagr": "^15.0.0",
66+
"jest": "^29.0.0",
67+
"jest-preset-angular": "^13.0.0",
68+
"ng-packagr": "^16.0.0",
6969
"postcss": "^8.0.0",
7070
"prettier": "^2.5.0",
7171
"pretty-quick": "^3.1.2",
72-
"rxjs": "6.6.7",
72+
"rxjs": "~7.8.0",
7373
"rxjs-compat": "^6.5.4",
7474
"schema-utils": "^4.0.0",
7575
"ts-node": "10.4.0",
7676
"tslint": "^6.1.0",
77-
"typescript": "~4.8.4",
78-
"zone.js": "0.11.4"
77+
"typescript": "~4.9.5",
78+
"zone.js": "0.13.0"
7979
},
8080
"jest": {
8181
"preset": "jest-preset-angular",

src/uiRouterNgModule.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,11 @@ export function locationStrategy(useHash) {
6969
*
7070
* State definitions found in the `states:` property are provided to the Dependency Injector.
7171
* This enables UI-Router to automatically register the states with the [[StateRegistry]] at bootstrap (and during lazy load).
72-
*
73-
* ### Entry Components
74-
*
75-
* Any routed components are added as `entryComponents:` so they will get compiled.
7672
*/
7773
@NgModule({
7874
imports: [CommonModule],
7975
declarations: [_UIROUTER_DIRECTIVES],
8076
exports: [_UIROUTER_DIRECTIVES],
81-
entryComponents: [UIView],
8277
})
8378
export class UIRouterModule {
8479
/**
@@ -218,7 +213,6 @@ export interface StatesModule {
218213
* The module's UI-Router states
219214
*
220215
* This list of [[Ng2StateDeclaration]] objects will be registered with the [[StateRegistry]].
221-
* Also, the components that the states route to will be added to `entryComponents` so they will be compiled.
222216
*/
223217
states?: Ng2StateDeclaration[];
224218

test-angular-versions/v15/README.md renamed to test-angular-versions/v16/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# V15
1+
# V16
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.0.4.
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.1.2.
44

55
## Development server
66

test-angular-versions/v15/angular.json renamed to test-angular-versions/v16/angular.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"newProjectRoot": "projects",
88
"projects": {
9-
"v15": {
9+
"v16": {
1010
"projectType": "application",
1111
"schematics": {
1212
"@schematics/angular:class": {
@@ -41,7 +41,7 @@
4141
"build": {
4242
"builder": "@angular-devkit/build-angular:browser",
4343
"options": {
44-
"outputPath": "dist/v15",
44+
"outputPath": "dist/v16",
4545
"index": "src/index.html",
4646
"main": "src/main.ts",
4747
"polyfills": [
@@ -88,18 +88,18 @@
8888
"builder": "@angular-devkit/build-angular:dev-server",
8989
"configurations": {
9090
"production": {
91-
"browserTarget": "v15:build:production"
91+
"browserTarget": "v16:build:production"
9292
},
9393
"development": {
94-
"browserTarget": "v15:build:development"
94+
"browserTarget": "v16:build:development"
9595
}
9696
},
9797
"defaultConfiguration": "development"
9898
},
9999
"extract-i18n": {
100100
"builder": "@angular-devkit/build-angular:extract-i18n",
101101
"options": {
102-
"browserTarget": "v15:build"
102+
"browserTarget": "v16:build"
103103
}
104104
},
105105
"test": {

test-angular-versions/v15/package.json renamed to test-angular-versions/v16/package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
{
2-
"name": "15",
2+
"name": "16",
33
"version": "0.0.0",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
77
"build": "ng build",
88
"watch": "ng build --watch --configuration development",
99
"test": "npm run test:dev && npm run test:prod",
10-
"test:dev": "ng build --configuration development && cypress-runner run --path dist/v15",
11-
"test:prod": "ng build --configuration production && cypress-runner run --path dist/v15"
10+
"test:dev": "ng build --configuration development && cypress-runner run --path dist/v16",
11+
"test:prod": "ng build --configuration production && cypress-runner run --path dist/v16"
1212
},
1313
"private": true,
1414
"dependencies": {
15-
"@angular/animations": "^15.0.0",
16-
"@angular/common": "^15.0.0",
17-
"@angular/compiler": "^15.0.0",
18-
"@angular/core": "^15.0.0",
19-
"@angular/forms": "^15.0.0",
20-
"@angular/platform-browser": "^15.0.0",
21-
"@angular/platform-browser-dynamic": "^15.0.0",
22-
"@angular/router": "^15.0.0",
23-
"rxjs": "~7.5.0",
15+
"@angular/animations": "^16.1.0",
16+
"@angular/common": "^16.1.0",
17+
"@angular/compiler": "^16.1.0",
18+
"@angular/core": "^16.1.0",
19+
"@angular/forms": "^16.1.0",
20+
"@angular/platform-browser": "^16.1.0",
21+
"@angular/platform-browser-dynamic": "^16.1.0",
22+
"@angular/router": "^16.1.0",
23+
"rxjs": "~7.8.0",
2424
"tslib": "^2.3.0",
25-
"zone.js": "~0.12.0",
25+
"zone.js": "~0.13.0",
2626
"@uirouter/angular": "*",
2727
"@uirouter/cypress-runner": "*"
2828
},
2929
"devDependencies": {
30-
"@angular-devkit/build-angular": "^15.0.4",
31-
"@angular/cli": "~15.0.4",
32-
"@angular/compiler-cli": "^15.0.0",
30+
"@angular-devkit/build-angular": "^16.1.2",
31+
"@angular/cli": "~16.1.2",
32+
"@angular/compiler-cli": "^16.1.0",
3333
"@types/jasmine": "~4.3.0",
34-
"jasmine-core": "~4.5.0",
34+
"jasmine-core": "~4.6.0",
3535
"karma": "~6.4.0",
36-
"karma-chrome-launcher": "~3.1.0",
36+
"karma-chrome-launcher": "~3.2.0",
3737
"karma-coverage": "~2.2.0",
3838
"karma-jasmine": "~5.1.0",
39-
"karma-jasmine-html-reporter": "~2.0.0",
40-
"typescript": "~4.8.2"
39+
"karma-jasmine-html-reporter": "~2.1.0",
40+
"typescript": "~4.9.5"
4141
},
4242
"checkPeerDependencies": {
4343
"ignore": [

test-angular-versions/v15/src/index.html renamed to test-angular-versions/v16/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>V15</title>
5+
<title>V16</title>
66
<base href="/">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
88
<link rel="icon" type="image/x-icon" href="favicon.ico">
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { UIRouter } from '@uirouter/angular';
2+
console.log(UIRouter); // tslint:disable-line:no-console
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@uirouter/angular-test-typescript4.9",
3+
"version": "1.0.0",
4+
"description": "Test against Typescript 4.9",
5+
"scripts": {
6+
"test": "tsc"
7+
},
8+
"author": "",
9+
"license": "MIT",
10+
"dependencies": {
11+
"@angular/common": "^12",
12+
"@angular/core": "^12",
13+
"@uirouter/angular": "latest",
14+
"rxjs": "^6.0.0",
15+
"typescript": "4.9"
16+
},
17+
"devDependencies": {}
18+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"moduleResolution": "node",
4+
"module": "commonjs",
5+
"lib": ["es6", "dom"],
6+
"noImplicitAny": true,
7+
"noEmit": true,
8+
"target": "es5",
9+
"typeRoots": ["node_modules/@types"]
10+
},
11+
"files": ["index.ts"]
12+
}

test/ngModule/augment/augment.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,5 @@ export function config(router: UIRouter, injector: Injector, module: StatesModul
3131
@NgModule({
3232
imports: [UIRouterModule.forChild({ config })],
3333
declarations: [Component1, Component2],
34-
entryComponents: [Component1, Component2],
3534
})
3635
export class AugmentModule {}

0 commit comments

Comments
 (0)