Skip to content

Angular 20 cleanup: remove deprecated patterns#5286

Draft
norman-abramovitz wants to merge 36 commits intodevelopfrom
feature/Angular-21
Draft

Angular 20 cleanup: remove deprecated patterns#5286
norman-abramovitz wants to merge 36 commits intodevelopfrom
feature/Angular-21

Conversation

@norman-abramovitz
Copy link
Copy Markdown
Contributor

@norman-abramovitz norman-abramovitz commented Apr 1, 2026

Summary

  • Remove deprecated ComponentFactoryResolver, Compiler, and ngModuleFactory pipeline (FWT-888)
  • Replace 295 bare first() with take(1) across 157 files to eliminate EmptyError exceptions (FWT-907)
  • Add defaultIfEmpty guards on 15 critical observable paths
  • Fix 2 NG0203 toObservable() injection context errors
  • Fix CF home card missing ApplicationDeploySourceTypes provider
  • Detect platform mismatch in make dev backend (FWT-840)

Tickets

  • FWT-888: Migrate ComponentFactoryResolver to createComponent
  • FWT-907: Fix unhandled test errors in Kubernetes package
  • FWT-840: Build system improvements (partial)

Test plan

  • Build passes (make build cf)
  • Unit tests: 567 passed, 0 errors (2 pre-existing autoscaler failures)
  • K8s tests: 96 files, 101 tests, 0 errors
  • E2E tests: 89 passed, 0 failures
  • Manual verification: Home, CF Summary, Security Groups, Events pages

Replace deprecated Compiler/ngModuleFactory/
ComponentFactoryResolver pipeline with direct
dynamic imports for home card components.
Both CF and K8s entity generators now return
the component class via import().then() instead
of compiling module factories at runtime.
Replace 295 bare first() calls with take(1) across
157 files to eliminate EmptyError exceptions in
test environments. Add defaultIfEmpty guards on 15
critical paths (steppers, backup/restore, home page,
user profile, deploy steps). Fix two NG0203 errors
where toObservable() was called outside injection
context in create-release and chart-values-editor.
The CF home card component injects this service
but it is not providedIn root. Previously supplied
by CFHomeCardModule which is now bypassed by the
direct dynamic import. Add to component providers
and update spec to use overrideComponent.
Check binary architecture before starting the dev
backend server. Rebuild for the host platform if
the existing binary was cross-compiled for deploy.
@norman-abramovitz norman-abramovitz changed the title Angular 21 preparation Angular 20 cleanup: remove deprecated patterns Apr 2, 2026
Delete CFHomeCardModule, KubernetesHomeCardModule,
and MonocularModule. All wrapped components that
are already standalone. No consumers remain after
the ComponentFactoryResolver migration.
Add bounds checking in extractCerts to prevent
panic when request body has no colon delimiter.
The body is consumed by BindOnce before reaching
extractCerts — a pre-existing bug that needs a
deeper fix to pass cert data as form fields.
BindOnce in loginToCNSI consumed the request body before
K8s auth handlers could read it. All handlers now read
auth data from form fields instead of raw request body.
Also strips embedded whitespace from token paste.
File input now supports typing a path, clearing a
selected file, and browsing via file picker.
Convert 5 K8s component SCSS files to Tailwind utility
classes. Restore missing chart color swatches lost during
Tailwind migration — fixes invisible gauges in light mode.
Add Material Symbols Outlined font for icon rendering.
Fix list filter not restoring all items by simplifying
splitCurrentPage and removing switchMap re-subscription.
Fix table expander TypeError when config is pre-evaluated.
Fix resource viewer side panel with markForCheck on setProps.
Batch convert remaining small SCSS files in the K8s
package to Tailwind utility classes. Residual SCSS
kept only for child component selectors and mat-icon
sizing that Tailwind cannot express.
Add TitleCasePipe, DatePipe, RouterModule, MetadataItem,
and JsonViewer imports to KubernetesResourceViewerComponent.
Missing imports caused template rendering to fail silently,
producing empty side panel content.
Use RouterLink directive instead of RouterModule in
standalone component imports. Guard against null data
in ConfigMap/Secret entity column definitions.
Add markForCheck after setting count observables in
load() — OnPush change detection needs explicit trigger
when observables are assigned after initial render.
Replace nested sub-table with compact inline format
showing port/protocol (name) → targetPort :nodePort.
Change table row alignment from center to top for
better readability with multi-line cells.
Wire up [cellDefinition] on app-table-cell so columns
with valuePath (clusterIP, type, replicas, etc.) render
their values. Simplify service ports to inline format.
Port Protractor tests to Playwright with new page objects,
fixtures, and helpers. Tests run against local Stratos
(local auth) or remote (SSO); all core tests pass or
skip gracefully when environment lacks CF data.

- Add auth helpers: detectAuthType, browserLogin (local+SSO)
- Add page objects: APIKeysListPage, EndpointsPage, etc.
- Add list/table component helpers with findRow, getRowCount
- Fix view-toggle detection: isEnabled() not isVisible()
- Fix gate-check script: test-headless -> test
StratosBrandingService now injects HttpClient; add
provideHttpClient() to autoscaler component test setups.
getCurrentPageStartIndex was unused; remove it with its
tests. Add explicit type="text" to filter <input> so
Tailwind @tailwindcss/forms class strategy styles it.
Switch @tailwindcss/forms to class strategy so it only
styles elements with .input/.select, preventing accidental
global input resets. Replace shadow-sm with shadow-none.
Delete empty SCSS files and remove their styleUrls/styleUrl
references. Migrate SCSS content to Tailwind @apply directives
or inline classes. Delete unused _mixins.scss and theme.scss.
Wait for isLoadingPage$ to clear (filter enabled) after
goToAppsPage returns, so view toggles and filter input
are interactable. Increase getItemCount timeout in
list-filter and test timeouts for CF-latency-sensitive
session memory tests.
Update Angular across all 8 frontend sub-packages from 20.3.9
to 20.3.18, fixing 5 XSS advisories (GHSA-58c5, GHSA-g93w,
GHSA-jrmj, GHSA-prjf, GHSA-v4hv). Remove redundant Angular
overrides from root package.json (sub-packages now declare
correct version). Upgrade lodash-es to 4.18.0 (fixes
GHSA-f23m, GHSA-r5fr). Bump golang.org/x/crypto to v0.49.0
in jetstream modules (fixes CVE-2025-47914, CVE-2025-58181).
proxy.conf.cjs: change "/api/" key to "/api/v1" — Angular CLI
strips trailing slashes from proxy keys, causing "/api/" to match
"/api-keys" and forward it to the backend (404). Using "/api/v1"
matches only actual API routes.

