File tree 4 files changed +12
-18
lines changed
docs/content/docs/migrations
4 files changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -24,16 +24,15 @@ jobs:
24
24
base-path : [false, '/base']
25
25
window-history-support : [false]
26
26
next-version :
27
- - ' 13.4'
27
+ - ' 13.4' # App router in GA
28
28
- ' 13.5'
29
29
- ' 14.0.1'
30
30
# 14.0.2 is not compatible due to a prefetch issue
31
- # 14.0.3 requires the WHS flag (see below)
31
+ # 14.0.3 is dropped due to a bug requiring WHS + syncing against uSP,
32
+ # which creates other problems under other versions of Next.js
32
33
- ' 14.0.4'
33
34
- latest # Current latest is 14.1.0
34
35
include :
35
- - next-version : ' 14.0.3'
36
- window-history-support : true
37
36
# 14.0.4 doesn't require the WHS flag, but supports it
38
37
- next-version : ' 14.0.4'
39
38
window-history-support : true
Original file line number Diff line number Diff line change @@ -3,6 +3,14 @@ title: Migration guide to v2
3
3
description : How to update your code to use nuqs@2.0.0
4
4
---
5
5
6
+ ## Dropped support for ` next@14.0.3 `
7
+
8
+ It may seem weird to drop support for a single patch version, and keep it for
9
+ older versions, but this is due to a bug in shallow routing in Next.js 14.0.3
10
+ that was fixed in 14.0.4, and that became hard to work around without ugly hacks.
11
+
12
+ See #423 for context and a table of supported versions.
13
+
6
14
## ESM only
7
15
8
16
` nuqs@2.0.0 ` is now an [ ESM-only] ( https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c )
Original file line number Diff line number Diff line change 56
56
"prepack" : " ./scripts/prepack.sh"
57
57
},
58
58
"peerDependencies" : {
59
- "next" : " >=13.4 <14.0.2 || ^14.0.3 " ,
59
+ "next" : " >=13.4 <14.0.2 || ^14.0.4 " ,
60
60
"react" : " ^18.2.0"
61
61
},
62
62
"dependencies" : {
Original file line number Diff line number Diff line change @@ -240,19 +240,6 @@ export function useQueryState<T = string>(
240
240
initialSearchParams ?. get ( key ) ?? null
241
241
)
242
242
243
- React . useEffect ( ( ) => {
244
- // This will be removed in v2 which will drop support for
245
- // partially-functional shallow routing (14.0.2 and 14.0.3)
246
- if ( window . next ?. version !== '14.0.3' ) {
247
- return
248
- }
249
- const value = initialSearchParams . get ( key ) ?? null
250
- const state = value === null ? null : safeParse ( parse , value , key )
251
- debug ( '[nuqs `%s`] syncFromUseSearchParams %O' , key , state )
252
- stateRef . current = state
253
- setInternalState ( state )
254
- } , [ initialSearchParams ?. get ( key ) , key ] )
255
-
256
243
// Sync all hooks together & with external URL changes
257
244
React . useInsertionEffect ( ( ) => {
258
245
function updateInternalState ( state : T | null ) {
You can’t perform that action at this time.
0 commit comments