Skip to content

Commit 14197f3

Browse files
chore: upgrade Angular to v22.0.8
ng update @angular/core@22.0.8 @angular/cli@22.0.8 (also bumped TypeScript to 6.0.3, required by v22), plus bump @fortawesome/angular-fontawesome to 5.1.0 (only major compatible with Angular 22 as peer dependency). Mandatory core migrations, all behavior-preserving: - Every component now gets `changeDetection: ChangeDetectionStrategy.Eager` explicitly, since components without an explicit strategy now default to OnPush in v22 - this opts every existing component out of that change and keeps the previous "check always" behavior. - app.config.ts: provideHttpClient(...) now also passes withXhr(), since v22 defaults HttpClient to a Fetch-based backend. - tsconfig.app.json / tsconfig.spec.json: disables the new nullishCoalescingNotNullable / optionalChainNotNullable extended diagnostics (opt-out migration default, no code affected by them). Build and test suite (7/7) pass. This completes the 17 -> 22 migration.
1 parent ca6d5ba commit 14197f3

12 files changed

Lines changed: 1292 additions & 1655 deletions

File tree

package-lock.json

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

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,28 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"@angular/animations": "^21.2.18",
14-
"@angular/common": "^21.2.18",
15-
"@angular/compiler": "^21.2.18",
16-
"@angular/core": "^21.2.18",
17-
"@angular/forms": "^21.2.18",
18-
"@angular/platform-browser": "^21.2.18",
19-
"@angular/platform-browser-dynamic": "^21.2.18",
20-
"@angular/router": "^21.2.18",
21-
"@fortawesome/angular-fontawesome": "^4.0.0",
13+
"@angular/animations": "^22.0.8",
14+
"@angular/common": "^22.0.8",
15+
"@angular/compiler": "^22.0.8",
16+
"@angular/core": "^22.0.8",
17+
"@angular/forms": "^22.0.8",
18+
"@angular/platform-browser": "^22.0.8",
19+
"@angular/platform-browser-dynamic": "^22.0.8",
20+
"@angular/router": "^22.0.8",
21+
"@fortawesome/angular-fontawesome": "^5.1.0",
2222
"angular-font-awesome": "^3.1.2",
2323
"express": "^4.19.2",
2424
"rxjs": "~7.8.0",
2525
"tslib": "^2.3.0",
2626
"zone.js": "~0.15.1"
2727
},
2828
"devDependencies": {
29-
"@angular-devkit/build-angular": "^21.2.19",
30-
"@angular/cli": "^21.2.19",
31-
"@angular/compiler-cli": "^21.2.18",
29+
"@angular-devkit/build-angular": "^22.0.8",
30+
"@angular/cli": "^22.0.8",
31+
"@angular/compiler-cli": "^22.0.8",
3232
"@types/jasmine": "~5.1.0",
3333
"autoprefixer": "^10.4.19",
34+
"istanbul-lib-instrument": "^6.0.3",
3435
"jasmine-core": "~5.1.0",
3536
"karma": "~6.4.0",
3637
"karma-chrome-launcher": "~3.2.0",
@@ -39,6 +40,6 @@
3940
"karma-jasmine-html-reporter": "~2.1.0",
4041
"postcss": "^8.4.38",
4142
"tailwindcss": "^3.4.1",
42-
"typescript": "~5.9.3"
43+
"typescript": "~6.0.3"
4344
}
4445
}

src/app/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, Renderer2 } from '@angular/core';
1+
import { Component, OnInit, Renderer2, ChangeDetectionStrategy } from '@angular/core';
22
import { RouterOutlet } from '@angular/router';
33
import { LandingPageInicioComponent } from './page/landing-page-inicio/landing-page-inicio.component';
44
import { HeaderLandingPageComponent } from './page/header-landing-page/header-landing-page.component';
@@ -13,6 +13,7 @@ import { NotFoundComponent } from './not-found/not-found.component';
1313
NotFoundComponent,
1414
],
1515
templateUrl: './app.component.html',
16+
changeDetection: ChangeDetectionStrategy.Eager,
1617
styleUrl: './app.component.css'
1718
})
1819
export class AppComponent implements OnInit {

src/app/app.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88

99
import { routes } from './app.routes';
1010
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
11-
import { provideHttpClient, withJsonpSupport } from '@angular/common/http';
11+
import { provideHttpClient, withJsonpSupport, withXhr } from '@angular/common/http';
1212

1313
export const appConfig: ApplicationConfig = {
1414
providers: [
@@ -19,6 +19,6 @@ export const appConfig: ApplicationConfig = {
1919
withInMemoryScrolling({scrollPositionRestoration: 'enabled'})
2020
),
2121
provideAnimationsAsync(),
22-
provideHttpClient(withJsonpSupport())
22+
provideHttpClient(withXhr(), withJsonpSupport())
2323
],
2424
};

src/app/not-found/not-found.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Component } from '@angular/core';
1+
import { Component, ChangeDetectionStrategy } from '@angular/core';
22
import { HeaderLandingPageComponent } from '../page/header-landing-page/header-landing-page.component';
33
import { FooterComponent } from '../page/footer/footer.component';
44