auth.helper.ts: catch Firefox NS_BINDING_ABORTED on login redirect
by retrying waitForURL — Firefox aborts the old binding mid-redirect
but the navigation succeeds; the retry lets it complete.

api-keys.spec.ts: wait for list or no-content element before
branching — prevents false "not found" when the page is still
loading after networkidle timeout.
Add varsIgnorePattern for vitest lifecycle imports in test files,
eliminating ~974 false-positive no-unused-vars warnings. Run eslint
--fix for auto-fixable rules (boolean cast, useless escape). Phase 1
of FWT-876 ESLint cleanup.
Mechanical fixes across 32 files (788→723 warnings):
- Template == to === and != to !== (autoscaler, k8s)
- Wrap switch case bodies with lexical declarations in { }
- Replace !(obs$ | async) with === false/null as appropriate
- Replace {} type annotations with Record<string, unknown>
- Replace .hasOwnProperty() with Object.hasOwn()
Phase 2-3 of FWT-876 ESLint cleanup.
New features:
- make check (lint|gate|tests|coverage|e2e) — quality gate verb
- FINAL=strip — strip prerelease from version, persisted to package.json
- DRYRUN=yes — cross-cutting dry-run variable (bump supported)
- Remove bump release modifier (replaced by FINAL=strip on release)
Convert 8 files from constructor parameter DI to inject() pattern.
Handles super() calls, non-injectable string params (eslint-disable),
and Effects classes. Completes FWT-874 inject migration (24→0 warnings).
Add alt text to images, tabindex + keydown handlers for interactive
non-button elements, associate labels with form controls. Fix stray
eqeqeq in autoscaler step3. Completes FWT-875 accessibility fixes.
1826→681 warnings total (63% reduction across FWT-876).
Remove 59 dead RxJS operator and Angular type imports across 50 files.
Expand varsIgnorePattern for test files (fixture, component, etc.) and
add argsIgnorePattern/varsIgnorePattern for underscore-prefixed params.
1826→572 warnings (69% reduction). Remaining 492 unused-vars across
244 files need per-file review in a follow-up session.
Add caughtErrorsIgnorePattern: "^_" to both source and spec
file rule blocks. Update spec varsIgnorePattern from
literal "_" to "_\w*" to match underscore-prefixed names.

Enables _-prefix convention for intentionally unused catch
clause variables and test setup variables.
Subclasses still passed constructor args to base classes that
were migrated to inject(). Service list configs passed 5 args
where the base now takes only a URL string. Two value-position
Record<string, unknown> typos crashed the compiler.

- super(): drop now-empty args in autoscaler step 1-4 components,
  github-commits configs, cf-space-permission-cell
- service-instances list configs: pass only the URL string arg
- bind-apps-step: type bindingParams as Record<string, unknown>
- helm-release-resource-graph, variables-tab: replace literal
  Record<string, unknown> in value position with {}
- setup.actions SetupSuccess: payload type any (HTTP response
  object is not assignable to Record<string, unknown>)
- table-cell.component: Type<Record<...>> -> Type<any> for
  ViewContainerRef.createComponent compatibility

Build now succeeds; E2E core suite passes (71/0).
Mechanical cleanup pass across 260 files. Five remaining
warnings are intentional T type parameters on public API
interfaces (CfAPIResource, IBaseListAction,
TailwindSnackBarRef, UniquenessValidatorConfig,
KubernetesPodTagsComponent).

- Prefix unused function args, catch clause vars and assigned
  locals with _ (script-applied; destructured props use
  rename syntax: { name: _name } not { _name })
- Remove unused imports left over from inject() and take(1)
  migrations (Store, CFAppState, ChangeDetectionStrategy,
  first, ChangeDetectorRef, signals imports never wired up,
  etc.)
- Remove dead local interfaces and helper functions
  (DomainFormModel, IValueLabels, getUniqueKeys, etc.)
- Remove unused 'T' generics from non-public methods
- Block-disable unused-vars on test framework barrel
  re-exports in core-test.helper.ts

All unit tests pass; build clean; E2E core suite green.
GitHub Dependabot flagged 13 new alerts since last push:
- hono < 4.12.12 (5 medium): cookie name handling, IP
  matching, serveStatic middleware bypass, toSSG path
  traversal
- @hono/node-server < 1.19.13 (1 medium): same serveStatic
  bypass
- vite <= 6.4.1 (7 high+medium): arbitrary file read via
  dev server WebSocket, server.fs.deny bypass, .map path
  traversal

All come in transitively (hono via @angular/cli ->
@modelcontextprotocol/sdk; vite via build tooling). Pin
patched versions through package.json overrides so the
bumps stay in semver-patch range without making them
direct dependencies. vite stays in 6.x (no major bump).

Build and gate check (1104 tests) pass.
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