Skip to content

Upgrade client to Angular 22 and modernize to current best practices - #12

Merged
sis0k0 merged 5 commits into
mainfrom
update-angular-22
Jul 24, 2026
Merged

Upgrade client to Angular 22 and modernize to current best practices#12
sis0k0 merged 5 commits into
mainfrom
update-angular-22

Conversation

@sis0k0

@sis0k0 sis0k0 commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • Upgrades the Angular client from v21.2 to v22 (core, CLI, Material, TypeScript v6), running the automated ng update migrations (OnPush-default codemod, canMatch signature, hydration opt-out flag, safe-navigation wrapping).
  • Migrates SSR off the now-deprecated CommonEngine onto AngularNodeAppEngine, adding per-route rendering config (app.routes.server.ts) and outputMode: "server" required for it to work.
  • Modernizes the app to current Angular recommendations: inject() over constructor DI, the new @Service() decorator, OnPush change detection (replacing the Eager compatibility shim added by the migration), output() over @Output/EventEmitter, httpResource() for the employee list (Angular's now-stable async-signals API), withComponentInputBinding() + a route resolver for the edit route (replacing a manual ActivatedRoute snapshot + WritableSignal cast), provideBrowserGlobalErrorListeners(), and eventCoalescing.
  • Migrates the test builder from Karma/Jasmine to Vitest and drops the now-unused karma*/jasmine* packages (99 packages removed, audit vulnerabilities in this package cut from 28 to 5).
  • Fixes two regressions surfaced during the migration itself: httpResource().value() throwing when the resource errors (guarded with hasValue()), and a failed route resolver hard-404ing the page instead of redirecting (added catchError/RedirectCommand).

Test plan

  • ng build production build succeeds cleanly (no warnings/errors)
  • SSR bundle (node dist/client/server/server.mjs) verified via curl for /, /new, and /edit/:id (including the resolver-error redirect path)
  • ng serve dev server verified in-browser: list renders, add-employee form fills/submits (network + error-handling path confirmed), hydration completes with no console errors
  • ng test runs cleanly under the new Vitest builder (repo has no spec files yet)

sis0k0 added 5 commits July 22, 2026 16:22
Installed via `npx skills add https://github.com/angular/skills` to give
AI coding agents Angular-specific guidance for this project.
- Bump Angular core/CLI/Material and TypeScript to v22/v6; run automated
  ng update migrations (OnPush default codemod, canMatch signature, hydration
  flag, safe-navigation).
- Migrate SSR from the deprecated CommonEngine to AngularNodeAppEngine, with
  per-route rendering config (app.routes.server.ts) and outputMode: "server".
- Modernize the app: inject() over constructor DI, @service() decorator,
  OnPush change detection, output() over @Output/EventEmitter,
  httpResource() for the employee list, withComponentInputBinding() + a
  route resolver for the edit route (replacing a manual ActivatedRoute/
  WritableSignal cast), provideBrowserGlobalErrorListeners(), and
  eventCoalescing.
- Migrate the test builder from Karma/Jasmine to Vitest and drop the
  now-unused karma/jasmine packages.
Angular 22 requires Node ^22.22.3 || ^24.15.0 || >=26.0.0, so the
existing 20.x/22.x matrix entries failed at the build step (20.x is
no longer supported at all, and generic 22.x resolved below 22.22.3).
Pinned to explicit versions that satisfy the constraint.
@sis0k0
sis0k0 merged commit bc13131 into main Jul 24, 2026
3 checks passed
@sis0k0
sis0k0 deleted the update-angular-22 branch July 24, 2026 12:00
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