Upgrade to Angular 22 + TypeScript 6.0 - #5445
Merged
norman-abramovitz merged 4 commits intoJun 14, 2026
Merged
Conversation
Bumps Angular 21.2.16 -> 22.0.1 and TypeScript 5.9 -> 6.0 (required by Angular 22), plus the supporting toolchain: @angular/build, CDK, CLI, @Angular-devkit, @angular-eslint -> 22; @analogjs/* -> 2.6.1 (Angular 22 + vitest 4 support, which unblocked this upgrade); ng2-charts 8 -> 10; @angular-builders/custom-webpack -> 22. Most of the diff is the `ng update` migration (safe-navigation wrapping, provideClientHydration/withXhr migrations). Three deliberate config decisions make it green while preserving current behavior: - src/tsconfig.json: explicitly set strict/strictNullChecks/ strictPropertyInitialization: false. Angular 22's builder flips strict on by default; the codebase runs non-strict today, so this opts back out to keep the upgrade behavior-neutral. The ~1295 latent strict-null findings this surfaces are tracked as a separate modernization ticket. - src/tsconfig.json: ignoreDeprecations "6.0" for the deprecated baseUrl (TS 6.0 hard-errors otherwise). - eslint.config.mjs: downgrade @angular-eslint/prefer-on-push-component- change-detection to warn (Angular 22 promoted it to error). Adopting OnPush across the 21 flagged components is a separate ticket. Also strips the migration's self-contradictory extendedDiagnostics + strictTemplates:false combo from 9 tsconfigs (NG4003). Validation (frontend gates all green): - Production build: 0 errors - Vitest: 2604 passed / 2 skipped / 0 failed (no NG0203 under zoneless) - ESLint: 0 errors, 128 warnings (matches develop baseline)
Follows up the Angular 22 upgrade. Converts the 21 components still on the renamed ChangeDetectionStrategy.Eager (Angular 22's rename of the legacy Default) to OnPush across 15 files, and restores the @angular-eslint/prefer-on-push-component-change-detection rule to error (0 violations remain) instead of the warn downgrade from the upgrade commit. As a down-payment on the broader strict-null-checks workstream, the same components are made strict-null clean (10 fixes in 4 files), verified via a temporary strict-island tsconfig: - @input / ngOnInit-assigned props get definite-assignment (!): metric, unit, max$, mean$ (metric-stats-card); formControl get() (unlimited- input). - showAllVersions initialized to false (chart-details-versions). - stratos-title `title` typed optional (it is documented optional). - kubernetes-node-summary-card: caaspNode$ typed Observable<… | null>, nodeData null-guarded, sibling maps default to false when null; the dead, never-assigned/never-read caaspVersion$ field removed. A strict island could not be wired into the gate for enforcement: these files import the non-strict core, so strict-checking pulls the whole closure (~341 pre-existing core findings). Enforcement waits for the global strict flip; these files are already done. Validation: prod build 0 errors; vitest 2604 passed / 0 failed; eslint 0 errors / 107 warnings.
Mechanical, zero-behavior-change lint cleanup on the Angular 22 branch, taking the warning count 107 -> 60: - Remove ~43 genuinely-unused imports and spec-only locals (verified unreferenced per file/template); cascade-removed orphaned vi / BehaviorSubject in two specs. - Rename unused caught error / positional param to _-prefixed (_err in write-with-job; _refresh in kubernetes.analysis.service). - Drop 3 unnecessary regex escapes in natural-sort; one let -> const. Left untouched (out of scope for a safe pass): the 6 intentional `T` public-API generics, and the behavior/API-affecting categories (@Output/@input renames, template a11y, prefer-standalone/inject, empty-object-type, declaration-merging) — candidates for the broader ESLint-tail ticket. Validation: prod build 0 errors; vitest 2604 passed / 0 failed; eslint 0 errors / 60 warnings.
This was referenced Jun 14, 2026
The `@stratos/builders` workspace package runs `prepare: tsc` during `bun install` using the root's TypeScript. Under TS 6.0 its tsconfig errored TS5107 (`moduleResolution: "node"` deprecated), failing the install step for every CI job before any test ran. - Add `ignoreDeprecations: "6.0"` to the builder tsconfig (same as the app tsconfig in ba9166c). - Bump the builder's @Angular-devkit deps 21 -> 22 to match root, so it can't pick up a skewed architect copy (the local TS2345 BuilderContext mismatch was a stale isolated node_modules; CI resolves to root 22). Verified: builder `tsc` clean against root devkit 22; full prod build 0 errors.
norman-abramovitz
approved these changes
Jun 14, 2026
norman-abramovitz
left a comment
Contributor
There was a problem hiding this comment.
LGTM Intermediate step to a full Angular 22 with stricter code.
norman-abramovitz
pushed a commit
that referenced
this pull request
Jun 14, 2026
Fix latent strict-null / strictPropertyInitialization findings in the store and core packages so they pass under full `strict: true`. Real guards and source-type fixes, not blanket non-null silencing: - store: 118 findings (entity-catalog, services, favorites, helpers, test helpers). Made APISuccessOrFailedAction.apiAction and IApiEndpointInfo.User optional/nullable at the source where the wire shape genuinely allows absence. - core: 358 findings (features, shared components/services, core internals). Definite-assignment (!) used only for Angular @Input/@ViewChild/@ContentChild and lifecycle/router-guaranteed fields, each with a justifying // strict: comment. Base tsconfig flags NOT yet flipped; enforced via measurement config until all packages are clean. Tracked from #5445.
norman-abramovitz
pushed a commit
that referenced
this pull request
Jun 14, 2026
…5446) Fix the cloud-foundry package's strict-null findings and resolve the connected TS2344/TS2430 action-builder type cascade at its root. - Action-builder root (store + cf + kubernetes): the concrete *ActionBuilders interfaces failed to satisfy OrchestratedActionBuilders' index signature under strict function-parameter contravariance. Fixed by broadening the trailing-arg tail of the core builder function types (...extraArgs: any[] in a contravariant parameter position) and collapsing a deferred-vs-resolved conditional type on StratosCatalogEntity. Type-only; no runtime change. Clears all 46 cascade errors across both consumer packages. - cloud-foundry findings (features, shared, entity-action-builders, entity catalog/generator/factory). Real guards and source-type fixes; ! only for lifecycle/router/filter-narrowing guarantees with comments. 2 pre-existing TS2344 in kubernetes-entity-generator (analysisReport registered with undefined metadata) are a separate root, deferred. Tracked from #5445.
norman-abramovitz
pushed a commit
that referenced
this pull request
Jun 14, 2026
…ip strict on (#5446) Complete the strict-null/strict adoption and flip the base tsconfig to `strict: true` globally. - kubernetes, cf-autoscaler, devkit, git: remaining strict-null findings fixed with real guards / source-type fixes. devkit Map index misuse (map[key] -> map.get(key)); minimal ambient fs-extra.d.ts (real signatures, not import silencing). - cloud-foundry cleanup: cf.helpers.ts + scattered feature files missed by the first pass. - core test-framework mocks: null -> '' for logo/link in test fixtures. - Adversarial triage: dead never-assigned fields on KubernetesEndpointService (info$, kubeDashboardVersion$) changed from a lying `!` to honest optional. - **Base tsconfig flipped to `strict: true`** (removed the strictNullChecks/strictPropertyInitialization:false opt-outs from #5445). - Strict templates (on under strict) surfaced 9 template-binding findings across 6 components (optional chaining on form .get(), optional @input link, guarded signal commit, endpoint guid). Fixed. Verified: full production `ng build` succeeds under strict (0 errors). 4 pre-existing TS6.0 demo-spec syntax errors in example-extensions remain (not in the production build; out of scope). Closes #5446. Tracked from #5445.
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.
Upgrades the frontend from Angular 21.2 to Angular 22.0.1 and TypeScript 6.0, with two follow-on cleanups. Three commits, each independently green.
1. Angular 22 + TypeScript 6.0 (
ba9166c1)@angular-eslint→ 22;@analogjs/*→ 2.6.1 (the package that unblocked this — supports Angular 22 and keeps vitest 4, so no zoneless/NG0203 regression);ng2-charts8 → 10;@angular-builders/custom-webpack→ 22; TypeScript 5.9 → 6.0 (required by Angular 22).ng updatemigration (safe-navigation wrapping, hydration/withXhr).stricton; this codebase runs non-strict, so the base tsconfig explicitly opts back out (strict/strictNullChecks/strictPropertyInitialization: false) to keep the upgrade behavior-neutral. The latent strict-null findings this surfaces are deferred to a dedicated workstream (see below). Also addsignoreDeprecations: "6.0"forbaseUrl.2. OnPush migration + strict-null down-payment (
c16bbfed)ChangeDetectionStrategy.Eager(Angular 22's rename of legacyDefault) to OnPush, and restores@angular-eslint/prefer-on-push-component-change-detectionto error (0 violations).@Input/lifecycle props, real null-guards inkubernetes-node-summary-card, removed a dead field).3. ESLint warning cleanup (
8237b6dc)_-prefixed unused caught-error/param, regex-escape +let→const. No behavior change.Validation (all three commits)
Deferred (tracked separately)
@Output/@Inputrenames, template a11y,prefer-standalone/prefer-inject, etc.