Open hazycora opened 10 months ago
So now we have a bug report and a feature request for basically the same thing: #11759
I made my issue a bug report on beforeNavigate
, which is not correct, as clearly shallow routing is not navigation.
But we need a way to be able to react to shallow routing. We now have two use cases:
Also if adding a new interceptor for reacting to shallow routing, it should probably now have navigate
in its name. So maybe onShallowRouting
or onHistoryChange
?
Describe the problem
sveltekit's
onNavigate
doesn't run for shallow routing as these aren't truly navigations. This means if you want to use a view transition for a shallow route you need to modify the code wherever pushState/replaceState is ran using the lower level tick function. This is a bit messy.Describe the proposed solution
maybe onNavigate can optionally support shallow routing as well with an optional boolean property before the callback?
Alternatives considered
A separate function,
onShallowNavigate
or similar.Importance
nice to have
Additional Information
No response