Repository navigation
feature: Angular 9 → React + TypeScript PWA migration (react-app/: Vite, React Router, TanStack Query, vite-plugin-pwa, Firebase, GitHub Actions) - #878
Open
devin-ai-integration[bot] wants to merge 33 commits into
Conversation
…ery hooks, settings, router, utils) Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…ngs, time_ago type, mstile path) 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>
…undation' into devin/1791470119-react-user-profile
…undation' into devin/1791470084-react-feeds
…o React Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
…I for the React app Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
…undation' into devin/1791470086-react-pwa-build-deploy
…and comment link styles Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
…undation' into devin/1791470088-react-item-details
…undation' into devin/1791470119-react-user-profile
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
…undation' into devin/1791470086-react-pwa-build-deploy
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
… error for non-numeric item ids Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
…hange, scope popup styles to #popup1 Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
…undation' into wt-879-review
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai> # Conflicts: # react-app/src/router/routes.test.tsx
…ook control Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
…undation' into devin/1791470086-react-pwa-build-deploy
…rs from cache Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
… first-visit cache warm-up Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
…ettings (ported Protractor coverage) Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
Co-Authored-By: Ishita Gupta <ishita.gupta@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is the complete Angular 9 → React + TypeScript migration. It adds a standalone Vite PWA in
react-app/and leaves the Angular app insrc/untouched. Phase 0 (foundation) landed here first. The five parallel workstreams were then merged into this branch:core/Header,Footer,Settings; Default / Night / AMOLED themes, persisted to the same localStorage keys as Angularfeeds/Feed+Item: all 5 feeds, pagination, title-size/spacing settingsitem-details/ItemDetails+ recursiveComment(collapse keeps the DOM viahidden), pollsuser/User(HNPWA API, because node-hnapi/userreturns 404)vite-plugin-pwa(generateSW, NetworkFirst API caches, SPAnavigateFallback), a cleanup worker at the old/ngsw-worker.jsURL that retires the Angular SW,firebase.json→react-app/dist,.travis.yml→.github/workflows/react-app.ymlStack: Vite 7, React 19, React Router 7, TanStack Query 5, Sass, Vitest + Testing Library, Playwright, ESLint 9, and Prettier (settings copied from the root
package.json).Phase 0 foundation:
shared/models/*: the Angular model classes become interfaces with the same fields.HackerNewsAPIService→shared/services/hackernews-api.ts: Promise +AbortSignal, wrapped by theuseFeed/useItem/useUserhooks. Poll options load withPromise.allSettled, so one failed option no longer breaks the whole item.SettingsService→SettingsProvider+useSettings().commentpipe →formatCommentCount.sanitizeHtml: an allowlist sanitizer, because React doesn't sanitizeinnerHTMLthe way Angular did.app.routes.ts→router/routes.tsx:Deliberately dropped: the Google Analytics UA snippet. Universal Analytics was shut down in 2023.
Tests (Phase 2)
npm testruns 126 Vitest + Testing Library tests in 14 files. The Angular app had no Karma specs to port; the Protractor spec only checked the page title and console errors.npm run e2eruns 12 Playwright tests against the production build. 36/36 passed with--repeat-each=3.e2e/app.spec.ts(mocked API) covers: the/redirect, all feed nav links, pagination numbering from 31, item page sanitizing and nested comments, a user profile and the unknown-user error, theme persistence across reloads, and no console errors (the check ported from the Protractor spec).e2e/offline.spec.tscovers: first visit then offline reload, offline deep links, and the Angular SW → React SW upgrade.checkande2ejobs are green on this PR.deployruns only on pushes tomasterwhen aFIREBASE_SERVICE_ACCOUNTorFIREBASE_TOKENsecret exists.Lighthouse (Lighthouse 12,
vite preview,/news/1, live API, integrated build):ng build --prod, mobile (from #883)The accessibility score of 96 comes from
link-in-text-block: the mobile.comment-numberlink is red on grey with no underline. The markup and colours are copied unchanged from the Angularitem.component. I left it as is to keep visual parity.Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/7cf5168b5db44e91b8292c4e209d4584
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/7cf5168b5db44e91b8292c4e209d4584?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