Skip to content

[Angular 21] Migrate angular2-hn from Angular 9 to Angular 21 (integrated, 5 parallel feature PRs) - #954

Open
devin-ai-integration[bot] wants to merge 13 commits into
masterfrom
devin/angular21-base
Open

devin-ai-integration[bot] wants to merge 13 commits into
masterfrom
devin/angular21-base

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Summary

Migrates angular2-hn from Angular 9 to Angular 21. This PR started as a shell; five parallel Devin sessions each ported one feature and their PRs are merged into this branch:

Feature PR Parity vs Angular 9
Feeds and pagination #957 6 feed pages, desktop and mobile match
Story page and comments #958 0 layout/style mismatches across 7 cases
User profile #956 matches; unknown user now shows an error
Header, footer and settings #955 header/footer 0% pixel diff in all 3 themes
PWA, parity suite and CI #959 service worker, manifest, Playwright suite, GitHub Actions

Integrated result (this branch): ng build OK, Vitest 45/45, Playwright parity suite (parity/) 44/44: same 22 specs green against legacy master on :4000 and Angular 21 on :4200.

Architecture

  • bootstrapApplication + app.config.ts (provideRouter(routes, withComponentInputBinding()), provideHttpClient(withFetch()), provideServiceWorker); no NgModules.
  • Lazy loadComponent routes: /:feedType/:page, /item/:id, /user/:id.
  • Standalone components with input(), inject(), signals and @if/@for; SettingsService state is a signal<Settings>.
  • @angular/build:application, Vitest, strict TS. Removed Karma, Protractor, TSLint, rxjs-compat, unfetch.
  • This is a fresh Angular 21 shell with the code ported into it, not a 9→10→…→21 ng update chain.

Behaviour changes for review

  • User profiles load from api.hnpwa.com/v0/user/:id.json: node-hnapi /user returns 404, so profiles are already broken on master.
  • Unknown user (HNPWA returns 200 null) shows Could not load user <id>. instead of legacy's endless loader.
  • Google Analytics (Universal Analytics, shut down) removed from index.html.
  • Dropped two legacy no-ops: [class.head-margin]="item.text" and a :host >>> block that compiled to a selector matching nothing.
  • Node 24 (.nvmrc): npm install crashes with edgesOut on Node 22's npm 10.

Open decisions: delete or port .travis.yml; add the angular21 parity job to CI; README contributors entry; the jobs header still links to Triplebyte (kept for parity).

Devin-Org: engineering

Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/bf04ab7bce1a434c9014a00a83a9e7dd
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/bf04ab7bce1a434c9014a00a83a9e7dd?variant=devin


Devin Review

devin-ai-integration Bot and others added 2 commits November 19, 2026 13:58
…t) with placeholder routes per feature

Co-Authored-By: danial.asaria <danialasaria@gmail.com>
Co-Authored-By: danial.asaria <danialasaria@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@socket-security

socket-security Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Priority Alert  (click "▶" to expand/collapse) Action
Low priority
Critical CVE: Remote code execution using __npm vite`-browser-external` virtual module

CVE: GHSA-p4f5-76q4-ffq7 Remote code execution using __vite-browser-external virtual module (CRITICAL)

Affected versions: >= 4.0.0 < 6.4.6; >= 7.0.0 < 7.3.8; >= 8.0.0 < 8.1.7; >= 8.2.0 < 8.2.5; >= 8.3.0 < 8.3.7

Patched version: 7.3.8

From: package-lock.json → npm/vitest@4.1.12 → npm/@angular/build@21.2.30 → npm/vite@7.3.7

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/vite@7.3.7. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

Devin Review found 1 potential issue.

Custom reviewers

  • ✨ Blast Radius Reviewer: no findings · View
  • 🛡️ API Security Reviewer: no findings · View

Devin Review

Comment on lines +27 to +33
const options = story.poll.map((_, i) => this.fetchPollContent(story.id + i + 1));
return forkJoin(options).pipe(
map((poll) => ({
...story,
poll,
poll_votes_count: poll.reduce((sum, option) => sum + option.points, 0),
}))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Poll option failures now block comments

If one option request fails, forkJoin errors without emitting the poll story or its comments. Previously, fetchItemContent emitted the story independently. No current component calls this service; the change becomes visible when item details returns.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

devin-ai-integration Bot and others added 11 commits November 19, 2026 14:02
Standalone components with inject(), signal-based SettingsService, @if/@for.
Markup, CSS classes, styles and text kept identical to the Angular 9 app.
Adds Vitest specs for header, footer and settings.

Co-Authored-By: danial.asaria <danialasaria@gmail.com>
…input, rxResource, @if)

Co-Authored-By: danial.asaria <danialasaria@gmail.com>
Co-Authored-By: danial.asaria <danialasaria@gmail.com>
… Angular 21

Standalone ItemDetailsComponent and recursive CommentComponent using
signals, input(), inject() and @if/@for, with the Angular 9 markup,
CSS classes and text kept as-is. Adds Vitest specs.

Co-Authored-By: danial.asaria <danialasaria@gmail.com>
…ceWorker

Co-Authored-By: danial.asaria <danialasaria@gmail.com>
…lar21

Co-Authored-By: danial.asaria <danialasaria@gmail.com>
Co-Authored-By: danial.asaria <danialasaria@gmail.com>
Co-Authored-By: danial.asaria <danialasaria@gmail.com>
@devin-ai-integration devin-ai-integration Bot changed the title [Angular 21] Base shell for the parallel Angular 9 -> 21 migration [Angular 21] Migrate angular2-hn from Angular 9 to Angular 21 (integrated, 5 parallel feature PRs) Nov 19, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

Custom reviewers

  • ✨ Blast Radius Reviewer: 1 finding · View
  • 🛡️ API Security Reviewer: no findings · View
  • 🔒 Sparta Review Guardrails (from top PR comments): no findings · View

Devin Review

Comment on lines +21 to +22
http.createServer((req, res) => {
const urlPath = decodeURIComponent(new URL(req.url, 'http://localhost').pathname);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟨 Malformed URLs terminate the parity server

A request containing /%ZZ makes decodeURIComponent throw outside any exception handler, terminating the parity server. listen(port) exposes this handler on all interfaces, allowing reachable network clients to stop parity runs.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +11 to +12
git -C "$REPO_DIR" fetch origin master
git -C "$REPO_DIR" worktree add --detach "$LEGACY_DIR" origin/master

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ Blast Radius Reviewer: P2 — Legacy parity baseline disappears after merge

After this migration merges into master, serve-legacy.sh checks out Angular 21 as the Angular 9 baseline. Its Node 14 runtime and ng build --prod command cannot build that checkout, so fresh parity runs fail.

View in Devin Review · Custom reviewer

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

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.

0 participants