Skip to content

Upgrade Angular 16 → 19#1010

Merged
chensation merged 14 commits intomasterfrom
angular-updates
Apr 16, 2026
Merged

Upgrade Angular 16 → 19#1010
chensation merged 14 commits intomasterfrom
angular-updates

Conversation

@chensation
Copy link
Copy Markdown
Collaborator

@chensation chensation commented Apr 10, 2026

Angular Version Upgrades (16 -> 17 -> 18 -> 19)

Three incremental upgrade commits, each verified with full unit tests (95/95) and Cypress e2e tests (171/171).

Commit 1: Angular 17

  • All @angular/* packages 16.2 -> 17.3
  • TypeScript 4.9 -> 5.4, Zone.js 0.13 -> 0.14
  • @ng-bootstrap/ng-bootstrap 15 -> 16, @angular-eslint/* 16 -> 17
  • Cypress 10 -> 13, @cypress/schematic 2.0 -> 2.5

Commit 2: Angular 18

  • All @angular/* packages 17.3 -> 18.2
  • @ng-bootstrap/ng-bootstrap 16 -> 17, @angular-eslint/* 17 -> 18, @typescript-eslint/* 5 -> 8

Commit 3: Angular 19

  • All @angular/* packages 18.2 -> 19.2
  • TypeScript 5.4 -> 5.8, Zone.js 0.14 -> 0.15
  • @ng-bootstrap/ng-bootstrap 17 -> 18, @angular-eslint/* 18 -> 19, @types/node 12 -> 18

Commit 4: CI Pipeline Update

  • Upgraded actions/checkout from v2 to v4 and actions/setup-node from v1 to v4
  • Angular 19 requires Node.js >= 18.19.1; the old action versions failed to install Node 20.x properly

Note on standalone: false (222 files changed)

Angular 19 changed the default for @Component, @Directive, and @Pipe decorators from standalone: false to standalone: true. Since this project uses NgModules, every decorator needed an explicit standalone: false to preserve existing behavior. This was applied automatically by the ng update schematic and accounts for the vast majority of changed files. No architectural change -- the project remains NgModule-based. Migration to standalone components can be done incrementally in a future effort.

Code Coverage

Code coverage report has been broken for a long time, with the new update, it is now blocking pipeline from properly completing. Disabling it for now, a separate work item has been filed for it: #1011

Manual Adjustments

Angular 17:

  • Removed deprecated @import '@angular/material/theming' in styles.scss (replaced by existing @use)
  • Fixed Cypress 13 breaking changes:
    • cy.within() now requires a single element -- updated selectors
    • Intercept alias indexing changed from 0-based to 1-based
    • Test isolation enabled by default -- added cy.visit() to orchestration view tests
    • cy.contains().should('not.exist') pattern replaced with cy.root().should('not.contain', ...)

Angular 18:

  • Fixed NG5002: replaced unsupported two-way binding [(collapsed)]="!copy" with one-way [collapsed]="!copy" in replica-status component

Angular 19:

  • Fixed TypeScript 5.8 type error: cast moment to any for vis-timeline MomentConstructor type mismatch
  • Replaced deprecated RouterTestingModule with provideRouter() in tests
  • Removed unused imports from routes.service.spec.ts
  • Fixed route test root path assertion ('' vs '/')
  • Fixed XSS test assertion: Angular 19 sanitizer preserves original quote style
  • Fixed Sass deprecations: @import -> @use, darken() -> color.adjust()
  • Fixed Material theming: positional args -> map format for m2-define-light-theme
  • Fixed CSS nested declaration order warning
  • Application builder migration skipped: the esbuild application builder breaks Cypress focus event handling. Kept the browser builder. See tree.cy.js for details.

Cypress
Cypress has been upgraded to 15

Siyu Chen added 14 commits April 9, 2026 17:01
- Upgrade @angular/* packages from 16.2.12 to 17.3.12
- Upgrade @angular/cli from 16.2.10 to 17.3.17
- Upgrade @angular/material and @angular/cdk from 16.2.12 to 17.3.10
- Upgrade TypeScript from 4.9.5 to 5.4.5
- Upgrade Zone.js from 0.13.3 to 0.14.10
- Upgrade @angular-eslint/* from 16.3.1 to 17.5.3
- Upgrade @ng-bootstrap/ng-bootstrap from 15.1.2 to 16.0.0
- Upgrade Cypress from 10.11.0 to 13.17.0
- Upgrade @cypress/schematic from 2.0.0 to 2.5.2
- Remove deprecated @import '@angular/material/theming' (replaced by @use)
- Fix Cypress 13 test isolation in orchestration view tests
- Fix Cypress 13 cy.within() single element requirement
- Fix Cypress 13 alias indexing (0-based to 1-based)
- Fix Cypress 13 cy.contains().should('not.exist') pattern
- Upgrade @angular/* packages from 17.3.12 to 18.2.14
- Upgrade @angular/cli from 17.3.17 to 18.2.21
- Upgrade @angular/material and @angular/cdk from 17.3.10 to 18.2.14
- Upgrade @angular-eslint/* from 17.5.3 to 18.4.3
- Upgrade @typescript-eslint/* from 5.x to 8.58.1
- Upgrade @ng-bootstrap/ng-bootstrap from 16.0.0 to 17.0.1
- Fix NG5002: replace unsupported two-way binding [(collapsed)]='!copy'
  with one-way [collapsed]='!copy' in replica-status component
- Auto-migration: HttpClientModule replaced with provideHttpClient(withInterceptorsFromDi())
- Auto-migration: HttpClientTestingModule replaced with provideHttpClientTesting()
- Auto-migration: Material M2 API rename (define-palette -> m2-define-palette, etc.)
- Upgrade @angular/* packages from 18.2.14 to 19.2.20
- Upgrade @angular/cli from 18.2.21 to 19.2.24
- Upgrade @angular/material and @angular/cdk from 18.2.14 to 19.2.19
- Upgrade TypeScript from 5.4.5 to 5.8.3
- Upgrade Zone.js from 0.14.10 to 0.15.1
- Upgrade @angular-eslint/* from 18.4.3 to 19.x
- Upgrade @ng-bootstrap/ng-bootstrap from 17.0.1 to 18.x
- Upgrade @types/node from 12.x to 18.x (TS 5.8 compat)
- Auto-migration: standalone: false added to 222 component/directive/pipe files
- Auto-migration: APP_INITIALIZER replaced with provideAppInitializer
- Auto-migration: Material styles.scss updated
- Replace deprecated RouterTestingModule with provideRouter in tests
- Remove unused fakeAsync/tick/waitForAsync imports from routes.service.spec.ts
- Fix route test assertion for root path ('' vs '/')
- Fix TS 5.8 type error: cast moment to any for vis-timeline compat
- Fix XSS test assertion for Angular 19 sanitizer quote rendering
- Fix Sass deprecations: @import -> @use, darken() -> color.adjust()
- Fix Material theming: use map format for m2-define-light-theme
- Fix CSS nested declaration order in styles.scss
- Note: application builder migration skipped (breaks Cypress focus events)
- Upgrade jasmine-core from ~3.6.0 to ~3.10.0 to satisfy
  karma-jasmine-html-reporter@1.7.0 peer dep (>=3.8)
- Regenerate package-lock.json for Node 20 npm compatibility
Project uses NgModules with standalone: false on all components.
The prefer-standalone rule was added in @angular-eslint v19 and
conflicts with the NgModule architecture. Can be re-enabled when
migrating to standalone components.
- Upgrade ngx-build-plus from 14.0.0 to 19.0.0 (fixes ng serve failure)
- Upgrade karma from 6.3.x to 6.4.x (satisfies @angular/build peer dep)
- Upgrade @types/jasmine from 3.6 to 3.10 (matches jasmine-core 3.10)
- Remove protractor (deprecated, replaced by Cypress), e2e/ config from angular.json
- Remove @schematics/angular@13 (relic, CLI bundles its own @19 internally)
- Remove popper.js@1 (deprecated, ng-bootstrap uses @popperjs/core@2)
- Remove ts-node@7 and @types/jasminewd2 (protractor dependencies)
- Update angular.json serve target: browserTarget -> buildTarget (Angular 19)
- Add development configuration to build target (required by ng serve)
- Fix proxy.conf.json: /api/* -> /api (http-proxy-middleware v3 compat)
@chensation chensation requested a review from jeffj6123 April 16, 2026 15:35
@chensation chensation merged commit cf7a1eb into master Apr 16, 2026
5 checks passed
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.

2 participants