Skip to content

MBA-2260: Migrate angular2-hn from Angular to React - #709

Open
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1788194510-react-migration
Open

MBA-2260: Migrate angular2-hn from Angular to React#709
devin-ai-integration[bot] wants to merge 1 commit into
masterfrom
devin/1788194510-react-migration

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 31, 2026

Copy link
Copy Markdown

Summary

Rebuilds the Hacker News PWA client in React (Vite + React 18 + TypeScript + react-router-dom v6), replacing the Angular 9 app in-place with full feature parity (MBA-2260).

Mapping of the Angular pieces:

  • app.routes.tsApp.tsx routes: //news/1, five feed routes (/news|newest|show|ask|jobs/:page), lazy-loaded /item/:id and /user/:id (mirrors the Angular lazy modules).
  • HackerNewsAPIServicesrc/services/api.ts: same node-hnapi.herokuapp.com endpoints, poll-option aggregation preserved (poll_votes_count), Observable cancel-token replaced with AbortController.
  • SettingsServiceSettingsContext: identical localStorage keys/defaults (theme, titleFontSize, listSpacing, openLinkInNewTab) and the same prefers-color-scheme behavior (system dark → night only when no saved theme).
  • Components ported 1:1 (Header/Footer/Settings overlay, Feed/Item, ItemDetails with nested collapsible Comment tree and poll bars, User profile, Loader, skull ErrorMessage). All original SCSS kept, moved to src/styles/ with only selector-level adaptations (e.g. app-root:empty#root:empty pre-boot loader).
  • Angular service worker / ngsw-config.jsonvite-plugin-pwa (Workbox): precached build assets, NetworkFirst runtime cache for the HN API, manifest values (name, icons, colors) carried over unchanged — offline support and installability maintained.
  • Tests: Karma/Protractor replaced with Vitest + Testing Library (commentText, SettingsContext, api, Comment, Feed) and Playwright e2e (feed → item navigation, settings/theme switching) running against the built app via vite preview.

npm run lint, npm run test, npm run build, and npm run e2e all pass.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/0cd6012fc20043e6a844383c1371fee5
Open in Devin Desktop: https://app.devin.ai/desktop/session/0cd6012fc20043e6a844383c1371fee5?variant=devin


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Devin Review (Staging)

@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

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