Skip to content

feat: Upgrade Angular from 16.2.1 to 21.2.11#17

Open
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1777562465-upgrade-angular-21
Open

feat: Upgrade Angular from 16.2.1 to 21.2.11#17
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1777562465-upgrade-angular-21

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Apr 30, 2026

Summary

Major framework upgrade spanning 5 major Angular versions (16 to 21), bringing the project to the latest stable Angular release.

Version Changes

Package Before After
@angular/core 16.2.1 21.2.11
@angular/material 16.2.1 21.2.9
TypeScript 4.9.5 5.9.3
RxJS 6.x 7.x
Zone.js 0.13.1 0.15.0
Node.js requirement 18 22 (min 20.11.1)

Breaking Changes Addressed (20 total)

  1. HttpClientModule replaced with provideHttpClient() functional API
  2. BrowserAnimationsModule replaced with provideAnimationsAsync()
  3. provideZoneChangeDetection() now required for zone-based apps (Angular 21)
  4. standalone: false added to all NgModule-declared components (Angular 19+ defaults to standalone)
  5. Template control flow migrated from *ngIf/*ngFor to @if/@for syntax via CLI schematic
  6. polyfills.ts removed, polyfills now configured inline in angular.json
  7. Moment.js namespace imports changed to default imports (esModuleInterop)
  8. TestBed.get() replaced with TestBed.inject() (removed in Angular 20)
  9. HttpClientTestingModule replaced with provideHttpClientTesting()
  10. karma-coverage-istanbul-reporter replaced with karma-coverage
  11. tsconfig.json updated: bundler moduleResolution, ES2022 module, removed legacy decorator flags
  12. browserTarget replaced with buildTarget in angular.json serve/extract-i18n configs
  13. ESLint updated: typescript-eslint v6 to v8, angular-eslint v16 to v21, removed dropped rules
  14. Protractor removed (deprecated e2e framework)
  15. Deprecated packages removed: codelyzer, core-js, types/jasminewd2, ts-node, etc.

Full documentation in BREAKING_CHANGES.md.

Build and Lint

  • npm run build passes
  • npm run lint passes (0 errors, 0 warnings)

Review and Testing Checklist for Human

  • Verify Node.js version: Ensure CI and local environments use Node 20.11.1+ (Node 22 recommended). Angular 21 will not run on Node 18.
  • Run the app locally (npm start) and verify all pages render correctly (owners, pets, vets, visits, specialties, pet types)
  • Test datepicker components (pet-add, pet-edit, visit-add, visit-edit) which use Angular Material Datepicker with moment adapter
  • Check Angular Material components: the MatSelect (vet specialties) and MatDatepicker should still function
  • Review template control flow migration: the @if/@for conversions were auto-generated; verify they render the same as before

Notes

  • The browser (webpack) builder was retained instead of migrating to the esbuild-based application builder because Bootstrap 3 glyphicon font references cause duplicate output file errors with esbuild. Migrating to Bootstrap 5+ would enable the application builder in a future PR.
  • The NgModule architecture was preserved. A future migration to standalone components is recommended but was out of scope for this framework upgrade.
  • angular-eslint prefer-standalone and prefer-inject lint rules were disabled since the codebase retains the NgModule and constructor injection patterns.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/0524698c759340d7adb9d6a3b24ac583


Open in Devin Review

Major upgrade spanning 5 major versions (16 → 17 → 18 → 19 → 20 → 21).

Key changes:
- Angular core/cli/material: 16.2.1 → 21.2.11
- TypeScript: 4.9.5 → 5.9.3
- RxJS: 6.x → 7.x
- Zone.js: 0.13 → 0.15
- Node.js requirement: 18 → 22 (minimum 20.11.1)

Breaking changes addressed:
- HttpClientModule → provideHttpClient()
- BrowserAnimationsModule → provideAnimationsAsync()
- Added provideZoneChangeDetection() (Angular 21 requirement)
- Added standalone: false to all NgModule-declared components
- Migrated templates to built-in control flow (@if, @for)
- Replaced polyfills.ts with angular.json polyfills array
- Updated moment imports for ES module interop
- Replaced TestBed.get() with TestBed.inject()
- Replaced HttpClientTestingModule with provideHttpClientTesting()
- Replaced karma-coverage-istanbul-reporter with karma-coverage
- Updated tsconfig for bundler moduleResolution
- Removed Protractor e2e (deprecated)
- Removed deprecated packages (codelyzer, core-js, etc)
- Updated ESLint config for typescript-eslint v8 / angular-eslint v21

See BREAKING_CHANGES.md for full documentation.
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

…ation

- Added optimization:true, sourceMap:false, extractLicenses:true back to
  production configuration in angular.json
- Removed duplicate maxlength error message blocks in visit-edit template
  (was 3 identical blocks, now 1, also fixed 'charaters' typo)
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.

0 participants