feature: scaffold React + TypeScript app alongside Angular (migration PR 1/N) - #707
feature: scaffold React + TypeScript app alongside Angular (migration PR 1/N)#707charityquinn-cognition wants to merge 2 commits into
Conversation
Adds a Vite React+TS app in react-app/ with ESLint, Prettier (matching the Angular app's prettier settings), SCSS support, the ported global stylesheet and theme partials, static assets, and a placeholder App component. Co-Authored-By: Charity Quinn <charity.quinn@cognition.ai>
🤖 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:
|
| <meta name="twitter:title" content="Angular 2 HN" /> | ||
| <meta name="twitter:description" content="A Hacker News client built with React, TypeScript and Vite" /> | ||
| <meta name="twitter:creator" content="@hdjirdeh" /> | ||
| <meta name="twitter:image" content="assets/images/logo-loading.png" /> |
There was a problem hiding this comment.
📝 Info: Carried-over broken social-image reference
The twitter:image and og:image tags point at assets/images/logo-loading.png, which does not exist under public/assets/images (only cog.svg, logo-header.png, logo.svg). This is copied verbatim from the original Angular index.html, so the broken reference is pre-existing, not introduced here.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Correct, logo-loading.png is missing on master too — carried over verbatim on purpose. Picking a replacement social image is a content decision, so I'd rather not change it silently here; flagging it for the PWA/metadata PR at the end of the migration series.
| <browserconfig> | ||
| <msapplication> | ||
| <tile> | ||
| <square150x150logo src="/mstile-150x150.png"/> |
There was a problem hiding this comment.
📝 Info: Pre-existing wrong tile-image path
square150x150logo points at /mstile-150x150.png, but the file lives at /assets/icons/mstile-150x150.png, so the tile image will not load. This is copied verbatim from the original Angular asset, so the issue is pre-existing.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Agreed, and pre-existing — the file is a byte-for-byte copy of the Angular asset. Leaving it as-is so this PR stays a pure port; the tile path (and the browserconfig.xml reference itself) is better fixed in the PWA PR at the end of the series.
| @include theme( | ||
| amoledblack, | ||
| $theme-amoledblack-body-background-color, | ||
| $theme-amoledblack-body-background-color, | ||
| $theme-amoledblack-body-background-color, | ||
| $theme-amoledblack-text-color, | ||
| $theme-amoledblack-text-color, | ||
| color.adjust($theme-amoledblack-text-color, $lightness: -33%), | ||
| $theme-amoledblack-body-background-color, | ||
| $theme-amoledblack-subtext-color, | ||
| $theme-amoledblack-secondary-color, | ||
| $theme-amoledblack-body-background-color, | ||
| $theme-amoledblack-secondary-color | ||
| ); |
There was a problem hiding this comment.
📝 Info: SCSS port matches the Angular original
The ported theme mixin, all three @include argument lists (12 args each), math.div($skull-size, 8), and color.adjust(..., $lightness: -33%) (replacing darken(..., 33%)) all match the original faithfully, with @import swapped for correctly-namespaced @use. No behavior change.
Was this helpful? React with 👍 or 👎 to provide feedback.
Co-Authored-By: Charity Quinn <charity.quinn@cognition.ai>
Runtime verification — React scaffoldTested end-to-end locally: Vite dev server ( Verified working React dev server renders the ported
768px mobile breakpoint + #root:empty loaderAt 500px width Issue found and fixed: relative asset paths broke on nested routesOn Regression: Angular app unaffected
Recording of the run is attached in the Devin session: https://app.devin.ai/sessions/8edab78f01c5451f9d61c114b94b7484 |
Summary
First PR of the Angular → React migration: adds a Vite React + TypeScript app under
react-app/that builds and renders a placeholder page. No Angular code is touched or removed; feature components come in later stacked PRs.The React app is a separate npm project (
react-app/package.json, its ownnode_modules) rather than sharing the rootpackage.json. Reason: Vite 8 / React 19 need TypeScript ~6, while the Angular app pinstypescript ~3.7.5— a single manifest can't satisfy both, and merging them would breaknpm run build/ng servefor the Angular app that still has to work during the migration. The final PR of the series deletes the Angular sources and movesreact-app/to the repo root.What's in it:
react-app/Vite + React 19 + TS scaffold,npm run dev|build|lint|format.@eslint/js,typescript-eslint,react-hooks,react-refresh,eslint-config-prettier) and Prettier configured with the Angular app's existing settings (trailingComma: es5,tabWidth: 4,singleQuote: true,printWidth: 120).src/styles.scss+src/app/shared/scss/{_media,_theme_variables,_themes}.scssintoreact-app/src/styles/, imported frommain.tsx. Deprecated Sass APIs were modernized so the build is warning-free:index.htmlcarries over the PWA/social meta, skip link and.app-loadermarkup; the Angularapp-root:emptyloader selector becomes#root:empty.react-app/public/:assets/icons/*,assets/images/*,favicon.ico,manifest.json.Apprenders inside thedefaulttheme wrapper so the ported theme SCSS is exercised.npm run lint,npm run format:checkandnpm run buildall pass inreact-app/; dev server renders:Devin-Org: engineering
Link to Devin session: https://app.devin.ai/sessions/8edab78f01c5451f9d61c114b94b7484
Open in Devin Desktop: https://app.devin.ai/desktop/session/8edab78f01c5451f9d61c114b94b7484?variant=devin
Requested by: @charityquinn-cognition
Devin Review