From 9a93959534539f9a7f74271cce924a04e8eef299 Mon Sep 17 00:00:00 2001 From: Jacob Paris Date: Sat, 12 Oct 2024 14:06:34 +0800 Subject: [PATCH 1/5] fix: update to react 19 --- package-lock.json | 36 +++++++++++++----------------------- package.json | 14 ++++++++++---- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7cf1bdd0..dfd55d58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,8 +56,8 @@ "morgan": "^1.10.0", "prisma": "^5.17.0", "qrcode": "^1.5.3", - "react": "^18.3.1", - "react-dom": "^18.3.1", + "react": "^19.0.0-rc-09111202-20241011", + "react-dom": "^19.0.0-rc-09111202-20241011", "remix-auth": "^3.7.0", "remix-auth-github": "^1.7.0", "remix-utils": "^7.6.0", @@ -17527,28 +17527,22 @@ } }, "node_modules/react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.1.0" - }, + "version": "19.0.0-rc-09111202-20241011", + "resolved": "https://registry.npmjs.org/react/-/react-19.0.0-rc-09111202-20241011.tgz", + "integrity": "sha512-kAz5u4PAPQJI2VJzUrYC/p82CoPcl/KD7i1tHe+nu3RezaAvHGCZY339bLFMBzY91jnJoo07JQZ6UsqivtQ2vQ==", "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", - "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "license": "MIT", + "version": "19.0.0-rc-09111202-20241011", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.0.0-rc-09111202-20241011.tgz", + "integrity": "sha512-iGX/aJR6YjAHHUtmPNf2YmR8e2pYmlRL28tR/PO6VdIGBqNzzLMNnTEcgjlPPQ0rXBjI0IL7SJnOFYWmk3ZGjw==", "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" + "scheduler": "0.25.0-rc-09111202-20241011" }, "peerDependencies": { - "react": "^18.3.1" + "react": "19.0.0-rc-09111202-20241011" } }, "node_modules/react-is": { @@ -18373,13 +18367,9 @@ } }, "node_modules/scheduler": { - "version": "0.23.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", - "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "license": "MIT", - "dependencies": { - "loose-envify": "^1.1.0" - } + "version": "0.25.0-rc-09111202-20241011", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.25.0-rc-09111202-20241011.tgz", + "integrity": "sha512-XIsordE2/I3s52ujwT5PZIxHMQca8L2ca6Gu3o0YHXDVTYucwXQW6m8/2fVKqfzoJRH1ne7/49M7/5Wick8qOA==" }, "node_modules/selderee": { "version": "0.11.0", diff --git a/package.json b/package.json index c81d1cab..62630262 100644 --- a/package.json +++ b/package.json @@ -93,8 +93,8 @@ "morgan": "^1.10.0", "prisma": "^5.17.0", "qrcode": "^1.5.3", - "react": "^18.3.1", - "react-dom": "^18.3.1", + "react": "^19.0.0-rc-09111202-20241011", + "react-dom": "^19.0.0-rc-09111202-20241011", "remix-auth": "^3.7.0", "remix-auth-github": "^1.7.0", "remix-utils": "^7.6.0", @@ -133,8 +133,8 @@ "@types/morgan": "^1.9.9", "@types/node": "^20.14.11", "@types/qrcode": "^1.5.5", - "@types/react": "^18.3.3", - "@types/react-dom": "^18.3.0", + "@types/react": "npm:types-react@rc", + "@types/react-dom": "npm:types-react-dom@rc", "@types/set-cookie-parser": "^2.4.10", "@types/source-map-support": "^0.5.10", "@vitejs/plugin-react": "^4.3.1", @@ -157,6 +157,12 @@ "vite": "^5.3.4", "vitest": "^2.0.3" }, + "overrides": { + "@types/react": "npm:types-react@rc", + "@types/react-dom": "npm:types-react-dom@rc", + "react": "19.0.0-rc-09111202-20241011", + "react-dom": "19.0.0-rc-09111202-20241011" + }, "engines": { "node": "20" }, From 5279e81222def48ba9a2ed7a9175b2c03643db8c Mon Sep 17 00:00:00 2001 From: Jacob Paris Date: Sat, 12 Oct 2024 14:30:14 +0800 Subject: [PATCH 2/5] fix: move meta export to JSX --- .vscode/remix.code-snippets | 11 ----- app/root.tsx | 17 +++---- app/routes/_auth+/forgot-password.tsx | 5 +- app/routes/_auth+/login.tsx | 9 ++-- app/routes/_auth+/onboarding.tsx | 9 ++-- app/routes/_auth+/onboarding_.$provider.tsx | 7 +-- app/routes/_auth+/reset-password.tsx | 5 +- app/routes/_auth+/signup.tsx | 7 +-- app/routes/_marketing+/index.tsx | 5 +- app/routes/users+/$username.tsx | 16 ++----- .../users+/$username_+/notes.$noteId.tsx | 47 ++++++------------- app/routes/users+/$username_+/notes.index.tsx | 29 ++++-------- app/routes/users+/$username_+/notes.tsx | 29 +++++++++++- 13 files changed, 76 insertions(+), 120 deletions(-) diff --git a/.vscode/remix.code-snippets b/.vscode/remix.code-snippets index 4d8ec1d8..f7ca7816 100644 --- a/.vscode/remix.code-snippets +++ b/.vscode/remix.code-snippets @@ -56,17 +56,6 @@ "}", ], }, - "meta": { - "prefix": "/meta", - "scope": "typescriptreact,javascriptreact,typescript,javascript", - "body": [ - "import type { MetaFunction } from '@remix-run/node'", - "", - "export const meta: MetaFunction = ({ data }) => [{", - " title: 'Title',", - "}]", - ], - }, "shouldRevalidate": { "prefix": "/shouldRevalidate", "scope": "typescriptreact,javascriptreact,typescript,javascript", diff --git a/app/root.tsx b/app/root.tsx index f21f1121..b2be50dc 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -70,13 +70,6 @@ export const links: LinksFunction = () => { ].filter(Boolean) } -export const meta: MetaFunction = ({ data }) => { - return [ - { title: data ? 'Epic Notes' : 'Error | Epic Notes' }, - { name: 'description', content: `Your own captain's log` }, - ] -} - export async function loader({ request }: LoaderFunctionArgs) { const timings = makeTimings('root loader') const userId = await time(() => getUserId(request), { @@ -168,6 +161,7 @@ function Document({ + {allowIndexing ? null : ( )} @@ -194,7 +188,7 @@ function App() { const user = useOptionalUser() const theme = useTheme() const matches = useMatches() - const isOnSearchPage = matches.find((m) => m.id === 'routes/users+/index') + const isOnSearchPage = matches.find(m => m.id === 'routes/users+/index') const searchBar = isOnSearchPage ? null : const allowIndexing = data.ENV.ALLOW_INDEXING !== 'false' useToast(data.toast) @@ -206,6 +200,8 @@ function App() { allowIndexing={allowIndexing} env={data.ENV} > + Epic Notes +