feat: Migrate Angular Hacker News Application to React#166
Open
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
Open
feat: Migrate Angular Hacker News Application to React#166devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
Conversation
- Set up React project with Vite, TypeScript, React Router v6, and SCSS - Converted HackerNewsAPIService from RxJS Observables to async/await - Created SettingsContext with React Context API for theme/font/spacing - Migrated all components: Feed, Item, ItemDetails, Comment, User, Header, Footer, Settings, Loader, ErrorMessage - Implemented lazy loading for ItemDetails and User routes - Preserved all 3 themes (default, night, AMOLED black) with SCSS theme engine - Set up PWA with vite-plugin-pwa (service worker + manifest) - Copied all static assets (icons, images) Co-Authored-By: Eashan Sinha <eashan.sinha@codeium.com>
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:
|
Co-Authored-By: Eashan Sinha <eashan.sinha@codeium.com>
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.
feat: Migrate Angular Hacker News app to React (Vite + TypeScript)
Summary
Adds a complete React rewrite of the Angular 9 Hacker News client in a new
react-app/directory. The existing Angular source is left untouched.Stack: React 18 + TypeScript + Vite + React Router v6 + SCSS + vite-plugin-pwa
Key conversions:
HackerNewsAPIService(RxJS Observables) → plainasync/awaitfetch functionsSettingsService(Angular injectable) → React Context (SettingsProvider/useSettings)ActivatedRoute→ React RouteruseParams+ component props@Input()decorators → React propscomment) → utility function (formatComment)ItemDetailsModule,UserModule) →React.lazy()+Suspensevite-plugin-pwawith matching manifest configThe TypeScript build (
tsc -b) and production build (vite build) both pass.Updates since last revision
node-hnapi.herokuapp.com/user/) returns 404 for all user requests (likely due to Heroku free tier removal). SwitchedfetchUserto use the official Firebase HN API (hacker-news.firebaseio.com/v0/user/) with manual timestamp-to-date conversion.Screenshots
News Feed:

Item Details with Comments:

User Profile:

Review & Testing Checklist for Human
node-hnapi.herokuapp.com, but user profiles come fromhacker-news.firebaseio.com. Confirm both are returning consistent data and the user profile date formatting looks correct.dangerouslySetInnerHTMLusage inComment.tsx,ItemDetails.tsx, andUser.tsx. This mirrors the Angular[innerHTML]binding but is an XSS surface if API data is untrusted.useEffectcleanup — fetch calls inFeed.tsx,ItemDetails.tsx, andUser.tsxdo not useAbortController, so rapid navigation could trigger state updates on unmounted components (React warning). The original Angular app handled this via Observable unsubscription./news,/newest,/show,/ask,/jobs), item detail pages (/item/:id), and user profiles (/user/:id).Suggested test plan: Run
cd react-app && npm install && npm run dev, then navigate through each feed type, click "More" for pagination, open a story with comments and test collapse/expand, click a username to view a profile, and toggle between all three themes in settings.Notes
react-app/.@importrules anddarken()) — these are functional today but will break in Dart Sass 3.0.0.eslint.config.jswas created, sonpm run lintmay not work as expected.Link to Devin run: https://app.devin.ai/sessions/d00d7e29933a47f09b922ef6df57c0c2
Requested by: @eashansinha