-
Notifications
You must be signed in to change notification settings - Fork 12
Migrate app from Angular 9 to React 18 + TypeScript (Vite) #435
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
d28625c
f76ed4d
adabbdb
1ed8695
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import js from '@eslint/js'; | ||
| import globals from 'globals'; | ||
| import reactHooks from 'eslint-plugin-react-hooks'; | ||
| import reactRefresh from 'eslint-plugin-react-refresh'; | ||
| import tseslint from 'typescript-eslint'; | ||
|
|
||
| export default tseslint.config( | ||
| { ignores: ['dist', 'dev-dist'] }, | ||
| { | ||
| extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
| files: ['**/*.{ts,tsx}'], | ||
| languageOptions: { | ||
| ecmaVersion: 2020, | ||
| globals: globals.browser, | ||
| }, | ||
| plugins: { | ||
| 'react-hooks': reactHooks, | ||
| 'react-refresh': reactRefresh, | ||
| }, | ||
| rules: { | ||
| ...reactHooks.configs.recommended.rules, | ||
| 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], | ||
| }, | ||
| } | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,24 +3,23 @@ | |
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>Angular 2 HN</title> | ||
| <base href="/"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Page logo and icons break when the site is opened directly on a nested URL The document's root link was removed ( Why relative URLs break without a base elementThis is a single-page app served with Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. Debug |
||
|
|
||
| <meta name="description" content="A Hacker News client built with Angular CLI, RxJS and Webpack"/> | ||
| <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 Angular CLI, RxJS and Webpack"> | ||
| <meta name="twitter:creator" content="@hdjirdeh"> | ||
| <meta name="twitter:image" content="assets/images/logo-loading.png"> | ||
| <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 Angular CLI, RxJS and Webpack"/> | ||
| <meta property="og:site_name" content="Angular 2 HN"/> | ||
| <meta property="fb:admins" content="10202985971279760"/> | ||
| <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"> | ||
|
|
||
|
|
@@ -43,17 +42,14 @@ | |
| <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> | ||
| <link rel="manifest" href="manifest.webmanifest"> | ||
| <meta name="theme-color" content="#1976d2"> | ||
| </head> | ||
| <body> | ||
| <div id="skip"><a href="#content">skip to navigation</a></div> | ||
| <app-root></app-root> | ||
| <div id="root"></div> | ||
|
|
||
| <div class="app-loader" id="content"> | ||
| <img class="logo" src="assets/images/logo.svg" alt="Logo"> | ||
|
|
@@ -74,5 +70,6 @@ <h4 style="font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetic | |
| ga('create', 'UA-66348622-3', 'auto'); | ||
|
|
||
| </script> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
📝 Info: Static manifest removal is consistent with vite-plugin-pwa auto-injection
The incremental change deletes
public/manifest.jsonand removes the<link rel="manifest">fromindex.html:35. This is consistent withvite.config.ts:9-31, whereVitePWAis configured with an inlinemanifestblock and thus generatesmanifest.webmanifestand auto-injects the manifest link at build time. Keeping the static reference would have produced a duplicate/conflicting manifest link, so removing it is the correct approach.Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
Playground