Skip to content

Commit 0dca424

Browse files
committed
doc: Wording & links
1 parent 335a675 commit 0dca424

File tree

1 file changed

+23
-14
lines changed
  • packages/docs/content/docs/migrations

1 file changed

+23
-14
lines changed

packages/docs/content/docs/migrations/v2.mdx

+23-14
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ Here's a summary of the breaking changes in `nuqs@2.0.0`:
1111
- [Deprecated exports have been removed](#deprecated-exports)
1212
- [Renamed `nuqs/parsers` to `nuqs/server`](#renamed-nuqsparsers-to-nuqsserver)
1313
- [Debug printout detection](#debug-printout-detection)
14+
- [Dropping `next-usequerystate`](#dropping-next-usequerystate)
1415

1516
## Adapters
1617

1718
The biggest change is that `nuqs@2.0.0` now supports other React frameworks,
1819
providing type-safe URL state for all.
1920

20-
You will need to wrap your app with the appropriate **adapter** for your framework,
21-
to let the hooks know how to interact with its router.
21+
You will need to wrap your app with the appropriate [adapter](/docs/adapters)
22+
for your framework or router, to let the hooks know how to interact with it.
2223

2324
Adapters are currently available for:
2425
- Next.js (app & pages routers)
@@ -32,7 +33,7 @@ wrap your app with the appropriate `NuqsAdapter`:
3233

3334
### Next.js
3435

35-
<Callout title="Minimum required version: next@>=14.2.0">
36+
<Callout title="Minimum required version: next@>=14.2.0" type="warn">
3637

3738
Early versions of Next.js 14 were in flux with regards to shallow routing.
3839
Supporting those earlier versions required a lot of hacks, workarounds, and
@@ -89,7 +90,7 @@ import { NuqsAdapter } from 'nuqs/adapters/next'
8990
### Other adapters
9091

9192
Albeit not part of a migration from v1, you can now use nuqs in other React
92-
frameworks via their respective [adapters](https://nuqs.47ng.com/docs/adapters).
93+
frameworks via their respective [adapters](/docs/adapters).
9394

9495
{/* todo: Add the docs/adapters page */}
9596

@@ -98,15 +99,15 @@ a long-standing issue with testing components using nuqs hooks:
9899

99100
### Testing adapter
100101

101-
Until now, unit-testing nuqs components was a hassle, as it required mocking
102-
Next.js internals, causing abstraction leaks.
102+
Unit-testing components that used nuqs v1 was a hassle, as it required mocking
103+
the Next.js router internals, causing abstraction leaks.
103104

104-
You can now wrap your components to test with the `NuqsTestingAdapter`, which
105-
provides setup & assertion helpers for your tests.
105+
In v2, you can now wrap your components to test with the [`NuqsTestingAdapter`](/docs/testing),
106+
which provides a convenient setup & assertion API for your tests.
106107

107108
Here's an example with Vitest & Testing Library:
108109

109-
```tsx
110+
```tsx title="counter-button-example.test.tsx"
110111
import { render, screen } from '@testing-library/react'
111112
import userEvent from '@testing-library/user-event'
112113
import { NuqsTestingAdapter, type UrlUpdateEvent } from 'nuqs/adapters/testing'
@@ -138,10 +139,10 @@ it('should increment the count when clicked', async () => {
138139

139140
## Behaviour changes
140141

141-
Setting `startTransition` no longer sets `shallow: false` automatically.
142+
Setting the `startTransition` option no longer sets `shallow: false` automatically.
143+
142144
In Next.js, you'll have to specify both to get a loading state.
143-
This is to align with other frameworks that don't have a concept of shallow
144-
(or deep) routing.
145+
This is to align with other frameworks that don't have a concept of shallow/deep routing.
145146

146147
As a consequence, the `Options` type is no longer generic.
147148

@@ -199,11 +200,11 @@ Replace with `parseAsXYZ` to match:
199200
### `subscribeToQueryUpdates`
200201

201202
Next.js 14.1.0 makes `useSearchParams` reactive to shallow search params updates,
202-
which makes this internal helper function redundant. See #425 for context.
203+
which makes this internal helper function redundant. See [#425](https://github.com/47ng/nuqs/pull/425) for context.
203204

204205
## Renamed `nuqs/parsers` to `nuqs/server`
205206

206-
When introducing the server cache in #387, the dedicated export for parsers was
207+
When introducing the server cache in [#397](https://github.com/47ng/nuqs/pull/397), the dedicated export for parsers was
207208
reused as it didn't include the `"use client"` directive. Since it now contains
208209
more than parsers and probably will be extended with server-only code in the future,
209210
it has been renamed to a clearer export name.
@@ -228,3 +229,11 @@ if (localStorage.debug) {
228229
localStorage.debug = localStorage.debug.replace('next-usequerystate', 'nuqs')
229230
}
230231
```
232+
233+
## Dropping next-usequerystate
234+
235+
This package started under the name `next-usequerystate`, and was renamed to
236+
`nuqs` in January 2024. The old package name was kept as an alias for the v1
237+
release line.
238+
239+
`nuqs` version 2 and onwards no longer mirror to the `next-usequerystate` package name.

0 commit comments

Comments
 (0)