-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass more matchCallback return values through to handlerCallback #2134
Conversation
I'm mostly OK with this change, but (and I remember thinking about this when converting the code to TypeScript) I think the intention of the match callback is to be boolean-ish. That is, I think in most cases the function answers the question: Does this route match? Yes or no. With this change a return value of I do see a use case for returning a string and having that passed to |
Would you rather I change it so that |
I think so. Let's make is so that:
I'm also fine with dropping the support for removing empty array/objects, but maybe there's good reason to keep that?
I don't really understand why this is the case. Wouldn't |
Okay, please take another look with the latest changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one minor typo I saw.
PR-Bot Size PluginChanged File Sizes
New FilesNo new files have been added. All File SizesView Table
Workbox Aggregate Size Plugin3.49KB gzip'ed (23% of limit) |
R: @philipwalton
Fixes #2079
This change results in more return values from the
matchCallback
being passed through to thehandlerCallback
as theparams
option.(There is still some special-case logic for
{}
and[]
being treated as{params: undefined}
, matching the existing v4 behavior. It's implemented this way to make it easier to deal with amatchCallback
that uses aRegExp
with capture groups.)