feature: migrate Angular 2 HN to React + TypeScript (Vite) - #763
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
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>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
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/, rootpackage.json/yarn.lock,ngsw-config.json) is removed in the final commit, after the React build was verified in the browser.Preserved contracts
/→/news/1;/{news,newest,show,ask,jobs}/:page(bare/news→/news/1);/item/:idand/user/:idareReact.lazy+Suspense(mirrors the Angular lazy modules).src/services/hackerNewsApi.ts): same base URLhttps://node-hnapi.herokuapp.com, same shapes —fetchFeed(type, page),fetchItemContent(id)(incl. poll option fan-out onstory.id + i, summingpoll_votes_count),fetchUser(id). RxJS replaced withfetch+AbortSignal; pages abort in-flight requests on unmount.SettingsService→SettingsContext(localStorage keystheme,openLinkInNewTab,titleFontSize,listSpacing;prefers-color-schemelistener picksnightby default). Themesdefault/night/amoledblackapplied as class on the app root; SCSS copied with original class names.CommentPipe→utils/comment.ts;index.htmlkeeps the app-loader SVG, skip link, meta/theme-color, GA snippet.vite-plugin-pwa(autoUpdate, manifest fromsrc/manifest.json, precache js/css/html/ico/png/svg, SPAnavigateFallback).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.ymlruns lint/test/build inreact-app/on Node 20;firebase.jsonhostingpublic→react-app/dist.Verification:
npm run build,npm run lint,npm run format:check,npm testall pass; all feed routes, item page, user page and all three themes checked at http://localhost:5173.Note: the upstream
node-hnapi.herokuapp.com/user/:idendpoint currently returns 404 for every user, so/user/:idshows 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.