Upgrade client to Angular 22 and modernize to current best practices - #12
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ng updatemigrations (OnPush-default codemod,canMatchsignature, hydration opt-out flag, safe-navigation wrapping).CommonEngineontoAngularNodeAppEngine, adding per-route rendering config (app.routes.server.ts) andoutputMode: "server"required for it to work.inject()over constructor DI, the new@Service()decorator,OnPushchange detection (replacing theEagercompatibility 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 manualActivatedRoutesnapshot +WritableSignalcast),provideBrowserGlobalErrorListeners(), andeventCoalescing.karma*/jasmine*packages (99 packages removed, audit vulnerabilities in this package cut from 28 to 5).httpResource().value()throwing when the resource errors (guarded withhasValue()), and a failed route resolver hard-404ing the page instead of redirecting (addedcatchError/RedirectCommand).Test plan
ng buildproduction build succeeds cleanly (no warnings/errors)node dist/client/server/server.mjs) verified via curl for/,/new, and/edit/:id(including the resolver-error redirect path)ng servedev server verified in-browser: list renders, add-employee form fills/submits (network + error-handling path confirmed), hydration completes with no console errorsng testruns cleanly under the new Vitest builder (repo has no spec files yet)