Skip to content

feat(Angular): update to v22 - #1301

Merged
lexasq merged 2 commits into
developmentfrom
feat/angular-22
Oct 1, 2026
Merged

lexasq merged 2 commits into
developmentfrom
feat/angular-22

Conversation

@lexasq

@lexasq lexasq commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Migrates the workspace and library to Angular 22.

  • Angular 21.0.9 → 22.1.8, Nx 22.3.3 → 23.2.1, TypeScript 5.9.3 → 6.0.3 (required by Angular 22)
  • ngx-bootstrap 22, jest-preset-angular 17, ng-packagr 22, ESLint 9 (converted to flat eslint.config.mjs)
  • Library peerDependencies: @angular/core / @angular/common → ^22.x.x
  • Lockfile regenerated (two major upgrades would not resolve against the old one)

Migrations and manual fixes

  • Ran nx migrate + Angular 22 schematics: existing components are pinned to ChangeDetectionStrategy.Eager (Angular 22 defaults to OnPush), the demo keeps strictTemplates: false.
  • TypeScript 6: removed the deprecated baseUrl and moduleResolution: "node" (paths now ./-prefixed); pinned strict: false and types: ["node"] in the demo tsconfig to keep the previous defaults.
  • ngx-bootstrap 22 removed TabsModule.forRoot() → plain TabsModule import (TabsetConfig is providedIn: 'root').
  • Disabled @angular-eslint/prefer-on-push-component-change-detection, which would otherwise flag the Eager strategy added by Angular's own migration.

CI

  • Pinned Node 24 (.nvmrc + actions/setup-node) in all workflows. Angular 22 requires Node ^22.22.3 || ^24.15.0, and the workflows previously used the runner's default Node.
  • Added yaml@^2 as an explicit devDependency. Vite (nested under @angular/build) has an optional peer on yaml@^2 while the hoisted copy is 1.x. npm 11 leaves that entry out of the lockfile, but npm 10 requires it (npm ci → Missing: yaml@2.9.1 from lock file). The lockfile now passes npm ci on both npm 10 and 11.

Unit tests (were broken on development)

Tests could not run on v21: jest-environment-jsdom was missing, the setup file used a removed jest-preset-angular entry point, and toBeCalledTimes was removed in Jest 30. Fixed all three, plus isolatedModules for ts-jest (also what the Nx 23 migration applies).

Verification

  • lint ✅ · test 28/28 ✅ · library build ✅ · demo build ✅
  • Library output: .d.ts API and fesm2022 bundle are identical to the v21 build (apart from Angular version stamps). package.json differs only in peer deps and ng-packagr 22 adding "type": "module".
  • End-to-end against a backend emulator: built the demo on v21 and v22 and ran the same browser-driven scenario suite against a local mock upload server. It covered JSON upload with async formatDataFunction, multipart via drop zone and file inputs (with additionalParameter), custom headers and auth token, HTTP 500 → onErrorItem, cancel of an in-flight upload, maxFileSize/queueLimit filters, and removing items. Result: 0 differences across 22 checkpoints in received payloads (per-part SHA-1s), callbacks/events and DOM state.

Known, not changed here

  • Pre-existing on v21 as well: in the demo, the upload table doesn't refresh after an XHR completes until the next user interaction. The app runs zoneless since provideZoneChangeDetection was removed in ba1fecd. Behavior is identical before and after this PR, so it can be fixed separately.
  • Library version is not bumped (left to the release script).

🤖 Generated with Claude Code

Alex Umanskiy and others added 2 commits September 29, 2026 14:11
- Angular 21.0 -> 22.1.8, Nx 22.3 -> 23.2.1, TypeScript 5.9 -> 6.0.3,
  ngx-bootstrap 22, jest-preset-angular 17, ESLint 9 (flat config)
- Library peerDependencies: @angular/core and @angular/common ^22.x.x
- Applied Nx and Angular migrations (ChangeDetectionStrategy.Eager pinned
  on existing components, strictTemplates kept off for demo)
- TypeScript 6: drop deprecated baseUrl and node10 moduleResolution;
  pin strict/types in demo tsconfig to previous defaults
- Demo: TabsModule.forRoot() removed in ngx-bootstrap 22
- Fix unit test setup that was broken on v21 (missing
  jest-environment-jsdom, jest-preset-angular setup-env, isolatedModules,
  toBeCalledTimes -> toHaveBeenCalledTimes)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm ci failed on CI with "Missing: yaml@2.9.1 from lock file": vite
(nested under @angular/build) has an optional peer on yaml@^2 while the
hoisted yaml is 1.x. npm 11 omits that entry from the lockfile but npm 10
(the runner default, and what Node 22 ships) requires it.

- Add yaml@^2 as an explicit devDependency so npm 10 and 11 agree on the tree
- Pin Node 24 via .nvmrc + actions/setup-node in all workflows; Angular 22
  requires Node ^22.22.3 || ^24.15.0 and CI used the runner's default Node

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 58e927f):

https://ngx-file-upload--pr1301-feat-angular-22-8u3k2j1g.web.app

(expires Tue, 06 Oct 2026 11:21:26 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f15ad3fba241d6d58091ac579c27208d04d4562f

@lexasq
lexasq merged commit 5a7d0b9 into development Oct 1, 2026
7 checks passed
@lexasq
lexasq deleted the feat/angular-22 branch October 1, 2026 11:49
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