feat: Begin Angular to React Migration (Steps 1-3) #133
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: Begin Angular to React Migration (Steps 1-3)
Summary
This PR implements the first three steps of migrating the Angular 2 Hacker News client to React:
Step 1 - Architecture Documentation: Added comprehensive documentation (
docs/ARCHITECTURE.md) mapping out the existing Angular app structure including components, services, routing, and data models.Step 2 - React Project Setup: Created a new React + TypeScript project in
react-app/using Vite with React Router and React Query installed.Step 3 - Data Layer Migration:
HackerNewsAPIServicefrom RxJS Observables to Promises (react-app/src/services/api.ts)react-app/src/hooks/useHackerNews.ts)react-app/src/types/index.ts)The React app includes placeholder components with routing structure matching the original Angular routes. UI component implementation will follow in subsequent migration steps.
Review & Testing Checklist for Human
fetchFeed,fetchItemContent, andfetchUsersuccessfully callhttps://node-hnapi.herokuapp.comand return expected datafetchItemContentfunction calculates poll option IDs asstory.id + i + 1- verify this matches the original Angular behaviorcd react-app && npm install && npm run devto verify the app builds and runsRecommended test plan:
cd react-app && npm install && npm run devStoryinterfaceNotes
crated_timetypo in theUserinterface is intentional - preserved from the original API/Angular codeLink to Devin run: https://app.devin.ai/sessions/dbe96ce8e425463d91b2d37d8eb06cf4
Requested by: piyush@cognition.ai