Skip to content

Commit 3ef65f9

Browse files
committed
fix: bump minimum svelte version to use renamed reactive search params class
1 parent 6c75647 commit 3ef65f9

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ yarn add svelte-query-params svelte@next
2222
bun install svelte-query-params svelte@next
2323
```
2424

25+
`svelte` requires a version of `5.0.0-next.169` or newer as it [renamed a public API](https://github.com/sveltejs/svelte/releases/tag/svelte%405.0.0-next.169) that this library uses.
26+
2527
By default, `svelte-query-params` uses [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) to handle interpreting the location string, which means it does not decode `null` and has limited handling of other more advanced URL parameter configurations. If you want access to those features, add a third-party library like query-string and tell [svelte-query-params to use it](#options).
2628

2729
## Features
@@ -164,10 +166,10 @@ With Zod, you need to handle the case where there's either 0 or 1 query param va
164166
import { z } from "zod";
165167

166168
z.object({
167-
categories: z
168-
.union([z.string().array(), z.string()])
169-
.default([])
170-
.transform((c) => (Array.isArray(c) ? c : [c])),
169+
categories: z
170+
.union([z.string().array(), z.string()])
171+
.default([])
172+
.transform((c) => (Array.isArray(c) ? c : [c])),
171173
})
172174
```
173175

@@ -179,10 +181,10 @@ In the same manner, with Valibot:
179181
import * as v from "valibot";
180182

181183
v.object({
182-
categories: v.pipe(
183-
v.optional(v.union([v.array(v.string()), v.string()]), []),
184-
v.transform((c) => (Array.isArray(c) ? c : [c]))
185-
),
184+
categories: v.pipe(
185+
v.optional(v.union([v.array(v.string()), v.string()]), []),
186+
v.transform((c) => (Array.isArray(c) ? c : [c]))
187+
),
186188
});
187189
```
188190

bun.lockb

-1.04 KB
Binary file not shown.

packages/core/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ yarn add svelte-query-params svelte@next
2222
bun install svelte-query-params svelte@next
2323
```
2424

25+
`svelte` requires a version of `5.0.0-next.169` or newer as it [renamed a public API](https://github.com/sveltejs/svelte/releases/tag/svelte%405.0.0-next.169) that this library uses.
26+
2527
By default, `svelte-query-params` uses [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) to handle interpreting the location string, which means it does not decode `null` and has limited handling of other more advanced URL parameter configurations. If you want access to those features, add a third-party library like query-string and tell [svelte-query-params to use it](#options).
2628

2729
## Features

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
},
109109
"peerDependencies": {
110110
"@sveltejs/kit": "^2.0.0",
111-
"svelte": "^5.0.0-next.1",
111+
"svelte": "^5.0.0-next.169",
112112
"valibot": "^0.31.0",
113113
"zod": "^3.22.2"
114114
},

packages/core/src/lib/search-params.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import { URLSearchParams as reactive_URLSearchParams } from "svelte/reactivity";
1+
import { SvelteURLSearchParams } from "svelte/reactivity";
22
import type { Query } from "./types";
33

4-
// TODO: export from svelte/reactivity was renamed in this release:
5-
// https://github.com/sveltejs/svelte/releases/tag/svelte%405.0.0-next.169
6-
// Will need to bump minimum svelte version when changing this (should probably wait for rc)
7-
export class ReactiveSearchParams extends reactive_URLSearchParams {
4+
export class ReactiveSearchParams extends SvelteURLSearchParams {
85
get raw() {
96
const raw: Query = {};
107

0 commit comments

Comments
 (0)