feat: React migration - Step 1 & 2: Project setup + routing#170
Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Open
feat: React migration - Step 1 & 2: Project setup + routing#170devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
…ct structure - Initialize React project with Vite and TypeScript template - Install react-router-dom v6 and sass dependencies - Migrate TypeScript models/interfaces (Story, Comment, User, PollResult, Settings, FeedType) - Implement React Router v6 with same route structure as Angular app - Add lazy loading for ItemDetails and UserProfile routes - Create placeholder page components (Feed, ItemDetails, UserProfile) - Create Header and Footer components - Port SCSS theme system (_themes, _theme_variables, _media) - Create App shell with theme wrapper and router outlet 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:
|
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
Scaffolds a new React application inside
react-app/as the first phase of migrating the Angular 2 Hacker News PWA to React. This PR covers Step 1 (project setup) and Step 2 (routing) only — page components are placeholders that will be implemented in follow-up PRs.What's included:
sassandreact-router-domv6Story,Comment,User,PollResult,Settings,FeedType)/news/:page,/newest/:page,/show/:page,/ask/:page,/jobs/:page,/item/:id,/user/:id)React.lazy()forItemDetailsandUserProfileroutes_themes.scss,_theme_variables.scss,_media.scss) ported from Angular<Outlet />Local Testing Screenshots
Verified locally — routing, redirects, and lazy loading all work as expected:
News feed route (

/news/1) — root/correctly redirects here:Item details route (

/item/123) — lazy loaded:User profile route (

/user/test) — lazy loaded:Review & Testing Checklist for Human
react-app/src/router.tsxmatchsrc/app/app.routes.ts— especially the redirect from/→/news/1, feed pagination routes, and lazy-loadeditem/userroutesHeader.tsxuses a simplified<NavLink>nav (visible in screenshots — links run together without spacing). The Angular header includes a logo SVG, settings cog icon, and different markup structure. Confirm whether this simplified version is acceptable for now or needs closer parityStory.time_agois typed asstringin React butnumberin the Angularstory.ts. The API likely returns a string — confirm this is intentional. Also note thecrated_timetypo inUseris preserved from the originalcd react-app && npm install && npm run buildto confirm clean compilation. SCSS deprecation warnings are expected (inherited from Angular theme system)Suggested test plan: Start the dev server (
cd react-app && npm run dev), verify/redirects to/news/1, click through each nav link (news → newest → show → ask → jobs), navigate to/item/123and/user/testdirectly, and confirm lazy loading works (check network tab for chunk loading).Notes
index.htmltitle is "react-app" — should be updated to match the app name@importsyntax and/division — builds with warnings but will need modernization before Sass 3.0Link to Devin run: https://app.devin.ai/sessions/2dcac70defc9410a99cfccf64cf16e3e
Requested by: @eashansinha