Skip to content

Commit 6ec4fda

Browse files
authored
Merge pull request #3 from aboudard/2-angular-16-update
feat: upgrade to angular 16
2 parents 579e90d + 11136e6 commit 6ec4fda

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+12903
-5636
lines changed

application/ng-shell/package-lock.json

Lines changed: 3837 additions & 1426 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

application/ng-shell/package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@
1111
},
1212
"private": true,
1313
"dependencies": {
14-
"@angular-architects/module-federation": "^15.0.3",
15-
"@angular/animations": "^15.2.10",
16-
"@angular/common": "^15.2.10",
17-
"@angular/compiler": "^15.2.10",
18-
"@angular/core": "^15.2.10",
19-
"@angular/forms": "^15.2.10",
20-
"@angular/platform-browser": "^15.2.10",
21-
"@angular/platform-browser-dynamic": "^15.2.10",
22-
"@angular/router": "^15.2.10",
23-
"@ngrx/store": "^15.4.0",
24-
"@ngrx/store-devtools": "^15.4.0",
25-
"core": "^15.0.0",
14+
"@angular-architects/module-federation": "^16.0.4",
15+
"@angular/animations": "^16.2.12",
16+
"@angular/common": "^16.2.12",
17+
"@angular/compiler": "^16.2.12",
18+
"@angular/core": "^16.2.12",
19+
"@angular/forms": "^16.2.12",
20+
"@angular/platform-browser": "^16.2.12",
21+
"@angular/platform-browser-dynamic": "^16.2.12",
22+
"@angular/router": "^16.2.12",
23+
"@ngrx/store": "^16.3.0",
24+
"@ngrx/store-devtools": "^16.3.0",
25+
"core": "^16.0.0",
2626
"rxjs": "~7.5.0",
2727
"tslib": "^2.3.0",
28-
"zone.js": "~0.11.4"
28+
"zone.js": "~0.13.3"
2929
},
3030
"devDependencies": {
31-
"@angular-devkit/build-angular": "^15.2.10",
32-
"@angular/cli": "~15.2.10",
33-
"@angular/compiler-cli": "^15.2.10",
31+
"@angular-devkit/build-angular": "^16.2.14",
32+
"@angular/cli": "~16.2.14",
33+
"@angular/compiler-cli": "^16.2.12",
3434
"@types/jasmine": "~4.0.0",
3535
"jasmine-core": "~4.3.0",
3636
"karma": "~6.4.0",
3737
"karma-chrome-launcher": "~3.1.0",
3838
"karma-coverage": "~2.2.0",
3939
"karma-jasmine": "~5.1.0",
4040
"karma-jasmine-html-reporter": "~2.0.0",
41-
"ngx-build-plus": "^15.0.0",
41+
"ngx-build-plus": "^16.0.0",
4242
"typescript": "~4.9.5"
4343
}
4444
}

application/ng-shell/src/app/app-routing.module.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
<ul>
2-
<li><span class="title">
1+
<header>
2+
<ul>
3+
<li><span class="title">
34
{{title}} -
45
</span></li>
5-
<li><a routerLink="home" routerLinkActive="active">Home</a></li>
6-
<li><a routerLink="users" routerLinkActive="active">Users</a></li>
7-
<li *ngFor="let remote of remotes">
8-
<a [routerLink]="remote.routePath" routerLinkActive="active">{{remote.displayName}}</a>
9-
</li>
10-
<li class="user"><span>## {{ (user$ | async)?.name }} ##</span></li>
11-
</ul>
6+
<li><a routerLink="home" routerLinkActive="active">Home</a></li>
7+
<li><a routerLink="users" routerLinkActive="active">Users</a></li>
8+
<li *ngFor="let remote of remotes">
9+
<a [routerLink]="remote.routePath" routerLinkActive="active">{{remote.displayName}}</a>
10+
</li>
11+
<li class="user"><span>## {{ (user$ | async)?.name }} ##</span></li>
12+
</ul>
13+
</header>
1214
<main>
1315
<router-outlet></router-outlet>
1416
</main>
17+
<footer>
18+
<p>Angular / Spring Boot - Module Federation v16</p>
19+
</footer>

application/ng-shell/src/app/app.component.spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import { AppComponent } from './app.component';
55
describe('AppComponent', () => {
66
beforeEach(async () => {
77
await TestBed.configureTestingModule({
8-
imports: [
9-
RouterTestingModule
10-
],
11-
declarations: [
8+
imports: [
9+
RouterTestingModule,
1210
AppComponent
13-
],
14-
}).compileComponents();
11+
],
12+
}).compileComponents();
1513
});
1614

1715
it('should create the app', () => {

application/ng-shell/src/app/app.component.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import { Component, OnInit } from '@angular/core';
2-
import { Router } from '@angular/router';
2+
import { Router, RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
33
import { Store } from '@ngrx/store';
44
import { getUser } from 'core';
55
import { CustomManifest, CustomRemoteConfig } from './utils/config';
66
import { getManifest } from '@angular-architects/module-federation';
7-
import { buildRoutes } from './utils/routes';
7+
import { buildRoutes } from './utils/routes';
8+
import { NgFor, AsyncPipe } from '@angular/common';
89

910
@Component({
10-
selector: 'app-root',
11-
templateUrl: './app.component.html',
12-
styleUrls: ['./app.component.scss']
11+
selector: 'app-root',
12+
templateUrl: './app.component.html',
13+
styleUrls: ['./app.component.scss'],
14+
standalone: true,
15+
imports: [RouterLink, RouterLinkActive, NgFor, RouterOutlet, AsyncPipe]
1316
})
1417
export class AppComponent implements OnInit {
1518

application/ng-shell/src/app/app.module.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Routes } from '@angular/router';
2+
import { HomeComponent } from './home/home.component';
3+
4+
export const APP_ROUTES: Routes = [
5+
{
6+
path: 'home', component: HomeComponent, title: 'Home'
7+
},
8+
{
9+
path: 'users', loadChildren: () => import('./users/users.routes').then(m => m.usersRoutes), title: 'Users'
10+
},
11+
{
12+
path: '', redirectTo: 'home', pathMatch: 'full'
13+
}
14+
];

application/ng-shell/src/app/home/home.component.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component } from '@angular/core';
22
import { Store } from '@ngrx/store';
33
import { CoreService } from 'core';
44
import { Observable } from 'rxjs';
55
import { getCount } from '../store/counter.selectors';
6+
import { AsyncPipe } from '@angular/common';
7+
import { FormsModule } from '@angular/forms';
68

79
@Component({
8-
selector: 'app-home',
9-
template: `
10+
selector: 'app-home',
11+
template: `
1012
<h2>home works !</h2>
1113
<p>This is the counter: {{counter$ | async}}</p>
1214
<p><button class="btn" (click)="getCore()">get core</button></p>
@@ -20,7 +22,9 @@ import { getCount } from '../store/counter.selectors';
2022
</div>
2123
2224
`,
23-
styles: []
25+
styles: [],
26+
standalone: true,
27+
imports: [FormsModule, AsyncPipe]
2428
})
2529
export class HomeComponent {
2630

application/ng-shell/src/app/users/users-routing.module.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)