Skip to content

feature: migrate Angular 2 HN to React + TypeScript (Vite) - #763

Open
devin-ai-integration[bot] wants to merge 5 commits into
masterfrom
devin/1789133091-react-migration
Open

devin-ai-integration[bot] wants to merge 5 commits into
masterfrom
devin/1789133091-react-migration

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Parallel rewrite of the Hacker News PWA client from Angular to React 18 + TypeScript + Vite, living in react-app/. The Angular source (src/, angular.json, karma/tslint/tsconfig, e2e/, root package.json/yarn.lock, ngsw-config.json) is removed in the final commit, after the React build was verified in the browser.

Preserved contracts

  • Routes (react-router-dom v6): //news/1; /{news,newest,show,ask,jobs}/:page (bare /news/news/1); /item/:id and /user/:id are React.lazy + Suspense (mirrors the Angular lazy modules).
  • HN API (src/services/hackerNewsApi.ts): same base URL https://node-hnapi.herokuapp.com, same shapes — fetchFeed(type, page), fetchItemContent(id) (incl. poll option fan-out on story.id + i, summing poll_votes_count), fetchUser(id). RxJS replaced with fetch + AbortSignal; pages abort in-flight requests on unmount.
  • SettingsServiceSettingsContext (localStorage keys theme, openLinkInNewTab, titleFontSize, listSpacing; prefers-color-scheme listener picks night by default). Themes default / night / amoledblack applied as class on the app root; SCSS copied with original class names.
  • CommentPipeutils/comment.ts; index.html keeps the app-loader SVG, skip link, meta/theme-color, GA snippet.
  • PWA via vite-plugin-pwa (autoUpdate, manifest from src/manifest.json, precache js/css/html/ico/png/svg, SPA navigateFallback).

Tooling: strict tsconfig, ESLint + Prettier (format:check), Vitest + RTL (6 files / 9 tests: API service, comment util, Item, Settings, FeedPage, App routing), source maps, browserslist. .travis.yml runs lint/test/build in react-app/ on Node 20; firebase.json hosting publicreact-app/dist.

Verification: npm run build, npm run lint, npm run format:check, npm test all pass; all feed routes, item page, user page and all three themes checked at http://localhost:5173.

React app – /news/1
Night theme – /jobs/1
AMOLED theme – /jobs/1

Note: the upstream node-hnapi.herokuapp.com/user/:id endpoint currently returns 404 for every user, so /user/:id shows the (correctly rendered) error state for both the old and new app.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/a3a619343bf04f1f90d7b8550f5dff9e
Open in Devin Desktop: https://app.devin.ai/desktop/session/a3a619343bf04f1f90d7b8550f5dff9e?variant=devin
Requested by: @ishita-cog


Note

Devin errored when opening this Pull Request as ishita-cog.
As a fallback, Devin opened this PR as itself.

devin-ai-integration Bot and others added 5 commits September 11, 2026 13:29
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
@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