Like useState, but stored in the URL query string.
Made by @francoisbest.com & contributors
🔗 https://nuqs.dev
- bug fix when passing null to clear a key configured with parseAsArrayOf(...).withDefault([])
- parseAsBoolean is now case-insensitive
→ /?bool=TRUE does what you expect
Try it out: pnpm add nuqs@latest
- bug fix when passing null to clear a key configured with parseAsArrayOf(...).withDefault([])
- parseAsBoolean is now case-insensitive
→ /?bool=TRUE does what you expect
Try it out: pnpm add nuqs@latest
It includes a bug fix for debounce with `shallow: false` which sent unnecessary stale URL updates to the server.
Try it out: pnpm add nuqs@latest
It includes a bug fix for debounce with `shallow: false` which sent unnecessary stale URL updates to the server.
Try it out: pnpm add nuqs@latest
Two rapid-fire PRs by @tkdodo.eu 🔥
- Fixed a bug with MultiParsers & history: push
- Prevent a re-render when doing setState(x => x) (same reference) in useQueryStates
Try it out: pnpm add nuqs@latest
Two rapid-fire PRs by @tkdodo.eu 🔥
- Fixed a bug with MultiParsers & history: push
- Prevent a re-render when doing setState(x => x) (same reference) in useQueryStates
Try it out: pnpm add nuqs@latest
- MultiParsers: `parseAsNativeArrayOf`, and turn key repetition into Record, Map, Set, anything, with custom parsers. Thanks @tkdodo.eu ! 🙌
- Fixed a bug with flickering optimistic state on update
Try it out: pnpm add nuqs@latest
- MultiParsers: `parseAsNativeArrayOf`, and turn key repetition into Record, Map, Set, anything, with custom parsers. Thanks @tkdodo.eu ! 🙌
- Fixed a bug with flickering optimistic state on update
Try it out: pnpm add nuqs@latest
✨ MultiParsers allow transforming repeated keys in the URL into more complex data types. This had been a long-requested one, thanks @tkdodo.eu! 🫶
🧪 The testing adapter gets an optional memory to behave more closely to real frameworks.
Try it out: pnpm add nuqs@beta
✨ MultiParsers allow transforming repeated keys in the URL into more complex data types. This had been a long-requested one, thanks @tkdodo.eu! 🫶
🧪 The testing adapter gets an optional memory to behave more closely to real frameworks.
Try it out: pnpm add nuqs@beta
2 years ago, I restarted work on the useQueryState hook to support the @nextjs.org app router.
Since then, the project exploded:
⭐ +8k stars
📦 +30M downloads
👥 +50 contributors
🩷 +23 sponsors
Thank you, everyone! 🫶
2 years ago, I restarted work on the useQueryState hook to support the @nextjs.org app router.
Since then, the project exploded:
⭐ +8k stars
📦 +30M downloads
👥 +50 contributors
🩷 +23 sponsors
Thank you, everyone! 🫶
- ✨ `processUrlSearchParams` middleware: sort the querystring alphabetically (for SEO & cache) or process it before updating the URL.
- 💎 Zod codecs community parser
- ⚠️ Log a warning when using debounce with shallow: true with a link to docs
Try it out: pnpm add nuqs@latest
- ✨ `processUrlSearchParams` middleware: sort the querystring alphabetically (for SEO & cache) or process it before updating the URL.
- 💎 Zod codecs community parser
- ⚠️ Log a warning when using debounce with shallow: true with a link to docs
Try it out: pnpm add nuqs@latest
It fixes a referential stability issue with the testing adapter. The state updater function is now stable across renders & state updates in test environments (@vitest.dev, Jest etc)
Try it out: pnpm add nuqs@latest
It fixes a referential stability issue with the testing adapter. The state updater function is now stable across renders & state updates in test environments (@vitest.dev, Jest etc)
Try it out: pnpm add nuqs@latest
🐞 It fixes a bug with @cloudflare.social Workers ("Disallowed operation called within global scope"), by lazily creating the throttle queue's AbortController.
TL;DR: you can ship on CFW again now. 🚀
Try it out: pnpm add nuqs@latest
🐞 It fixes a bug with @cloudflare.social Workers ("Disallowed operation called within global scope"), by lazily creating the throttle queue's AbortController.
TL;DR: you can ship on CFW again now. 🚀
Try it out: pnpm add nuqs@latest
TL;DR:
- Use debounce with `shallow: false` when doing server-side data fetching (RSCs, gSSP, loaders)
- For client-side fetching (React Query, SWR, tRPC), debounce the returned state instead.
TL;DR:
- Use debounce with `shallow: false` when doing server-side data fetching (RSCs, gSSP, loaders)
- For client-side fetching (React Query, SWR, tRPC), debounce the returned state instead.
Likely the last beta before shipping 2.5 🤘
- Adds more options to be specified as global defaults on the adapter
- Bundle reduction & deps: nuqs has now zero dependencies!
Follow @tkdodo.eu's advice and try it out:
> pnpm add nuqs@beta
Likely the last beta before shipping 2.5 🤘
- Adds more options to be specified as global defaults on the adapter
- Bundle reduction & deps: nuqs has now zero dependencies!
Follow @tkdodo.eu's advice and try it out:
> pnpm add nuqs@beta
It adds a couple of features:
- Change global defaults for options at the adapter level (thanks @tkdodo.eu! 🔥)
- Export package.json for @vite.dev module federation
Try it out: pnpm add nuqs@beta
It adds a couple of features:
- Change global defaults for options at the adapter level (thanks @tkdodo.eu! 🔥)
- Export package.json for @vite.dev module federation
Try it out: pnpm add nuqs@beta
It adds a couple of bug fixes:
- Type-safety of default values when using the object signature of useQueryState (thanks @tkdodo.eu 🙌)
- Better compat with older CJS codebases via require(esm)
Try it out: pnpm add nuqs@beta
It adds a couple of bug fixes:
- Type-safety of default values when using the object signature of useQueryState (thanks @tkdodo.eu 🙌)
- Better compat with older CJS codebases via require(esm)
Try it out: pnpm add nuqs@beta
It adds experimental support for @tanstack.com Router 🏝️🙌
- Use community-based nuqs components in TSR
- Connect nuqs parser definitions to TSR's validateSearch for type-safe linking*
Try it out: pnpm add nuqs@beta
It adds experimental support for @tanstack.com Router 🏝️🙌
- Use community-based nuqs components in TSR
- Connect nuqs parser definitions to TSR's validateSearch for type-safe linking*
Try it out: pnpm add nuqs@beta
It adds a couple of features:
- Standard Schema generation: validate & infer types with other tools (tRPC, TanStack Router), using your existing search params definitions
- Strict mode for loaders & cache (see quoted post)
Try it out: pnpm add nuqs@beta
It adds a couple of features:
- Standard Schema generation: validate & infer types with other tools (tRPC, TanStack Router), using your existing search params definitions
- Strict mode for loaders & cache (see quoted post)
Try it out: pnpm add nuqs@beta
The first beta in the 2.5 release line just dropped, with Debounce support: perfect for search inputs, sliders, and server-side updates where you only care about a final value.
Also lots of internal changes, like fixing tearing issues.
Try it out: pnpm add nuqs@beta
The first beta in the 2.5 release line just dropped, with Debounce support: perfect for search inputs, sliders, and server-side updates where you only care about a final value.
Also lots of internal changes, like fixing tearing issues.
Try it out: pnpm add nuqs@beta
More than the platform credits, the greatest value here will be access to the community, making sure we ship quality updates that benefit all.
More than the platform credits, the greatest value here will be access to the community, making sure we ship quality updates that benefit all.
🟣 Celebratory stream on Twitch today at 3pm CEST
We'll also play with Debounce, getting it ready for beta next week.
Come say hi! 👋
www.twitch.tv/fortysevenfx
🟣 Celebratory stream on Twitch today at 3pm CEST
We'll also play with Debounce, getting it ready for beta next week.
Come say hi! 👋
www.twitch.tv/fortysevenfx
nuqs now exposes three functions to help test parsers bijectivity, making sure `parse` and `serialize` complement each other, losslessly.
nuqs now exposes three functions to help test parsers bijectivity, making sure `parse` and `serialize` complement each other, losslessly.
Your UI should be consistent, and the URL is part of that. That "Page 2" button should give you `/?page=2`.
But unlike humans, JS arrays (and @tanstack.com table) like counting from zero.
Enter parseAsIndex, doing the translation for you.
Your UI should be consistent, and the URL is part of that. That "Page 2" button should give you `/?page=2`.
But unlike humans, JS arrays (and @tanstack.com table) like counting from zero.
Enter parseAsIndex, doing the translation for you.