patch runed/use-search-params to work with SSR
This commit is contained in:
3
bun.lock
3
bun.lock
@@ -35,6 +35,9 @@
|
||||
},
|
||||
},
|
||||
},
|
||||
"patchedDependencies": {
|
||||
"runed@0.37.1": "patches/runed@0.37.1.patch",
|
||||
},
|
||||
"packages": {
|
||||
"@biomejs/biome": ["@biomejs/biome@2.3.14", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.3.14", "@biomejs/cli-darwin-x64": "2.3.14", "@biomejs/cli-linux-arm64": "2.3.14", "@biomejs/cli-linux-arm64-musl": "2.3.14", "@biomejs/cli-linux-x64": "2.3.14", "@biomejs/cli-linux-x64-musl": "2.3.14", "@biomejs/cli-win32-arm64": "2.3.14", "@biomejs/cli-win32-x64": "2.3.14" }, "bin": { "biome": "bin/biome" } }, "sha512-QMT6QviX0WqXJCaiqVMiBUCr5WRQ1iFSjvOLoTk6auKukJMvnMzWucXpwZB0e8F00/1/BsS9DzcKgWH+CLqVuA=="],
|
||||
|
||||
|
||||
@@ -43,5 +43,8 @@
|
||||
"vite": "^7.3.1",
|
||||
"wrangler": "^4.62.0",
|
||||
"zod": "^4.3.6"
|
||||
},
|
||||
"patchedDependencies": {
|
||||
"runed@0.37.1": "patches/runed@0.37.1.patch"
|
||||
}
|
||||
}
|
||||
|
||||
16
patches/runed@0.37.1.patch
Normal file
16
patches/runed@0.37.1.patch
Normal file
@@ -0,0 +1,16 @@
|
||||
diff --git a/dist/utilities/use-search-params/use-search-params.svelte.js b/dist/utilities/use-search-params/use-search-params.svelte.js
|
||||
index 8ddeb0eacf7ef5884c222536ff76588a4134d0c7..a1824bdc9779d7a5a8f78184b03efff484d316b1 100644
|
||||
--- a/dist/utilities/use-search-params/use-search-params.svelte.js
|
||||
+++ b/dist/utilities/use-search-params/use-search-params.svelte.js
|
||||
@@ -1368,6 +1368,11 @@ export function useSearchParams(schema, options = {}) {
|
||||
const isMounted = new IsMounted();
|
||||
// Track if we've done initial setup (separate from cache initialization)
|
||||
let hasInitialized = false;
|
||||
+ // Initial URL sync to local cache - on both server and client
|
||||
+ if (!building && options.updateURL !== false) {
|
||||
+ const urlParams = page.url.searchParams;
|
||||
+ searchParams.syncFromURL(urlParams);
|
||||
+ }
|
||||
// Only run initialization logic after hydration is complete
|
||||
$effect(() => {
|
||||
if (!isMounted.current || building)
|
||||
Reference in New Issue
Block a user