Skip to content
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

Treat registerRoute('/foo/:bar', ...) as exact match in v3 #1012

Closed
jeffposnick opened this issue Nov 8, 2017 · 1 comment
Closed

Treat registerRoute('/foo/:bar', ...) as exact match in v3 #1012

jeffposnick opened this issue Nov 8, 2017 · 1 comment
Labels
Breaking Change Denotes a "major" semver change. workbox-routing

Comments

@jeffposnick
Copy link
Contributor

Library Affected:
workbox-routing

Following up from #1011, in v3 we are going to stop creating ExpressRoutes implicitly whenever there's a string argument passed to the registerRoute() helper.

Instead, strings will be tested for an exact match, either against the url.path (if the string begins with '/') or against the url.href (if the string begins with http).

We'll continue the logging that #1011 introduces, and ensure that we direct developers to documentation about constructing an equivalent RegExpRoute and/or creating their own custom matchHandler as alternatives.

@jeffposnick jeffposnick added Breaking Change Denotes a "major" semver change. v3 workbox-routing labels Nov 8, 2017
@gauntface
Copy link

SGTM.

Worth calling out that matches for strings not starting with http should only match same-origin requests - same as regular expressions.

I'm still open to supporting an express style "matcher" if developers want it but I'm fairly sure a RegExp will be easy to replace the express routes in most cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change Denotes a "major" semver change. workbox-routing
Projects
None yet
Development

No branches or pull requests

2 participants