Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #24726
What is the current behavior?
Currently,
ion-routercan't match an unknown path, so there's no way to render a "not found" page. A*in anion-routeurl is matched literally,url="/:any"only catches a single segment, and an unknown path below a known route (e.g.,/admin/settings) renders that route.What is the new behavior?
An
ion-routeurl that ends in*now matches any remaining path, and the matched part is passed to the component aspathMatch. Ranking follows React Router, so a catch-all only beats a route that matches the whole path when it has more fixed segments (/admin/*beats/:section/:idbut not/admin/:id). It always beats a route that only matches by ignoring trailing segments. Apps without a*route match exactly as before.Does this introduce a breaking change?
Not a breaking change, but a new feature, which is why it's in a feature branch.
Other information
This only affects vanilla JS and Stencil apps, since Angular, React and Vue use their own routers. The
*inion-route-redirectis unchanged, sofrom="/admin/*"still doesn't match/adminwhileurl="/admin/*"does. The docs call out that difference (after the docs PR is merged).Catch-all test page
Latest dev build