feature: migrate Conduit frontend from Angular v21 to React (Vite + TS)#50
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
feature: migrate Conduit frontend from Angular v21 to React (Vite + TS)#50devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Co-Authored-By: Jerry Oliphant <jerry.oliphant@cognition.ai>
… empty/malformed feed response, and Vite build output path in deploy workflow Co-Authored-By: Jerry Oliphant <jerry.oliphant@cognition.ai>
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
Full rewrite of the RealWorld "Conduit" frontend from Angular v21 to React 18 + TypeScript + Vite, preserving identical routes, behavior, validation, auth flows, and API integration against
https://api.realworld.show/api. Package manager stays Bun; therealworldsubmodule (theme CSS + SVG assets) is reused unchanged and wired into Vite viavite-plugin-static-copy.The Angular building blocks map to React as follows:
api/token/error)axiosinstance insrc/core/api/api-client.ts(baseURL prefix,Authorization: Token <jwt>request interceptor, response interceptor: 401 on non-/user→purgeAuth,normalizeError→{ ...body, status }with network fallback)UserService(RxJS subjects)UserProvidercontext insrc/core/auth/user-context.tsxJwtServicesrc/core/auth/jwt.ts(localStoragejwtToken)*ifAuthenticatedstructural directive<IfAuthenticated when={bool}>+useIsAuthenticated()canActivateguards<RequireAuth>/<RedirectIfAuthenticated>wrappersReactiveFormsModulereact-hook-formmarkdown/defaultImagepipessrc/shared/*helpers (marked+DOMPurify)Auth model is preserved exactly: 4 states (
loading|authenticated|unauthenticated|unavailable), 4XX-vs-5XX distinction onGET /user(4XX → logout, 5XX →unavailable), exponential-backoff auto-retry (2s→4s→8s→16s cap), and thewindow.__conduit_debug__contract (getToken/getAuthState/getCurrentUser) that the e2e suite depends on.Notable fixes in this PR (beyond the initial scaffold)
article-list.tsx: guard the feed response so a malformed/empty (204)/articlesbody can't crash the app —data.articles/articlesCountare validated beforesetResults, otherwiseresults.lengthin render threw and blanked the page.settings.tsx: omitpasswordfrom thePUT /userpayload when the field is blank (the API 422s on an empty password string), so a bio/image-only update succeeds and navigates to/profile/:username.deploy.yml: zip fromdist/(Vite output) instead ofdist/angular-conduit/browser.Testing
bun run build,bun run typecheck,bun run format:check— clean.test:e2e:security): 16/16 pass (XSS sanitization).test:e2e): 121/122 pass.Known failing e2e test (pre-existing test bug, not an app defect)
error-handling.spec.ts:63 "should handle 400 on article creation"mocksPOST https://api.realworld.show/api/articleswithout a trailing slash, but the article-create endpoint has always been/articles/with a trailing slash (unchanged from the original Angulararticles.service.ts). Playwright matches URLs with trailing-slash sensitivity, so the mock never matches and the request hits the live API (401 → logout → redirect to/login), so.error-messagesnever renders.This is contradictory with
error-handling.spec.ts:617, which mocksPOST .../articles/with the trailing slash and requires the app to use that exact URL. No single URL can satisfy both, so I preserved the original app's/articles/behavior (keeping test 617 green and matching the source app). Validation-error display itself works — it's exercised and green via other error-handling tests.Link to Devin session: https://app.devin.ai/sessions/bdf12282ffbb4a49b5ce370d920133f5
Requested by: @jerryoliphant-cog
Devin Review