55
@Component({
66
selector: 'app-not-found',
77
imports: [HeaderLandingPageComponent, FooterComponent],
88
templateUrl: './not-found.component.html',
9+
changeDetection: ChangeDetectionStrategy.Eager,
910
styleUrl: './not-found.component.css'
1011
})
1112
export class NotFoundComponent {

src/app/page/button-toggle-dark-light/button-toggle-dark-light.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { Component, OnInit, Renderer2 } from '@angular/core';
1+
import { Component, OnInit, Renderer2, ChangeDetectionStrategy } from '@angular/core';
22

33
@Component({
44
selector: 'app-button-toggle-dark-light',
55
imports: [],
66
templateUrl: './button-toggle-dark-light.component.html',
7+
changeDetection: ChangeDetectionStrategy.Eager,
78
styleUrl: './button-toggle-dark-light.component.css'
89
})
910
export class ButtonToggleDarkLightComponent implements OnInit{

src/app/page/footer/footer.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { Component } from '@angular/core';
1+
import { Component, ChangeDetectionStrategy } from '@angular/core';
22

33
@Component({
44
selector: 'app-footer',
55
imports: [],
66
templateUrl: './footer.component.html',
7+
changeDetection: ChangeDetectionStrategy.Eager,
78
styleUrl: './footer.component.css'
89
})
910
export class FooterComponent {

src/app/page/header-landing-page/header-landing-page.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Component, ElementRef, EventEmitter, Input, input, Output } from '@angular/core';
1+
import { Component, ElementRef, EventEmitter, Input, input, Output, ChangeDetectionStrategy } from '@angular/core';
22
import { ButtonToggleDarkLightComponent } from '../button-toggle-dark-light/button-toggle-dark-light.component';
33
import { NgClass } from '@angular/common';
44

55
@Component({
66
selector: 'app-header-landing-page',
77
imports: [ButtonToggleDarkLightComponent, NgClass],
88
templateUrl: './header-landing-page.component.html',
9+
changeDetection: ChangeDetectionStrategy.Eager,
910
styleUrl: './header-landing-page.component.css'
1011
})
1112
export class HeaderLandingPageComponent {

src/app/page/landing-page-inicio/landing-page-inicio.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ElementRef, EventEmitter, OnInit, output, Output } from '@angular/core';
1+
import { Component, ElementRef, EventEmitter, OnInit, output, Output, ChangeDetectionStrategy } from '@angular/core';
22
import { HeaderLandingPageComponent } from '../header-landing-page/header-landing-page.component';
33
import { FooterComponent } from '../footer/footer.component';
44
import { SliderEventComponent } from '../slider-event/slider-event.component';
@@ -23,6 +23,7 @@ import { NgClass } from '@angular/common';
2323
NgClass,
2424
],
2525
templateUrl: './landing-page-inicio.component.html',
26+
changeDetection: ChangeDetectionStrategy.Eager,
2627
styleUrl: './landing-page-inicio.component.css'
2728
})
2829
export class LandingPageInicioComponent {

src/app/page/slider-event/slider-event.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Input,
77
Output,
88
EventEmitter,
9+
ChangeDetectionStrategy
910
} from '@angular/core';
1011
import { FormsModule } from '@angular/forms';
1112

@@ -15,6 +16,7 @@ import { FormsModule } from '@angular/forms';
1516
selector: 'app-slider-event',
1617
imports: [FormsModule],
1718
templateUrl: './slider-event.component.html',
19+
changeDetection: ChangeDetectionStrategy.Eager,
1820
styleUrl: './slider-event.component.css'
1921
})
2022
export class SliderEventComponent {

0 commit comments

Comments
 (0)