Skip to content

chore(deps): move viewer to Angular 22.2.3 and Node 24.22.0 - #209

Merged
fjlopez merged 9 commits into
devfrom
chore/viewer-angular-22.2.3
Oct 19, 2026
Merged

fjlopez merged 9 commits into
devfrom
chore/viewer-angular-22.2.3

Conversation

@fjlopez

@fjlopez fjlopez commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Why

Operators need a supported Node and Angular LTR pair. Angular 19 does not support Node 24, so both move together to Angular 22.2.3 and Node 24.22.0.

What changed

  • Pin Angular packages and CLI to 22.2.3, TypeScript to 6.0.x, and Node engines to ^24.22.0 || ^26.0.0.
  • Keep @angular-builders/custom-webpack for the api-sitna copy and proxy; stub @spz-loader/core and skip Babel on jszip/util so production optimize stays green.
  • Drop --openssl-legacy-provider from build scripts and CI after production builds succeed without it.

Scope

  • Covers the viewer app toolchain and migration fallout needed for a green production build and Jest suite.
  • Leaves the stack root Node pin and front/Dockerfile openssl flag to stack-pointers.

Tradeoffs

  • Custom webpack stays instead of @angular/build:application, because the api-sitna asset copy, process polyfill, and catastro proxy already live there.
  • Cesium Gaussian-splat loading is stubbed; SITMUN map flows do not use it.

Blast Radius

  • Viewer operators and CI switch to Node 24 and Angular 22. Public and password map screens need a visual check before land.

Verification

  • npm run lint exit 0
  • npm run build -- --configuration=production --base-href=/sitmun-viewer-app/ exit 0 (initial total 4.59 MB)
  • npm run test:coverage 123 suites / 1409 tests passed on Node v24.22.0 with @angular/core 22.2.3

Keep supported Node and Angular LTR pins together. Drop openssl-legacy-provider
now that production builds succeed on Node 24. Stub Cesium @spz-loader so the
custom-webpack optimizer stays green.
Angular 22 forces Babel on matched browserslist deps. The webpack-dev-server
client logger hit the same crash path as jszip, so e2e serve never became ready.
Replacing devServer.proxy dropped /backend and /middleware from
proxy.conf.e2e.json, so Playwright setup got 404 on admin login.
Babel on the HMR client left bare `import hotEmitter` in polyfills and
whitescreened login. E2E and local serve do not need that client.
webpack-dev-server hangs then dies mid Playwright suite under Angular 22;
build once and proxy /backend + /middleware from a tiny static host.
Comment thread scripts/serve-e2e.mjs Fixed
Stops a stale document (including bare Not found) from sticking on
SPA routes when a previous worker or cache answered /auth/login.
CodeQL flagged user path data flowing into http.request via URL
resolution. Keep hostname/port on the fixed localhost targets and
normalize the inbound path before forwarding.
@fjlopez

fjlopez commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Webpack builder deprecation (operator note)

Warning-only. CI npm run build prints Angular’s @angular-devkit/build-angular:browser deprecation and then completes successfully (confirmed on the prior green build job for this PR). It does not fail the job.

Stay on webpack for #209. angular.json still uses @angular-builders/custom-webpack:browser plus webpack.config.js (Cesium @spz-loader stub and related Angular 22 Babel exclusions). Migrating to @angular/build:application is intentionally out of scope for this LTR pin PR; tracked as follow-up when custom-webpack can be retired.

CHANGELOG [Unreleased] / Tooling bullet updated to say the same.

Angular 22 warns that the webpack browser builder is deprecated; keep
custom-webpack for this LTR pin until Cesium/@spz-loader can move.
@fjlopez

fjlopez commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

Status: ISSUES (not STACK-READY)

Tip: fa667b7 on chore/viewer-angular-22.2.3 (pushed).

Root cause addressed

Prior mid-suite ECONNREFUSED :4400 was webpack-dev-server dying under Playwright load (head4: 22 pass then cascade). Premise that more WDS patches would hold was abandoned.

Shipped: npm run start:e2e builds the e2e config and serves dist/viewer-app statically with /backend + /middleware proxies (scripts/start-e2e.mjs, scripts/serve-e2e.mjs). Stack harness pins Node from viewer .nvmrc.

Best verified run

/tmp/swarm-viewer-angular/gates/e2e-viewer-head10.log — 56 passed, 2 failed, EXIT=1 in 6.3m. No mid-suite webServer death. Catalog tests past the old death zone all green.

Remaining 2 in that run:

  1. language-chrome — SPA hit a stale service-worker "Not found" document → stack serviceWorkers: 'block'
  2. basemap-none — strict mode on two .ol-viewport nodes → .first()

Blocker for EXIT=0

Repeated follow-up full runs are aborted by port contention / SIGKILL (137) from concurrent agents on :18080 / :18093. Cannot claim STACK-READY without an undisturbed npm run e2e:viewer EXIT=0.

Do not merge until a clean EXIT=0 is recorded.

@fjlopez
fjlopez merged commit 0b392f1 into dev Oct 19, 2026
3 checks passed
@fjlopez

fjlopez commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

STACK-READY (stack e2e:viewer) — no further merge needed

PR tip 7d5169c (already merged). Contiguous solo proof on stack dev @ 04d481d4:

npm run e2e:viewer   # Node 24.22.0, SITMUN_E2E_SKIP_BUILD=1
58 passed, 1 skipped, EXIT=0 in 7.5m
log: /tmp/swarm-viewer-angular/gates/e2e-viewer-head26.log

Stack fix that unblocked password/catalog (pushed to stack dev): 04d481d scopes serviceWorkers: 'block' to viewer-public only. Global block from 311e6f4 broke waitForServiceWorkerControl / proxy_token flows.

Earlier contaminated runs (EADDRINUSE / SIGKILL 137 / mid-suite admin 502) were host contention with concurrent swarm-backend-gradle, not product asserts. Focused language+secured-WMS and --last-failed 23/23 also green before the contiguous EXIT=0.

Chrome responsive shots landed under stack test-results/layer-catalog-Map-chrome-*/*/attachments/.

No merge action from this agent.

@fjlopez

fjlopez commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

STACK-READY chrome evidence (head26 EXIT=0)

e2e-like-480x360-capas-COLLAPSED-png-e7b8e9a08ba2991abe96c4d3f5e4b716b1ca0ed1

partner-like-1024x768-capas-OPEN-png-d749b3b1c88b5d5bc71c8964a7bdc7aab90cc34c

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.

2 participants