Phase 1: React 18 + Vite + TypeScript scaffold and shared infrastructure - #570
Open
vibhaseshadri-cognition wants to merge 3 commits into
Open
Phase 1: React 18 + Vite + TypeScript scaffold and shared infrastructure#570vibhaseshadri-cognition wants to merge 3 commits into
vibhaseshadri-cognition wants to merge 3 commits into
Conversation
Ports models, HackerNews API module, SettingsContext, comment count util, Loader/ErrorMessage and SCSS themes; adds Vitest + RTL, ESLint/Prettier and a GitHub Actions CI workflow.
🤖 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
First phase of the Angular → React migration. Adds a self-contained React app under
web/(Angular insrc/is untouched and still builds) plus a GitHub Actions workflow runninglint,test,buildforweb/. Later phases port the feature components on top of this shared infrastructure and only then delete the Angular source.What landed:
Stack: React 18 + TS, Vite 5, Vitest + React Testing Library (jsdom), ESLint 9 flat config + Prettier reusing the Angular repo's prettier settings (
tabWidth: 4,singleQuote,printWidth: 120,trailingComma: es5).Models (
src/models/) ported fromsrc/app/shared/models/as interfaces; fields the API omits (url,domain,poll,about, …) are optional sostrictmode is usable.api/hackerNews.tsreplacesHackerNewsAPIService— Observables become promises over nativefetch, base URL unchanged. Poll aggregation is preserved but now awaits all options instead of firing detached subscriptions:lazyFetchadditionally rejects on non-2xx so components can render the error state instead of parsing an error body.context/SettingsContext.tsxreplaces theSettingsServicesingleton: samelocalStoragekeys (theme,titleFontSize,listSpacing,openLinkInNewTab) and the sameprefers-color-schemebehaviour — subscribe to the media query, and on start-up fall back tonight/defaultfrom the query only when no theme was saved.utils/formatCommentCount.tsreplaces thecommentpipe;components/Loader/ErrorMessageport the shared components with their SCSS.Styles:
_media,_theme_variables,_themescopied over ($x / n→math.divso the build is warning-free); the three themes apply through theAppwrapperdivdriven bysettings.theme.27 tests pass;
npm run lintandnpm run buildare clean.Note: this PR targets
COG-GTM/angular2-hnbecause pushing toankehao-demo/angular2-hnreturns 403 (no write access); both repos are at the same commit.Link to Devin session: https://app.devin.ai/sessions/6382e57ba3ff4a388ee6e9bd0ad2d37d
Requested by: @vibhaseshadri-cognition
Devin Review