Skip to content

feature: upgrade Angular 9 → 17 (stepwise, one major at a time)#434

Open
devin-ai-integration[bot] wants to merge 9 commits into
masterfrom
devin/angular9-to-17-upgrade
Open

feature: upgrade Angular 9 → 17 (stepwise, one major at a time)#434
devin-ai-integration[bot] wants to merge 9 commits into
masterfrom
devin/angular9-to-17-upgrade

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Upgrades this HackerNews PWA from Angular 9 → Angular 17, done rigorously one major at a time via the official ng update schematics (no skipped versions). The app stays NgModule-based (not converted to standalone). All @angular/* packages now on ^17.3.12, typescript ~5.4.5, zone.js ^0.14, tslib ^2.8. ng build, ng lint, and ng test (headless Chrome) all pass.

The history tells the migration story — one commit per major:

feature: baseline Angular 9 install and build
feature: upgrade Angular 9  -> 10   (Node 12.22.12)
feature: upgrade Angular 10 -> 11   (Node 14.21.3)
feature: upgrade Angular 11 -> 12   (Node 14.21.3)
feature: upgrade Angular 12 -> 13   (Node 16.20.2)
feature: upgrade Angular 13 -> 14   (Node 16.20.2)
feature: upgrade Angular 14 -> 15   (Node 16.20.2)
feature: upgrade Angular 15 -> 16   (Node 18.20.8)
feature: upgrade Angular 16 -> 17   (Node 18.20.8)

Node versions used per stage

Older Angular needs older Node; each major was run under the Node it supports (switched via nvm):

  • v9→10: Node 12.22.12
  • v11, v12: Node 14.21.3
  • v13, v14, v15: Node 16.20.2
  • v16, v17: Node 18.20.8

Notable breaking changes handled

  • Lint → ESLint (at v13): removed tslint.json + codelyzer; added @angular-eslint/* and @typescript-eslint/*. tslint.json deleted, .eslintrc.json added, angular.json lint builder switched to @angular-eslint/builder.
  • zone.js path changes (v17 / webpack 5):
    • src/polyfills.ts: zone.js/dist/zonezone.js
    • src/test.ts: zone.js/dist/zone-testingzone.js/testing
    • src/test.ts: replaced require.context(...) test discovery with import.meta.webpackContext(...) for webpack 5.
  • Stricter TS / unused-param rules: removed now-invalid unused callback params (e.g. error =>() =>) and dead Observable import in feed.component.ts, item-details.component.ts, user.component.ts, and several core components; letconst where flagged.
  • angular.json builder option renames applied by the v17 migration (e.g. output path / builder option keys).
  • Added a minimal src/smoke.spec.ts so the Karma/Jasmine suite has a passing spec after the testing-stack updates.
  • typescript bumped to 5.4.x (required by v17), zone.js to 0.14.x, tslib to 2.8.x. rxjs kept on 6.6.x (Angular 17 supports it; no RxJS 7 forcing needed to build).

Verification

  • npm run build
  • npm run lint
  • npm test -- --watch=false --browsers=ChromeHeadless ✅ (run against the Chrome binary directly)

Build still emits pre-existing Sass/CommonJS deprecation warnings but completes successfully.

UI testing

Running the upgraded app on Angular 17 and exercising the real UI (feeds, comments, user profiles) with a screen recording — will attach the recording/screenshots as a follow-up.

Link to Devin session: https://app.devin.ai/sessions/f8500ff4e0e747f2a5a4ae9c6edc00d3
Requested by: @stephencornwell


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

devin-ai-integration Bot and others added 9 commits July 8, 2026 03:56
Co-Authored-By: Stephen Cornwell <stephen@cognition.ai>
Co-Authored-By: Stephen Cornwell <stephen@cognition.ai>
Co-Authored-By: Stephen Cornwell <stephen@cognition.ai>
Co-Authored-By: Stephen Cornwell <stephen@cognition.ai>
Co-Authored-By: Stephen Cornwell <stephen@cognition.ai>
Co-Authored-By: Stephen Cornwell <stephen@cognition.ai>
Co-Authored-By: Stephen Cornwell <stephen@cognition.ai>
Co-Authored-By: Stephen Cornwell <stephen@cognition.ai>
Co-Authored-By: Stephen Cornwell <stephen@cognition.ai>
@stephencornwell stephencornwell self-assigned this Jul 8, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown
Author

UI test — Angular 17 upgrade verified end-to-end

Ran the upgraded app locally on Angular 17 (ng serve, Node 18) at localhost:4200 against the live HN API and exercised the real UI.

Results

  • ✅ Top (news) feed loads with live stories (title, points, author, comment count)
  • ✅ Feed switching — new / show / ask / jobs each route and render their own populated list
  • ✅ Story comment thread (/item/:id) shows the story + nested comments
  • ✅ Back navigation returns to the feed intact
  • ❌ User profile page — pre-existing, NOT an upgrade regression (details below)
Recording of the verified flow

UI test recording

Top feed + comment thread (PASS)
news feed story comments
news comments
Feed switching (PASS)
show jobs
show jobs
🔴 User profile page (pre-existing failure, unrelated to this PR)

user error

The app calls https://node-hnapi.herokuapp.com/user/:id, which returns 404 — that third-party API has no /user endpoint (feeds/items on the same API work). fetchUser() in src/app/shared/services/hackernews-api.service.ts is byte-identical on master and this branch, so the upgrade didn't change it. The app's error UI renders correctly. Fixing it (e.g. switching the user endpoint to the official Firebase HN API) would be a separate follow-up.

Tested via Devin.

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