You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently there was a change that updated the $page store which moved the $page.path attribute to $page.url.pathname.
When running an app with paths.base set in svelte.config.js, this changed the properties of the path. Before, $page.path was relative to base set in the config. Now $page.url.pathname is always the full path.
If there was enough demand, it may make sense to make the relative path available through the framework.
Having more than one path may cause confusion to developers new to kit, and if this isn't a common use case it may not make sense.
Describe the proposed solution
Additional attribute path or relpath on the $page store
Alternatives considered
Its not a big deal to write $page.url.pathname.substring(base.length)
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Generally our stance on this sort of thing is that it's better to have a leaner API in the framework itself at the cost of slightly more verbose code, rather than having the same concept represented in multiple ways, since every new feature adds maintenance and documentation overhead.
In this case, $page.url.pathname.substring(base.length) works, but if that gets old you could also do something like this:
Describe the problem
Recently there was a change that updated the
$page
store which moved the$page.path
attribute to$page.url.pathname
.When running an app with
paths.base
set insvelte.config.js
, this changed the properties of the path. Before,$page.path
was relative tobase
set in the config. Now$page.url.pathname
is always the full path.If there was enough demand, it may make sense to make the relative path available through the framework.
Having more than one path may cause confusion to developers new to kit, and if this isn't a common use case it may not make sense.
Describe the proposed solution
Additional attribute
path
orrelpath
on the$page
storeAlternatives considered
Its not a big deal to write
$page.url.pathname.substring(base.length)
Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: