Re: [w3c/ServiceWorker] Declarative routing (#1373)

Late to the party but I'd like to give a bit of feedback.

I love the general concept. Seems like this will solve a lot of problems (speed issues with spinning up SWs, and the added "scariness" of what if the fetch handler has a bug that makes my site non-updateable.) This came up as a potential solution to w3c/manifest#774.

I have some superficial criticism (API surface details).

* I'd like to remove the `startsWith` and `endsWith` things in favour of just having a glob syntax. Fewer API calls, less verbose syntax, and more flexible.
* `ignoreSearch` is a confusing name (why not `ignoreQuery`)? Alternatively, just embrace the glob and allow `?*` at the end of the glob to mean "ignore the query" (not as an especially special case, but rather as a general rule, treat a '?' at the end of a path with nothing after it as the same as no '?'.
* The name `router.get` is confusing because a method called "get" implies it's going to return some information out of the router, not set up a new route. I'd rather just remove that method and just make you write `router.add({method: 'GET'})` which is nice and obvious what it's going to do.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1373#issuecomment-517102756

Received on Thursday, 1 August 2019 03:22:45 UTC