forked from housseindjirdeh/angular2-hn
-
Notifications
You must be signed in to change notification settings - Fork 12
Migrate from Angular 9 to React 18 + TypeScript + Vite #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
devanshi-gpta
wants to merge
8
commits into
master
Choose a base branch
from
devin/1783447848-react-migration-foundation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e11ecfd
React migration foundation: Vite + React 18 scaffold, models, API, Se…
devin-ai-integration[bot] d7d8a97
React migration: User component
devin-ai-integration[bot] 0bbc62d
React migration: Header, Footer, and Settings components
devin-ai-integration[bot] fcfbdda
React migration: Feed and Item components
devin-ai-integration[bot] a6b497f
React migration: ItemDetails and Comment components
devin-ai-integration[bot] 73cfd62
Integrate React feature components (Header/Footer/Settings, Feed/Item…
devin-ai-integration[bot] dc65ec1
Remove Angular files; update README, Travis CI, tsconfig/eslint for R…
devin-ai-integration[bot] de4b3ae
Address PR review: use onChange on theme radios, dedupe PWA manifest,…
devin-ai-integration[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| module.exports = { | ||
| root: true, | ||
| env: { browser: true, es2020: true }, | ||
| extends: [ | ||
| 'eslint:recommended', | ||
| 'plugin:@typescript-eslint/recommended', | ||
| 'plugin:react-hooks/recommended', | ||
| ], | ||
| ignorePatterns: ['dist', 'dev-dist', '.eslintrc.cjs'], | ||
| parser: '@typescript-eslint/parser', | ||
| plugins: ['react-refresh'], | ||
| rules: { | ||
| 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], | ||
| '@typescript-eslint/no-explicit-any': 'warn', | ||
| }, | ||
| }; |
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>Angular 2 HN</title> | ||
|
|
||
| <meta name="description" content="A Hacker News client built with React, TypeScript and Vite"/> | ||
|
|
||
| <meta name="twitter:card" content="summary"> | ||
| <meta name="twitter:site" content="@hdjirdeh"> | ||
| <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"> | ||
|
|
||
| <meta property="og:title" content="Angular 2 HN"/> | ||
| <meta property="og:type" content="website"/> | ||
| <meta property="og:url" content="https://angular2-hn.firebaseapp.com/"/> | ||
| <meta property="og:image" content="assets/images/logo-loading.png"/> | ||
| <meta property="og:description" content="A Hacker News client built with React, TypeScript and Vite"/> | ||
| <meta property="og:site_name" content="Angular 2 HN"/> | ||
| <meta property="fb:admins" content="10202985971279760"/> | ||
|
|
||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
|
||
| <meta name="theme-color" content="#b92b27"> | ||
|
|
||
| <meta name="msapplication-TileColor" content="#b92b27"> | ||
| <meta name="msapplication-TileImage" content="assets/icons/mstile-150x150.png"> | ||
| <meta name="msapplication-config" content="assets/icons/browserconfig.xml"> | ||
|
|
||
| <meta name="apple-mobile-web-app-capable" content="yes"> | ||
| <meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
|
|
||
| <link rel="manifest" href="/manifest.json"> | ||
| <link rel="mask-icon" href="assets/icons/safari-pinned-tab.svg" color="#b92b27"> | ||
|
|
||
| <link rel="icon" type="image/x-icon" href="/favicon.ico"> | ||
| <link rel="icon" type="image/png" href="assets/icons/favicon-32x32.png" sizes="32x32"> | ||
| <link rel="icon" type="image/png" href="assets/icons/favicon-16x16.png" sizes="16x16"> | ||
|
|
||
| <link rel="apple-touch-icon" sizes="180x180" href="assets/icons/apple-touch-icon.png"> | ||
| <link rel="apple-touch-icon" sizes="120x120" href="assets/icons/apple-touch-icon-120x120.png"> | ||
| <link rel="apple-touch-icon" sizes="152x152" href="assets/icons/apple-touch-icon-152x152.png"> | ||
| <link rel="apple-touch-icon" sizes="180x180" href="assets/icons/apple-touch-icon-180x180.png"> | ||
| <style> | ||
| #skip a { position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; } | ||
| #skip a:focus { position:static; width:auto; height:auto; } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div id="skip"><a href="#content">skip to navigation</a></div> | ||
| <div id="root"></div> | ||
|
|
||
| <div class="app-loader" id="content"> | ||
| <img class="logo" src="assets/images/logo.svg" alt="Logo"> | ||
|
|
||
| <noscript> | ||
| <h4 style="font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica;"> | ||
| Sorry, JavaScript needs to be enabled in order to run this application. | ||
| </h4> | ||
| </noscript> | ||
| </div> | ||
|
|
||
| <script> | ||
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | ||
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | ||
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | ||
| })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | ||
|
|
||
| ga('create', 'UA-66348622-3', 'auto'); | ||
|
|
||
| </script> | ||
|
|
||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Potential duplicate manifest links: static manifest.json and VitePWA-generated manifest
The
index.html:35has<link rel="manifest" href="/manifest.json">pointing to the static file inpublic/manifest.json. Meanwhile,vite-plugin-pwa(configured invite.config.ts:9-63) with amanifestoption will generate its ownmanifest.webmanifestand inject a second<link rel="manifest">tag into the built HTML. The browser will use the first manifest link it encounters. The two manifests currently have similar content, but maintaining both is fragile — changes to the VitePWA config won't take effect if the static manifest link comes first. Consider removing either the staticpublic/manifest.json+ the HTML link, or themanifestoption from VitePWA config.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in de4b3ae. Confirmed the built
dist/index.htmlpreviously emitted two<link rel="manifest">tags (static/manifest.json+ vite-plugin-pwa's/manifest.webmanifest). Setmanifest: falsein the VitePWA config so the plugin no longer generates/injects its own manifest; the staticpublic/manifest.json(kept unchanged for Firebase Hosting) is now the single source of truth. The built HTML now contains exactly one manifest link.