Skip to content

feat: React migration - Step 1 & 2: Project setup + routing#170

Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1771014749-react-migration
Open

feat: React migration - Step 1 & 2: Project setup + routing#170
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1771014749-react-migration

Conversation

@devin-ai-integration
Copy link

@devin-ai-integration devin-ai-integration bot commented Feb 13, 2026

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:

  • Vite + React 19 + TypeScript project with sass and react-router-dom v6
  • TypeScript interfaces migrated from Angular classes (Story, Comment, User, PollResult, Settings, FeedType)
  • React Router v6 config mirroring the Angular route structure (/news/:page, /newest/:page, /show/:page, /ask/:page, /jobs/:page, /item/:id, /user/:id)
  • React.lazy() for ItemDetails and UserProfile routes
  • SCSS theme system (_themes.scss, _theme_variables.scss, _media.scss) ported from Angular
  • App shell with theme class wrapper, Header nav, Footer, and <Outlet />

Local Testing Screenshots

Verified locally — routing, redirects, and lazy loading all work as expected:

News feed route (/news/1) — root / correctly redirects here:
News feed route

Item details route (/item/123) — lazy loaded:
Item details route

User profile route (/user/test) — lazy loaded:
User profile route

Review & Testing Checklist for Human

  • Route structure parity: Verify the routes in react-app/src/router.tsx match src/app/app.routes.ts — especially the redirect from //news/1, feed pagination routes, and lazy-loaded item/user routes
  • Header divergence: The React Header.tsx uses 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 parity
  • Type accuracy: Story.time_ago is typed as string in React but number in the Angular story.ts. The API likely returns a string — confirm this is intentional. Also note the crated_time typo in User is preserved from the original
  • Build locally: Run cd react-app && npm install && npm run build to 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/123 and /user/test directly, and confirm lazy loading works (check network tab for chunk loading).

Notes

  • Vite template boilerplate (README.md, vite.svg, react.svg) is still present — can be cleaned up in a follow-up
  • index.html title is "react-app" — should be updated to match the app name
  • SCSS uses deprecated @import syntax and / division — builds with warnings but will need modernization before Sass 3.0
  • No CI checks are configured for this repo

Link to Devin run: https://app.devin.ai/sessions/2dcac70defc9410a99cfccf64cf16e3e
Requested by: @eashansinha

…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>
@devin-ai-integration
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants