Skip to content

Commit 06bc978

Browse files
committedJan 16, 2024
doc: Formatting
1 parent 9b8b704 commit 06bc978

File tree

1 file changed

+18
-6
lines changed
  • packages/docs/content/docs/migrations

1 file changed

+18
-6
lines changed
 

Diff for: ‎packages/docs/content/docs/migrations/v2.mdx

+18-6
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ const { useQueryState } = await import('nuqs')
2424

2525
## Deprecated exports
2626

27-
Some of the v1 API was marked as deprecated back in September 2023, and has been removed in `nuqs@2.0.0`.
27+
Some of the v1 API was marked as deprecated back in September 2023, and has been
28+
removed in `nuqs@2.0.0`.
2829

2930
### `queryTypes` parsers object
3031

31-
Replace with `parseAsXYZ` to match, for better tree-shakeability:
32+
The `queryTypes` object has been removed in favor of individual parser exports,
33+
for better tree-shaking.
34+
35+
Replace with `parseAsXYZ` to match:
3236

3337
```diff
3438
- import { queryTypes } from 'nuqs'
@@ -42,13 +46,17 @@ Replace with `parseAsXYZ` to match, for better tree-shakeability:
4246

4347
### `subscribeToQueryUpdates`
4448

45-
Next.js 14.0.5 makes `useSearchParams` reactive to shallow search params updates, which makes this internal helper function redundant. See #425 for context.
49+
Next.js 14.0.5 makes `useSearchParams` reactive to shallow search params updates,
50+
which makes this internal helper function redundant. See #425 for context.
4651

4752
## Renamed `nuqs/parsers` to `nuqs/server`
4853

49-
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.
54+
When introducing the server cache in #387, the dedicated export for parsers was
55+
reused as it didn't include the `"use client"` directive. Since it now contains
56+
more than parsers and probably will be extended with server-only code in the future,
57+
it has been renamed to a clearer export name.
5058

51-
Find and replace all occurrences of `'nuqs/parsers'` to `'nuqs/server'` in your code:
59+
Find and replace all occurrences of `nuqs/parsers` to `nuqs/server` in your code:
5260

5361
```diff
5462
- import { parseAsInteger, createSearchParamsCache } from 'nuqs/parsers'
@@ -57,7 +65,11 @@ Find and replace all occurrences of `'nuqs/parsers'` to `'nuqs/server'` in your
5765

5866
## Debug printout detection
5967

60-
After the rename to `nuqs`, the debugging printout detection logic handled either `next-usequerystate` or `nuqs` being present in the `localStorage.debug` variable. In `nuqs@2.0.0` it only checks for the presence of the `nuqs` substring to enable logs. Update your local dev environments to match by running this once in the devtools console:
68+
After the rename to `nuqs`, the debugging printout detection logic handled either
69+
`next-usequerystate` or `nuqs` being present in the `localStorage.debug` variable.
70+
`nuqs@2.0.0` only checks for the presence of the `nuqs` substring to enable logs.
71+
72+
Update your local dev environments to match by running this once in the devtools console:
6173

6274
```ts
6375
if (localStorage.debug) {

0 commit comments

Comments
 (0)