Skip to content

chore: upgrade Angular to v22.0.2 - #60

Merged
Helias merged 2 commits into
masterfrom
chore/upgrade-angular-21
Jun 20, 2026
Merged

chore: upgrade Angular to v22.0.2#60
Helias merged 2 commits into
masterfrom
chore/upgrade-angular-21

Conversation

@Helias

@Helias Helias commented Jun 20, 2026

Copy link
Copy Markdown
Member

Upgrades Angular from v21 to v22.0.2 via ng update, on top of #59.

Changes

  • All @angular/* packages, the CLI, and @angular-devkit/build-angular bumped to v22.
  • TypeScript pulled to 6.0.3.
  • Migrations add withXhr() to provideHttpClient(...) calls (main.ts and specs) to keep the pre-v22 XHR backend (v22 defaults the backend to fetch).
  • tsconfig.app.json / tsconfig.spec.json: suppress the nullishCoalescingNotNullable / optionalChainNotNullable extended diagnostics (applied by the v22 migration).

TypeScript 6 fallout handled in tsconfig.json

  • strict now defaults to on; set "strict": false explicitly to preserve the project's prior non-strict posture (the data-model classes have uninitialized properties).
  • baseUrl is deprecated; added "ignoreDeprecations": "6.0" since the 'config' import still resolves through it.

Verification

  • ng build passes (only pre-existing Sass @import deprecation warnings).
  • ng test passes (4/4, ChromeHeadless).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores / Maintenance
    • Upgraded Angular runtime to 22.0.x and refreshed Angular build tooling to 22.0.3.
    • Upgraded TypeScript to 6.0.3 (and updated related tooling like tslib).
    • Updated the HTTP client setup to use XHR-based transport.
    • Adjusted TypeScript/Angular compiler settings to suppress specific extended diagnostics.
    • Updated CI to use Node.js 24 for running unit tests.

Run ng update from v21 to v22. Bumps all @angular packages, the CLI,
build-angular, and TypeScript to 6.0.3.

Migrations add withXhr() to provideHttpClient calls to retain the
pre-v22 XHR backend (v22 defaults to fetch), and suppress the
nullishCoalescing/optionalChain extended diagnostics in the app and
spec tsconfigs.

TypeScript 6 changes that needed handling:
- strict now defaults to on; set "strict": false explicitly to preserve
  the project's prior (non-strict) posture.
- baseUrl is deprecated; add "ignoreDeprecations": "6.0" since the
  'config' import still relies on it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fc3a9e7a-d253-4259-b5be-f33f1730a593

📥 Commits

Reviewing files that changed from the base of the PR and between 5b6442c and 23f27e9.

📒 Files selected for processing (1)
  • .github/workflows/tests.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/tests.yml

📝 Walkthrough

Walkthrough

Upgrades Angular dependencies from v21.2.x to v22.0.x and TypeScript from 5.9.3 to 6.0.3. Adds withXhr() to provideHttpClient() in the app bootstrap and both test modules. Updates TypeScript and Angular compiler configuration to suppress deprecation errors and two extended diagnostic checks. Updates CI Node.js version to 24 to support the upgraded toolchain.

Changes

Angular v22 / TypeScript v6 Upgrade

Layer / File(s) Summary
Dependency version bumps
package.json
All Angular runtime and tooling packages are upgraded from 21.2.x to 22.0.2/22.0.3, tslib from 2.0.0 to 2.8.1, and typescript from 5.9.3 to 6.0.3.
TypeScript and Angular compiler config adaptations
tsconfig.json, tsconfig.app.json, tsconfig.spec.json
tsconfig.json adds ignoreDeprecations: "6.0" and sets strict: false; tsconfig.app.json and tsconfig.spec.json each add angularCompilerOptions.extendedDiagnostics blocks suppressing nullishCoalescingNotNullable and optionalChainNotNullable.
withXhr() HttpClient provider wiring
src/main.ts, src/app/app.component.spec.ts, src/app/app.service.spec.ts
provideHttpClient is updated to explicitly pass withXhr() in the app bootstrap and in both test module provider arrays alongside existing withInterceptorsFromDi() usage.
CI Node.js version update
.github/workflows/tests.yml
The GitHub Actions test workflow updates Node.js version from 22 to 24 to support the Angular 22 and TypeScript 6 toolchain.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • azerothcore/server-status#59: Also modifies the bootstrapApplication providers array in src/main.ts as part of an Angular upgrade, adding provideZoneChangeDetection() where this PR adds provideHttpClient(withXhr()).

Poem

🐇 Hop, hop, Angular twenty-two is here,
With XHR bundled in, crystal clear!
withXhr() wired up, strict set to false,
Deprecated warnings? No longer a cause!
The rabbit upgrades with a joyful bound~ 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'chore: upgrade Angular to v22.0.2' directly and concisely describes the main change: upgrading Angular to version 22.0.2, which aligns perfectly with the primary objective and the majority of changes in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/upgrade-angular-21

Comment @coderabbitai help to get the list of available commands and usage tips.

Angular 22 requires Node ^22.22.3 || ^24.15.0 || >=26.0.0, and its
devkit packages declare optional peer deps (chokidar/readdirp) that the
npm 11 lockfile records in a form npm 10 (bundled with Node 22) rejects
during `npm ci`. Node 24 bundles a compatible npm.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tsconfig.app.json (1)

18-25: 🏗️ Heavy lift

Treat these extended-diagnostic suppressions as temporary migration debt.

Please time-box these suppressions and track removal after fixing call sites; leaving both checks suppressed indefinitely weakens null-safety signal quality in app builds.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tsconfig.app.json` around lines 18 - 25, The extendedDiagnostics suppressions
for nullishCoalescingNotNullable and optionalChainNotNullable checks are being
flagged as temporary migration debt that needs tracking. Create a tracking
mechanism (such as a GitHub issue, TODO comment with a deadline, or
documentation entry) that documents when these suppressions in the checks object
were added and sets a specific timeframe for their removal. Identify and
document the call sites that currently require these suppressions so they can be
fixed and the suppressions can be removed to restore full null-safety signal
quality in the Angular compiler options.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 14-38: Add an engines field to the root level of package.json to
explicitly document the Node.js version requirements for this project. The
engines field should be placed alongside the existing dependencies and
devDependencies objects and should specify the compatible Node.js versions that
Angular 22.0.2 requires. This will help local developers identify version
mismatches early without needing to run CI.

---

Nitpick comments:
In `@tsconfig.app.json`:
- Around line 18-25: The extendedDiagnostics suppressions for
nullishCoalescingNotNullable and optionalChainNotNullable checks are being
flagged as temporary migration debt that needs tracking. Create a tracking
mechanism (such as a GitHub issue, TODO comment with a deadline, or
documentation entry) that documents when these suppressions in the checks object
were added and sets a specific timeframe for their removal. Identify and
document the call sites that currently require these suppressions so they can be
fixed and the suppressions can be removed to restore full null-safety signal
quality in the Angular compiler options.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ed007c8c-04f9-4a02-8e7e-766d998cd35c

📥 Commits

Reviewing files that changed from the base of the PR and between 739c352 and 5b6442c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • package.json
  • src/app/app.component.spec.ts
  • src/app/app.service.spec.ts
  • src/main.ts
  • tsconfig.app.json
  • tsconfig.json
  • tsconfig.spec.json

Comment thread package.json
Comment on lines +14 to +38
"@angular/animations": "22.0.2",
"@angular/common": "22.0.2",
"@angular/compiler": "22.0.2",
"@angular/core": "22.0.2",
"@angular/forms": "22.0.2",
"@angular/platform-browser": "22.0.2",
"@angular/platform-browser-dynamic": "22.0.2",
"@angular/router": "22.0.2",
"bootstrap": "5.3.5",
"bootswatch": "5.3.5",
"rxjs": "6.6.7",
"serialize-javascript": "3.1.0",
"tslib": "2.0.0",
"tslib": "2.8.1",
"zone.js": "0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "21.2.16",
"@angular/cli": "21.2.16",
"@angular/compiler-cli": "21.2.17",
"@angular/language-service": "21.2.17",
"@angular-devkit/build-angular": "22.0.3",
"@angular/cli": "22.0.3",
"@angular/compiler-cli": "22.0.2",
"@angular/language-service": "22.0.2",
"@types/jasmine": "3.6.0",
"@types/jasminewd2": "2.0.3",
"@types/node": "22.14.0",
"codelyzer": "6.0.0",
"istanbul-lib-instrument": "^6.0.3",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== package.json engines =="
cat package.json | jq '.engines // "NO_ENGINES_FIELD"'

echo
echo "== Node version pins in common toolchain files =="
fd -HI '(^\.nvmrc$|^\.node-version$|^\.tool-versions$|^Dockerfile$|^Dockerfile\..*$|^package\.json$|^.*\.yml$|^.*\.yaml$)'

echo
echo "== Node version references in repo (CI/Docker/tooling) =="
rg -n --hidden --glob '!node_modules/**' --glob '!.git/**' \
  'node-version|setup-node|FROM node|\"engines\"|\"node\"'

Repository: azerothcore/server-status

Length of output: 439


🏁 Script executed:

cat -n package.json | head -60

Repository: azerothcore/server-status

Length of output: 1825


🏁 Script executed:

cat -n .github/workflows/tests.yml

Repository: azerothcore/server-status

Length of output: 815


🌐 Web query:

Angular 22.0.2 Node.js version requirements compatibility

💡 Result:

For Angular 22.0.2, the supported Node.js version requirement is given by Angular’s “engines.node” range for the Angular 22 line: ^22.22.3 || ^24.15.0 || >=26.0.0. [1] So, to be compatible with Angular 22.0.2, use: - Node.js 22 >= 22.22.3 - or Node.js 24 >= 24.15.0 - or Node.js 26.0.0+ [1] Angular 22 also reflects that Node.js v20 is no longer supported (minimum bumped to the Node 22/24 versions above). [2] Confidence: High (the Node.js range is directly sourced from Angular’s compatibility table update/engines metadata in the Angular repo). [1][2]

Citations:


🌐 Web query:

TypeScript 6.0.3 release version exists official

💡 Result:

Yes, TypeScript 6.0.3 is an official release [1][2]. It was published to the npm registry on April 16, 2026 [2]. As of June 20, 2026, it is listed as a stable release within the official Microsoft TypeScript GitHub repository [3][1].

Citations:


🏁 Script executed:

rg -n "typescript" package.json

Repository: azerothcore/server-status

Length of output: 98


Add engines field to package.json to document Node.js compatibility for local development.

Angular 22.0.2 requires Node.js ^22.22.3, ^24.15.0, or >=26.0.0. While your CI workflow correctly pins Node.js 24, adding an explicit engines constraint in package.json will help local developers detect version mismatches without running CI first.

"engines": {
  "node": "^22.22.3 || ^24.15.0 || >=26.0.0"
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` around lines 14 - 38, Add an engines field to the root level of
package.json to explicitly document the Node.js version requirements for this
project. The engines field should be placed alongside the existing dependencies
and devDependencies objects and should specify the compatible Node.js versions
that Angular 22.0.2 requires. This will help local developers identify version
mismatches early without needing to run CI.

@Helias
Helias merged commit 090d4c0 into master Jun 20, 2026
2 checks passed
@Helias
Helias deleted the chore/upgrade-angular-21 branch June 20, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant