Skip to content

feature: migrate to React + TypeScript (Vite), remove Angular, GitHub Actions CI, Firebase serves react-app/dist - #928

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

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

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

Completes the Angular 9 → React 19 + TypeScript (Vite) migration of the HN PWA and cuts over: Angular is removed, CI moves from Travis to GitHub Actions, and Firebase Hosting now serves react-app/dist.

Starts from the integrated react-app/ in #927 (which ports all features but stops before cut-over). This PR overlaps/supersedes #922–#927; only one should land.

On top of #927's react-app/:

  • Playbook layout: src/api → src/services, src/features → src/pages (imports updated, no behaviour change).
  • react-router-dom 6.30 → 7.18 (clears the v6 Snyk advisory); removed the v6 future flags (ROUTER_FUTURE_FLAGS), which are the v7 defaults.
  • Playwright e2e (react-app/e2e/, replaces the Protractor spec): app shell + no console errors, all 8 routes, header/footer nav, item/user/error pages, theme persistence + settings popup, PWA precache / Angular ngsw retirement, offline deep links. Runs against vite build + vite preview with the HN APIs mocked. 29/29 pass locally.
  • CI/CD: .travis.yml (Node 6, Angular CLI) → .github/workflows/react-app-ci.yml (lint, prettier, tsc -b, Vitest, build, Playwright) and react-app-deploy.yml (Firebase deploy on master, skipped when no FIREBASE_SERVICE_ACCOUNT/FIREBASE_TOKEN secret).
  • firebase.json: hosting.public: "react-app/dist", SPA rewrite limited to route-like URLs (missing static files still 404), immutable caching for hashed assets, no-cache for index.html, sw.js, ngsw-worker.js, manifest.
  • Cleanup (only after the checks below passed): removed src/, e2e/, angular.json, tsconfig*.json, karma.conf.js, tslint.json, ngsw-config.json, browserslist, yarn.lock; root package.json now has no deps and just forwards dev/build/test/lint/typecheck/e2e to react-app/.
  • README / CONTRIBUTING / react-app/README.md rewritten for the React stack.

Things to know before merging

  • User profiles come from https://api.hnpwa.com/v0/user/{id}.json, carried over from React port: integrated react-app/ (foundation + feeds, item/comments, user, shell) #927, because node-hnapi's /user/:id returns 404. On master, /user/pg currently shows "Could not load user pg." (see the side-by-side below). Feed and item endpoints are unchanged.
  • The legacy Universal Analytics snippet (UA-66348622-3) is ported as-is from Angular. UA has been shut down, so it's a no-op, same as on master.
  • The first deploy needs a Firebase secret on the repo/production environment. Until one is added the deploy job just logs a notice.

Verification

  • react-app: npm run lint, format:check, typecheck clean; Vitest 127/127; vite build OK (13 precache entries); Playwright 29/29; npm audit 0 vulnerabilities.
  • Side by side with the Angular app (master, ng serve on :4300) against the live API at 1280px and 390px: feeds in all 3 themes, item + comments, settings popup, mobile item header. The only difference was the user page (see above).

React app (/news/1):

React app news feed

Angular (left) vs React (right):

Feed, default theme
Feed, night theme
Item and comments
Settings popup
User page (Angular fails on node-hnapi /user)

Devin-Org: engineering

Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/f9c8ac375ddf4a1c9fc6ace52b5c5c21
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/f9c8ac375ddf4a1c9fc6ace52b5c5c21?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 Review

Status Commit
⚪ Not started —

Run Devin Review

Enable auto-review to review your pull requests automatically.

Devin Review (Staging)


Devin Review

…ular, GitHub Actions CI, Firebase serves react-app/dist

Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
@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

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

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