Mounted router fall back to parent router when route is not found#883
Draft
schloerke wants to merge 18 commits into
Draft
Mounted router fall back to parent router when route is not found#883schloerke wants to merge 18 commits into
schloerke wants to merge 18 commits into
Conversation
Hides how many mounts are being used
Member
|
I suggest removing the |
jcheng5
reviewed
Sep 29, 2022
…lows for top router to handle 404s
… where" This reverts commit 387a041.
… last resort in `$serve()`
Member
|
As written, you can choose to either have 1) 405 and missing-trailing-slash automatically handled for you, or 2) a custom top-level 404 handler, but you cannot have both. |
…ound. In `$serve()`, move `routeNotFoundStep` before `postRouteStep` In `$route()`, if `404` handler has been set, call `lastChanceRouteNotFound()`
Collaborator
Author
|
Going to wait on this PR for a bit as the changes are fairly drastic compared to current functionality |
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.
A different solution to #881
Situation:
/;/b/zis mounted at/a/cis mounted at/a/bGoal: Request
/a/b/cCurrent behavior:
/a/b/cmatches against mount location of/./a/b/c.New behavior:
/a/b/cmatches against mount location of/./a/b/c$route()is marked asrouteNotFound()/a/b/cmatches against mount location/a/b/c/b/cdoes not match any routes$route()is marked asrouteNotFound()/a/b/cmatches against mount location/a/b/c/cmatches route location/c/cis returnedThis would allow for #882 to not be merged, keep the docs as the last mount location. This benefits the user in that their content will always have preference over anything mounted in
/__docs__/PR task list:
$set_fallback(fallback = TRUE)?$mount(path, router, fallback = TRUE)?devtools::document()