From ae8a8143643e99f4b4d00795a853fc8d6b61e618 Mon Sep 17 00:00:00 2001 From: Yoann Fleury Date: Fri, 25 Oct 2024 15:20:17 +0200 Subject: [PATCH 1/3] feat: update nuqs --- package.json | 2 +- pnpm-lock.yaml | 25 +++++++++++++++++++------ src/app/Document.tsx | 14 +++++++++----- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index c84bce878..6f588e737 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "i18next-browser-languagedetector": "8.0.0", "next": "14.2.4", "nodemailer": "6.9.14", - "nuqs": "1.17.4", + "nuqs": "2.0.4", "oslo": "1.2.1", "pino": "9.2.0", "pino-pretty": "11.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 14c4f1ce5..b120f229d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,8 +111,8 @@ importers: specifier: 6.9.14 version: 6.9.14 nuqs: - specifier: 1.17.4 - version: 1.17.4(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + specifier: 2.0.4 + version: 2.0.4(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router-dom@5.3.4(react@18.3.1))(react@18.3.1) oslo: specifier: 1.2.1 version: 1.2.1 @@ -7708,10 +7708,20 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - nuqs@1.17.4: - resolution: {integrity: sha512-wraphFfKI+Y/aWIGFsld/Ta7fTFEyeya1LkgEGNPDiMuY+Hwea/eVHBiq1GYlyMqTYSAoxRWvQyjCIo1Dy1u7g==} + nuqs@2.0.4: + resolution: {integrity: sha512-d0GQCOHW9o04slcTe9nfTgskCT/09K5pOMXu671Y8p7d/48KEKJLzZjklWXIt3pFjYaplErMZpXiLiYo0w8uQQ==} peerDependencies: - next: '>=13.4 <14.0.2 || ^14.0.3' + '@remix-run/react': '>= 2' + next: '>= 14.2.0' + react: '>= 18.2.0' + react-router-dom: '>= 6' + peerDependenciesMeta: + '@remix-run/react': + optional: true + next: + optional: true + react-router-dom: + optional: true nwsapi@2.2.10: resolution: {integrity: sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ==} @@ -19372,10 +19382,13 @@ snapshots: dependencies: boolbase: 1.0.0 - nuqs@1.17.4(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): + nuqs@2.0.4(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router-dom@5.3.4(react@18.3.1))(react@18.3.1): dependencies: mitt: 3.0.1 + react: 18.3.1 + optionalDependencies: next: 14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-router-dom: 5.3.4(react@18.3.1) nwsapi@2.2.10: {} diff --git a/src/app/Document.tsx b/src/app/Document.tsx index f098151b0..d7f33d4f6 100644 --- a/src/app/Document.tsx +++ b/src/app/Document.tsx @@ -4,6 +4,7 @@ import { ReactNode } from 'react'; import { ColorModeScript } from '@chakra-ui/react'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; +import { NuqsAdapter } from 'nuqs/adapters/next/app'; import { Providers } from '@/app/Providers'; import { Viewport } from '@/components/Viewport'; @@ -63,11 +64,14 @@ export const Document = ({ children }: { children: ReactNode }) => { storageKey={COLOR_MODE_STORAGE_KEY} /> - - {children} - - - + {/* Putting nuqs adapter here and not in providers as the testing requires another adapter */} + + + {children} + + + + From 808f4048b0d4424137ab7ff79d7f006c3d9b9933 Mon Sep 17 00:00:00 2001 From: Yoann Fleury Date: Tue, 29 Oct 2024 22:15:09 +0100 Subject: [PATCH 2/3] feat: some changes after lib author awesome review --- src/app/Document.tsx | 1 - src/features/account/AccountDeleteVerificationCodeModal.tsx | 6 +----- src/features/account/EmailVerificationCodeModal.tsx | 6 +----- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/app/Document.tsx b/src/app/Document.tsx index d7f33d4f6..452095079 100644 --- a/src/app/Document.tsx +++ b/src/app/Document.tsx @@ -64,7 +64,6 @@ export const Document = ({ children }: { children: ReactNode }) => { storageKey={COLOR_MODE_STORAGE_KEY} /> - {/* Putting nuqs adapter here and not in providers as the testing requires another adapter */} {children} diff --git a/src/features/account/AccountDeleteVerificationCodeModal.tsx b/src/features/account/AccountDeleteVerificationCodeModal.tsx index 9c8caa46d..3da08511f 100644 --- a/src/features/account/AccountDeleteVerificationCodeModal.tsx +++ b/src/features/account/AccountDeleteVerificationCodeModal.tsx @@ -42,11 +42,7 @@ export const AccountDeleteVerificationCodeModale = () => { ); const onClose = () => { - setSearchParams({ - [SEARCH_PARAM_VERIFY_EMAIL]: null, - token: null, - attempts: null, - }); + setSearchParams(null); }; const form = useForm({ diff --git a/src/features/account/EmailVerificationCodeModal.tsx b/src/features/account/EmailVerificationCodeModal.tsx index 598d9a135..06a83f401 100644 --- a/src/features/account/EmailVerificationCodeModal.tsx +++ b/src/features/account/EmailVerificationCodeModal.tsx @@ -35,11 +35,7 @@ export const EmailVerificationCodeModale = () => { const onClose = () => { trpcUtils.account.get.reset(); - setSearchParams({ - verifyEmail: null, - token: null, - attempts: null, - }); + setSearchParams(null); }; const form = useForm({ From 7d999eeb3c910aef789344386790b4dffc36ff0c Mon Sep 17 00:00:00 2001 From: Yoann Fleury Date: Thu, 31 Oct 2024 14:07:06 +0100 Subject: [PATCH 3/3] feat: latest version --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 6f588e737..94874991c 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "i18next-browser-languagedetector": "8.0.0", "next": "14.2.4", "nodemailer": "6.9.14", - "nuqs": "2.0.4", + "nuqs": "2.1.1", "oslo": "1.2.1", "pino": "9.2.0", "pino-pretty": "11.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b120f229d..af59f32d0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,8 +111,8 @@ importers: specifier: 6.9.14 version: 6.9.14 nuqs: - specifier: 2.0.4 - version: 2.0.4(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router-dom@5.3.4(react@18.3.1))(react@18.3.1) + specifier: 2.1.1 + version: 2.1.1(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router-dom@5.3.4(react@18.3.1))(react@18.3.1) oslo: specifier: 1.2.1 version: 1.2.1 @@ -7708,8 +7708,8 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - nuqs@2.0.4: - resolution: {integrity: sha512-d0GQCOHW9o04slcTe9nfTgskCT/09K5pOMXu671Y8p7d/48KEKJLzZjklWXIt3pFjYaplErMZpXiLiYo0w8uQQ==} + nuqs@2.1.1: + resolution: {integrity: sha512-iM2H8lMmhvk9bxupUs2oRle9usRNEAqppOkTMXOxD/uK85gOKAubU7T2zmPo8fnYQS4n5e/XswTiq+gLYGpy3w==} peerDependencies: '@remix-run/react': '>= 2' next: '>= 14.2.0' @@ -19382,7 +19382,7 @@ snapshots: dependencies: boolbase: 1.0.0 - nuqs@2.0.4(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router-dom@5.3.4(react@18.3.1))(react@18.3.1): + nuqs@2.1.1(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router-dom@5.3.4(react@18.3.1))(react@18.3.1): dependencies: mitt: 3.0.1 react: 18.3.1