Skip to content

feat: migrate ItemComponent to React 19 (step 1 of Angular → React migration)#162

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

feat: migrate ItemComponent to React 19 (step 1 of Angular → React migration)#162
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin/1770737756-react-migration-item-component

Conversation

@devin-ai-integration
Copy link

Summary

First step of the Angular → React 19 migration. Adds a new react-upgrade/ folder (Vite + React 19 + TypeScript) containing the migrated ItemComponent — the leaf component that renders individual Hacker News stories.

What's migrated:

  • ItemComponentsrc/components/Item/Item.tsx (React functional component with props)
  • TypeScript models: Story, Comment, FeedType, PollResult, Settings (converted from Angular classes to interfaces)
  • CommentPipeformatComments utility function
  • Item CSS ported from Angular SCSS to plain CSS
  • Basic app shell (header + feed list) wired to the live HN PWA API to demonstrate the component working end-to-end

What's NOT migrated yet: Settings service/context, themes (night/amoled), remaining components (Feed, ItemDetails, Comment, User, Header, Footer), Service Worker/PWA support, routing for sub-pages.

No existing Angular code was modified.

React 19 migration screenshot

Review & Testing Checklist for Human

  • CSS fidelity: Compare the React app side-by-side with the Angular app — the SCSS theme variables/mixins were manually converted to plain CSS, and component-scoped styles are now global classes. Verify no visual regressions or class name collisions are introduced
  • Model types: time_ago is typed as number in the original Angular Story class but the API actually returns a string — the React Story interface kept string on Comment.time_ago but number on Story.time_ago. Verify this inconsistency is acceptable or should be normalized
  • Test locally: Run cd react-upgrade && npm install && npm run dev, open http://localhost:5173, confirm stories load with titles, points, authors, time, and comment counts

Notes

- Initialize React 19 + TypeScript + Vite project in react-upgrade/
- Migrate Item component from Angular to React functional component
- Port TypeScript models: Story, Comment, FeedType, PollResult, Settings
- Convert Angular comment pipe to formatComments utility
- Add react-router-dom for Link support
- Replicate header, layout, and item styling from Angular app
- Wire up HN PWA API to demonstrate working Item component

Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
@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