Skip to content

Migrate Angular 21 Conduit app to React 19 + TypeScript + Vite#30

Open
devin-ai-integration[bot] wants to merge 8 commits into
mainfrom
devin/1780065096-migrate-react
Open

Migrate Angular 21 Conduit app to React 19 + TypeScript + Vite#30
devin-ai-integration[bot] wants to merge 8 commits into
mainfrom
devin/1780065096-migrate-react

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented May 29, 2026

Copy link
Copy Markdown

Summary

Migrates the Angular 21 Conduit blogging platform to React 19 + TypeScript + Vite. The React app is scaffolded in react-app/ alongside the existing Angular source.

What was migrated:

  • Auth system — JWT login/register with AuthContext, localStorage persistence, window.__conduit_debug__ for e2e
  • Articles — Full CRUD, markdown rendering (marked + dompurify), tags, favorites
  • Comments — Create, delete, display with relative timestamps
  • Profiles — Follow/unfollow, authored/favorited article tabs
  • Settings — Profile updates (password only sent when non-empty)
  • Feeds — Global, personal (following), tag-filtered with pagination
  • Routing — All Angular routes preserved with React Router v6

Tech stack: React 19 + TypeScript + Vite 8, Vitest (15/15 tests passing), fetch + AbortController

Devin Review fixes applied:

  1. window.__conduit_debug__ interface for e2e test compatibility
  2. Clear invalid JWT on auth failure (with AbortError filter for StrictMode)
  3. Memoized listConfig/articlesConfig to prevent duplicate fetches
  4. Fixed stale tagList in Editor handleSubmit
  5. Only include password in Settings when non-empty (prevents 422)
  6. Added .catch() handler to Editor useEffect

Review & Testing Checklist for Human

  • Run cd react-app && npm install && npm run build — should compile with zero errors
  • Run cd react-app && npm test — 15 tests should pass
  • Start dev server and verify auth flow: register → login → create article → add comment → follow user
  • Verify Settings updates work without changing password (should not get 422)
  • Verify window.__conduit_debug__ exposes getToken(), getAuthState(), getCurrentUser()

Notes

  • Angular source code preserved — only react-app/ and README changed
  • CI security-tests and test failures are preexisting — they run Playwright e2e against the Angular app + external RealWorld API, not the React app. Our diff only touches react-app/ files.
  • API base URL: https://api.realworld.show/api

Link to Devin session: https://app.devin.ai/sessions/0a4a9b6d351e4f21b97c270ce626d02c
Requested by: @lburgers


Devin Review

Status Commit
🟢 Reviewed 1d31cea
Open in Devin Review (Staging)

- Port all Angular services to fetch-based API services with AbortController
- Convert Angular components to React functional components with hooks
- Set up React Router v6 with same URL structure
- Auth context with JWT token persistence via localStorage
- Markdown rendering with marked + DOMPurify
- 15 Vitest tests (services, utils, components)
- Build passes with zero TypeScript errors
- All original routes and functionality preserved

Co-Authored-By: Lukas Burger <lukaskburger@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
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, CI, and merge conflict monitoring

Co-Authored-By: Lukas Burger <lukaskburger@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

…tale tag

- Add window.__conduit_debug__ interface for e2e tests (getToken, getAuthState, getCurrentUser)
- Clear invalid JWT from localStorage on auth failure
- Memoize listConfig in Home and articlesConfig in Profile to prevent duplicate fetches
- Fix stale tagList in Editor handleSubmit by computing finalTagList synchronously

Co-Authored-By: Lukas Burger <lukaskburger@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

…atch

- Filter AbortError in AuthContext catch handler to prevent token deletion on StrictMode double-mount
- Only include password in Settings updateUser when non-empty to avoid 422 validation errors
- Add .catch() handler to Editor useEffect getArticle call matching codebase pattern

Co-Authored-By: Lukas Burger <lukaskburger@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

…ndling

- Reset profile/errors state on username change to prevent stale data flash
- Add try/catch/finally to handleDeleteArticle to handle API failures

Co-Authored-By: Lukas Burger <lukaskburger@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

- Use authState instead of user for feed=following redirect to avoid
  redirecting during auth loading phase
- Wrap fetch() in try/catch in api.ts to transform network errors into
  displayable Errors objects with 'Unable to connect' message
- Re-throw AbortError as-is for signal cancellation

Co-Authored-By: Lukas Burger <lukaskburger@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

- Add currentPage state and onPageChange to Profile's ArticleList
- Reset page to 1 when switching tabs or navigating between profiles
- Update Errors type to accept string | string[] matching API format
- Fix formatErrors to handle array values with flatMap

Co-Authored-By: Lukas Burger <lukaskburger@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

…n, consistent redirect

- Add catch blocks to both FavoriteButton and FollowButton to prevent unhandled promise rejections
- Change FavoriteButton redirect from /register to /login for consistency with FollowButton

Co-Authored-By: Lukas Burger <lukaskburger@gmail.com>
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.

1 participant