include url for default routes within match#90
include url for default routes within match#90alexanderknapstein wants to merge 20 commits intostencil-community:masterfrom
Conversation
|
Any chance of merging this? |
|
until merge it's available as @inspirationlabs/router |
|
Can you elaborate a bit more on the use case? Does it deal with nested / child routes requiring to be setup with full absolute paths? I have the use case that I dynamically build nested child routes and would love the created children to „inherit“ their route from the parent. |
|
added compat to stencil one |
|
@bitflower It's not adding such a feature. It makes it just easier to get the current match when using pages which are from top to bottom dynamic. In our case they are driven by a CMS backend and there is no real routing logic except a default match rule in stencil and we validate against the backend as soon as the current route changes and load the data from the backend. |
Dear @jthoms1 ,
we make heavily use of the route-switch but not only for not-found-pages, but for dynamic loaded content without assigning every route to a specific component. So in our case it would be helfpul to include the current "match" within the match object.
example:
the match result (@prop() match: MatchResults;) for all default routes (e.g. /some/url) looks like this:
which is not helpful in a fallback case to load any dynamic data. With my suggestion the match result will contain the current url, which can be consumed within the route component:
Would be cool, if you could merge that.
Thanx /Alex