generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
feat: nuqs@2.0.0 #459
Merged
Merged
feat: nuqs@2.0.0 #459
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Closed
Ignoring tests for the build, but allow type-checking and injecting globals for Vitest.
BREAKING CHANGE: `UseQueryStatesOptions` is now generic over the key map (the object containing parser definitions you pass to useQueryStates), and is now a type rather than an interface.
BREAKING CHANGE: Pass in a validation function like a Zod schema parse function to validate at runtime and infer the type of the returned data.
* doc: Add blog engine from Fumadocs * doc: Add v2 announcement banners * doc: Make blog posts look pretty * doc: Blog post contents * doc: Add og:images * doc: Add blog post og:image * doc: Wording fixes * doc: Add v2 blog link to playground
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Planned to coincide with the release of Next.js 15.
Now that 14.1.2 has been released with most bugs ironed out, this PR is clear on the Next.js dependency side.
Edit: React 19 has joined the chat
Will include the following breaking changes:
parsers
export toserver
subscribeToQueryUpdates
#425next-usequerystate
, migrate tonuqs
- Project rebranding to `nuqs` #438Tasks
parseAsJson
: make it returnunknown
and/or make the validation argument required (see poll)Migration guide
Read it online: https://nuqs.47ng.com/docs/migrations/v2
Support moved to
next@>=14.2.0
Early versions of Next.js 14 were in flux with regards to shallow routing, only from 14.2.0 is it stable enough to not require ugly hacks.
See #423 for context and a table of supported versions.
ESM only
nuqs@2.0.0
is now an ESM-only package. This should not be much of an issue since Next.js supported ESM since version 12, but if you are bundling nuqs code into an intermediate CJS library to be consumed in Next.js, you'll run into import issues. Outside of converting your library to ESM (future-proof), your main option is to dynamically import nuqs:Deprecated exports
Some of the v1 API was marked as deprecated back in September 2023, and has been removed in
nuqs@2.0.0
.queryTypes
parsers objectReplace with
parseAsXYZ
to match, for better tree-shakeability:subscribeToQueryUpdates
Next.js 14.0.5 makes
useSearchParams
reactive to shallow search params updates, which makes this internal helper function redundant. See #425 for context.Renamed
nuqs/parsers
tonuqs/server
When introducing the server cache in #387, the dedicated export for parsers was reused as it didn't include the
"use client"
directive. Since it now contains more than parsers and probably will be extended with server-only code in the future, it has been renamed to a clearer export name.Find and replace all occurrences of
'nuqs/parsers'
to'nuqs/server'
in your code:Debug printout detection
After the rename to
nuqs
, the debugging printout detection logic handled eithernext-usequerystate
ornuqs
being present in thelocalStorage.debug
variable. Innuqs@2.0.0
it only checks for the presence of thenuqs
substring to enable logs. Update your local dev environments to match by running this once in the devtools console: