From 6c2c3fc6e6a8de1647cda5cd60c5f7904d351f75 Mon Sep 17 00:00:00 2001 From: Pedro Carreno <34664891+Pkcarreno@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:50:11 -0400 Subject: [PATCH] feat: use react document metadata instead of react-helmet-async --- package.json | 1 - pnpm-lock.yaml | 40 ------------------- src/app.tsx | 16 +++----- .../editor/providers/meta-provider.tsx | 6 +-- src/features/not-found/index.tsx | 5 +-- 5 files changed, 8 insertions(+), 60 deletions(-) diff --git a/package.json b/package.json index f9946b6..73ed531 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,6 @@ "quickjs-emscripten-sync": "^1.5.2", "react": "^19.0.0", "react-dom": "^19.0.0", - "react-helmet-async": "^2.0.5", "react-hook-form": "^7.54.1", "react-hotkeys-hook": "^4.6.1", "react-resizable-panels": "^2.1.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bcbe3cb..aa36e79 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,9 +128,6 @@ importers: react-dom: specifier: ^19.0.0 version: 19.0.0(react@19.0.0) - react-helmet-async: - specifier: ^2.0.5 - version: 2.0.5(react@19.0.0) react-hook-form: specifier: ^7.54.1 version: 7.54.1(react@19.0.0) @@ -3175,9 +3172,6 @@ packages: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} - invariant@2.2.4: - resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} - is-arguments@1.2.0: resolution: {integrity: sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==} engines: {node: '>= 0.4'} @@ -3499,10 +3493,6 @@ packages: resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} engines: {node: '>=18'} - loose-envify@1.4.0: - resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} - hasBin: true - loupe@3.1.2: resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} @@ -3860,14 +3850,6 @@ packages: peerDependencies: react: ^19.0.0 - react-fast-compare@3.2.2: - resolution: {integrity: sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==} - - react-helmet-async@2.0.5: - resolution: {integrity: sha512-rYUYHeus+i27MvFE+Jaa4WsyBKGkL6qVgbJvSBoX8mbsWoABJXdEO0bZyi0F6i+4f0NuIb8AvqPMj3iXFHkMwg==} - peerDependencies: - react: ^16.6.0 || ^17.0.0 || ^18.0.0 - react-hook-form@7.54.1: resolution: {integrity: sha512-PUNzFwQeQ5oHiiTUO7GO/EJXGEtuun2Y1A59rLnZBBj+vNEOWt/3ERTiG1/zt7dVeJEM+4vDX/7XQ/qanuvPMg==} engines: {node: '>=18.0.0'} @@ -4080,9 +4062,6 @@ packages: resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} engines: {node: '>= 0.4'} - shallowequal@1.1.0: - resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -8147,10 +8126,6 @@ snapshots: hasown: 2.0.2 side-channel: 1.1.0 - invariant@2.2.4: - dependencies: - loose-envify: 1.4.0 - is-arguments@1.2.0: dependencies: call-bound: 1.0.3 @@ -8453,10 +8428,6 @@ snapshots: strip-ansi: 7.1.0 wrap-ansi: 9.0.0 - loose-envify@1.4.0: - dependencies: - js-tokens: 4.0.0 - loupe@3.1.2: {} lru-cache@10.4.3: {} @@ -8758,15 +8729,6 @@ snapshots: react: 19.0.0 scheduler: 0.25.0 - react-fast-compare@3.2.2: {} - - react-helmet-async@2.0.5(react@19.0.0): - dependencies: - invariant: 2.2.4 - react: 19.0.0 - react-fast-compare: 3.2.2 - shallowequal: 1.1.0 - react-hook-form@7.54.1(react@19.0.0): dependencies: react: 19.0.0 @@ -8998,8 +8960,6 @@ snapshots: functions-have-names: 1.2.3 has-property-descriptors: 1.0.2 - shallowequal@1.1.0: {} - shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 diff --git a/src/app.tsx b/src/app.tsx index e038dc9..67ae4a4 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,5 +1,3 @@ -import { HelmetProvider } from 'react-helmet-async'; - import { Toaster } from '@/components/ui/sonner'; import { ThemeProvider } from '@/providers/theme-provider'; import Router from '@/routes'; @@ -7,14 +5,12 @@ import Router from '@/routes'; import { PromptProvider } from './providers/prompt-provider'; const App = () => ( - - - - - - - - + + + + + + ); export default App; diff --git a/src/features/editor/providers/meta-provider.tsx b/src/features/editor/providers/meta-provider.tsx index 8c5d6af..eccc61d 100644 --- a/src/features/editor/providers/meta-provider.tsx +++ b/src/features/editor/providers/meta-provider.tsx @@ -1,5 +1,3 @@ -import { Helmet } from 'react-helmet-async'; - import { useCodeStore } from '../stores/editor'; interface Props { @@ -11,9 +9,7 @@ export const MetatagsProvider: React.FC = ({ children }) => { return ( <> - - JSoD - {title ? title : 'Script'} - + {`JSoD - ${title ? title : 'Script'}`} {children} ); diff --git a/src/features/not-found/index.tsx b/src/features/not-found/index.tsx index f807181..f88ca4c 100644 --- a/src/features/not-found/index.tsx +++ b/src/features/not-found/index.tsx @@ -1,4 +1,3 @@ -import { Helmet } from 'react-helmet-async'; import { Link } from 'wouter'; import { Button } from '@/components/ui/button'; @@ -6,9 +5,7 @@ import { Button } from '@/components/ui/button'; export default function NotFound() { return ( <> - - JSoD - Not Found - + JSoD - Not Found

Are you searching for a JS editor?