Skip to content

Commit 39dd6be

Browse files
committed
chore: Only support next@14.2.0 and above
1 parent dc97d2c commit 39dd6be

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

.github/workflows/ci-cd.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ jobs:
2323
# branch protection settings for `next`.
2424
base-path: [false, '/base']
2525
next-version:
26-
- '13.4' # App router in GA
27-
- '13.5'
28-
- '14.0.1'
29-
# 14.0.2 to 14.1.1 included are skipped as shallow routing
30-
# implementation was experimental and unstable after GA release.
31-
# 14.0.2 is not compatible due to a prefetch issue
32-
# 14.0.3 is dropped due to a bug requiring WHS + syncing against uSP,
33-
# which creates other problems under other versions of Next.js
3426
- '14.1.2'
27+
# - '14.1.3'
28+
# - '14.1.4'
29+
# - '14.2.0'
30+
# - '14.2.1'
31+
# - '14.2.2'
32+
# - '14.2.3'
33+
# - '14.2.4'
34+
- '14.2.5'
3535
- latest
3636

3737
steps:

packages/nuqs/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"prepack": "./scripts/prepack.sh"
5757
},
5858
"peerDependencies": {
59-
"next": ">=13.4 <14.0.2 || >=14.1.2",
60-
"react": "^18.2.0"
59+
"next": ">= 14.1.2",
60+
"react": ">= 18.2.0"
6161
},
6262
"dependencies": {
6363
"mitt": "^3.0.1"

packages/nuqs/src/update-queue.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,11 @@ function flushUpdateQueue(router: Router): [URLSearchParams, null | unknown] {
186186
// this allows keeping a reactive URL if the network is slow.
187187
const updateMethod =
188188
options.history === 'push' ? history.pushState : history.replaceState
189-
// In 14.1.0, useSearchParams becomes reactive to shallow updates,
190-
// but only if passing `null` as the history state.
191-
// Older versions need to maintain the history state for push to work.
192-
// This should theoretically be checking for >=14.0.5-canary.54 where WHS
193-
// was stabilised, but we're not supporting canaries from previous GAs.
194-
const state =
195-
(window.next?.version ?? '') >= '14.1.0' ? null : history.state
196189
updateMethod.call(
197190
history,
198-
state,
191+
// In next@14.1.0, useSearchParams becomes reactive to shallow updates,
192+
// but only if passing `null` as the history state.
193+
null,
199194
// Our own updates have a marker to prevent syncing
200195
// when the URL changes (we've already sync'd them up
201196
// via `emitter.emit(key, newValue)` above, without

0 commit comments

Comments
 (0)