Migrate Angular 9 Hacker News client to React 18 #146
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 client to React 18
Summary
This PR completes a full migration of the Hacker News PWA client from Angular 9 to React 18. The migration includes:
Build System: Replaced Angular CLI with Vite for faster development and builds. Updated TypeScript configuration for React/JSX support.
Service Layer: Converted
HackerNewsAPIServiceto a customuseHackerNewsAPIhook using async/await instead of RxJS Observables. ConvertedSettingsServiceto React Context (SettingsContext) with localStorage persistence and system dark mode detection.Components: Migrated all Angular components to React functional components:
Routing: Replaced Angular Router with React Router v6. Implemented lazy loading using
React.lazy()andSuspensefor item details and user routes.Styling: Preserved SCSS styles with theme support (default, night, amoledblack). Migrated theme mixin system.
Review & Testing Checklist for Human
This is a complete framework rewrite with significant risk. Please verify:
/news/1,/newest/1,/show/1,/ask/1,/jobs/1and paginationRecommended test plan:
npm install && npm run devNotes
Link to Devin run: https://app.devin.ai/sessions/85edcbd223a64437937f4d1e6a8b5754
Requested by: Satwik Bebortha (satwik.bebortha@cognition.ai) / @satwik-cog