@solidjs/router
Advanced tools
Comparing version 0.14.2 to 0.14.3
@@ -36,3 +36,3 @@ /** | ||
const [store, setStore] = createStore({ | ||
value | ||
value: structuredClone(value) | ||
}); | ||
@@ -43,3 +43,3 @@ return [ | ||
typeof v === "function" && (v = v()); | ||
setStore("value", reconcile(v, options)); | ||
setStore("value", reconcile(structuredClone(v), options)); | ||
return store.value; | ||
@@ -46,0 +46,0 @@ } |
@@ -266,3 +266,3 @@ import { isServer, getRequestEvent, createComponent as createComponent$1, memo, delegateEvents, spread, mergeProps as mergeProps$1, template } from 'solid-js/web'; | ||
const setSearchParams = (params, options) => { | ||
const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash); | ||
const searchString = untrack(() => mergeSearchString(location.search, params) + location.hash); | ||
navigate(searchString, { | ||
@@ -524,2 +524,3 @@ scroll: false, | ||
} | ||
const queryOnly = !to || to[0] === "?"; | ||
const { | ||
@@ -532,7 +533,8 @@ replace, | ||
replace: false, | ||
resolve: true, | ||
resolve: !queryOnly, | ||
scroll: true, | ||
...options | ||
}; | ||
const resolvedTo = resolve ? route.resolvePath(to) : resolvePath("", to); | ||
let s; | ||
const resolvedTo = resolve ? route.resolvePath(to) : resolvePath(queryOnly && (s = source().value) && s.split("?")[0] || "", to); | ||
if (resolvedTo === undefined) { | ||
@@ -879,5 +881,4 @@ throw new Error(`Path '${to}' is not a routable path`); | ||
let e; | ||
const url = props.url || (e = getRequestEvent()) && getPath(e.request.url) || ""; | ||
const obj = { | ||
value: props.transformUrl ? props.transformUrl(url) : url | ||
value: props.url || (e = getRequestEvent()) && getPath(e.request.url) || "" | ||
}; | ||
@@ -1323,3 +1324,3 @@ return createRouterComponent({ | ||
return { | ||
value: props.transformUrl ? props.transformUrl(url) + window.location.hash : url + window.location.hash, | ||
value: url + window.location.hash, | ||
state: window.history.state | ||
@@ -1566,7 +1567,7 @@ }; | ||
const [store, setStore] = createStore({ | ||
value | ||
value: structuredClone(value) | ||
}); | ||
return [() => store.value, v => { | ||
typeof v === "function" && (v = v()); | ||
setStore("value", reconcile(v, options)); | ||
setStore("value", reconcile(structuredClone(v), options)); | ||
return store.value; | ||
@@ -1573,0 +1574,0 @@ }]; |
@@ -12,3 +12,3 @@ import { isServer } from "solid-js/web"; | ||
return { | ||
value: props.transformUrl ? props.transformUrl(url) + window.location.hash : url + window.location.hash, | ||
value: url + window.location.hash, | ||
state: window.history.state | ||
@@ -15,0 +15,0 @@ }; |
@@ -9,5 +9,4 @@ import { getRequestEvent } from "solid-js/web"; | ||
let e; | ||
const url = props.url || ((e = getRequestEvent()) && getPath(e.request.url)) || ""; | ||
const obj = { | ||
value: props.transformUrl ? props.transformUrl(url) : url, | ||
value: props.url || ((e = getRequestEvent()) && getPath(e.request.url)) || "", | ||
}; | ||
@@ -14,0 +13,0 @@ return createRouterComponent({ |
@@ -44,3 +44,3 @@ import { runWithOwner, batch } from "solid-js"; | ||
const setSearchParams = (params, options) => { | ||
const searchString = untrack(() => location.pathname + mergeSearchString(location.search, params) + location.hash); | ||
const searchString = untrack(() => mergeSearchString(location.search, params) + location.hash); | ||
navigate(searchString, { | ||
@@ -299,9 +299,13 @@ scroll: false, | ||
} | ||
const queryOnly = !to || to[0] === "?"; | ||
const { replace, resolve, scroll, state: nextState } = { | ||
replace: false, | ||
resolve: true, | ||
resolve: !queryOnly, | ||
scroll: true, | ||
...options | ||
}; | ||
const resolvedTo = resolve ? route.resolvePath(to) : resolvePath("", to); | ||
let s; | ||
const resolvedTo = resolve | ||
? route.resolvePath(to) | ||
: resolvePath((queryOnly && (s = source().value) && s.split("?")[0]) || "", to); | ||
if (resolvedTo === undefined) { | ||
@@ -308,0 +312,0 @@ throw new Error(`Path '${to}' is not a routable path`); |
@@ -52,2 +52,3 @@ import type { Component, JSX, Signal } from "solid-js"; | ||
state?: S; | ||
rawPath?: string; | ||
} | ||
@@ -54,0 +55,0 @@ export interface RouterIntegration { |
@@ -9,3 +9,3 @@ { | ||
"license": "MIT", | ||
"version": "0.14.2", | ||
"version": "0.14.3", | ||
"homepage": "https://github.com/solidjs/solid-router#readme", | ||
@@ -12,0 +12,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
172269
3840