Migrate Angular 9 Hacker News PWA to React 18 with Vite #142
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.
Migrate Angular 9 Hacker News PWA to React 18 with Vite
Summary
This PR completes a full migration of the Hacker News PWA from Angular 9 to React 18, replacing the entire build system and application architecture:
Build System: Replaced Angular CLI with Vite, including Vite PWA plugin for service worker generation.
Services → Hooks/Context:
HackerNewsAPIService→useHackerNewsAPIhook (async/await instead of RxJS Observables)SettingsService→SettingsContextwith React Context APIRouting: Replaced Angular Router with React Router v6, including lazy loading for ItemDetails and User components.
Components: All Angular components converted to React functional components with hooks (Header, Footer, Feed, Item, ItemDetails, Comment, User, Settings, Loader, ErrorMessage).
Styling: Migrated all SCSS files with three theme support (default, night, amoledblack) and responsive design.
Review & Testing Checklist for Human
This is a complete framework rewrite with no automated tests, so thorough manual testing is essential:
/news/1,/newest/1,/show/1,/ask/1,/jobs/1and verify items load correctly with pagination/item/:id- verify comments render with proper nesting and collapse/expand works/user/:id- verify user info displays correctlyRecommended test plan: Run
npm run devlocally, then systematically test each route and feature listed above. Pay special attention to edge cases like empty feeds, deleted comments, and items without URLs.Notes
https://node-hnapi.herokuapp.comis unchanged from the original Angular appLink to Devin run: https://app.devin.ai/sessions/768b36f82fee44c3846712b2c04559b1
Requested by: Satwik Bebortha (satwik.bebortha@cognition.ai) / @satwik-cog