-
Notifications
You must be signed in to change notification settings - Fork 312
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
ServiceWorker static routing API #1701
ServiceWorker static routing API #1701
Conversation
I used to work on the specification update to support the ServiceWorker static routing API (https://github.com/WICG/service-worker-static-routing-api) w3c#1686 However, I accidentally closed it by force-sync to the ServiceWorker specification's repository HEAD. This CL is for reviving it.
Just trying to add workflows rule to run CI in static_routing_api repository.
revert
Considering the future update of the condition, we should mark the case handled as one of conditions. Also, we need to make it extensible.
It was flipped by mistake.
Revive of PR w3c#1686.
Co-authored-by: Marijn Kruisselbrink <[email protected]>
… unset` phrase (#14) * Remove |raceResponseMap| * Re-format {{ServiceWorkerGlobalScope}} part and move `It is initially unset` phrase
Upon the review request, this CL makes |activeWorker| not modified in the Setup ServiceWorkerGlobalScope algorithm. It is the caller's responsibility to update the active service worker's global scope. With this change, an effemeral ServiceWorkerGlobalScope can be used for a cache source in the static routing API.
docs/index.bs
Outdated
:: |workerRealm|, a [=relevant realm=] of the [=service worker/global object=] | ||
:: |reservedClient|, a [=request/reserved client=] | ||
:: |preloadResponse|, a [=promise=] | ||
:: |raceResponse|, a [=race response=] |
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.
nit: add "or null", since sometimes you pass in null (and handle null)
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.
Done.
docs/index.bs
Outdated
: Output | ||
:: a [=/response=] or null | ||
|
||
1. If |request|'s [=request/reserved client=] is null, return null. |
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.
nit: maybe add a Note explaining that this check ensures that we're only dealing with non-subresrouce requests, and thus looking up a registration using the request URL is correct.
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.
Ah, I was wrong. We don't want to limit this algorithm for non-subresource requests. What we'd like to achieve here is to get [=active worker=] from [=/request=], regardless of non-subresource requests or subresource requests.
Updated to get the active worker from subreosurce requests, but perhaps we can just use |request|'s [=request/client=]'s [=active service worker=] for both subresource and non-subresource requests?
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.
What you have now looks reasonable to me. I think using request's client's active service worker for non-subresource requests would be incorrect. Maybe at some point we should abstract out a "give me the right registration for this request" algorithm to be shared between Handle Fetch and this algorithm, but for now what you have seems fine too.
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.
Thank you for the clarification!
* Remove |raceResponseMap| * Re-format {{ServiceWorkerGlobalScope}} part and move `It is initially unset` phrase * Fix |url| in Lookup Race Response * Update race handling, lookup race response algorithm
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.
Thanks for your patience, I think this addressed all my concerns.
SHA: 8d4b9df Reason: push, by mkruisselbrink Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Following w3c#1701, the `install` event now uses the `InstallEvent` interface.
SHA: 8d4b9df Reason: push, by pull[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Following #1701, the `install` event now uses the `InstallEvent` interface.
In w3c/ServiceWorker#1701, the ServiceWorker static routing API uses the match algorithm to match the request URL. However, the original match algorithm accepts a URLPatternInput object, and it does not accept a URL struct. To allow the ServiceWorker static routing API to use the match algorithm, we need to make the match algorithm to accept the URL struct. Fixes: #218.
Updates in the URLPattern specification was requested during the w3c#1701 review. The issues for the request has been resolved: - whatwg/urlpattern#217 - whatwg/urlpattern#218 However, during the specification updates, the algorithm names are also updated, and adjustment is needed.
…tion (#1707) * Update link texts upon updates in the URLPattern specification Updates in the URLPattern specification was requested during the #1701 review. The issues for the request has been resolved: - whatwg/urlpattern#217 - whatwg/urlpattern#218 However, during the specification updates, the algorithm names are also updated, and adjustment is needed. Co-authored-by: Domenic Denicola <[email protected]>
This API allows developers to configure the routing, and allows them to offload simple things ServiceWorkers do. If the condition matches, the navigation happens without starting ServiceWorkers or executing JavaScript, which allows web pages to avoid performance penalties due to ServiceWorker interceptions.
Explainer: https://github.com/WICG/service-worker-static-routing-api
TAG review: w3ctag/design-reviews#863
💥 Error: 503 Service Unavailable 💥
PR Preview failed to build. (Last tried on Feb 22, 2024, 12:13 AM UTC).
More
PR Preview relies on a number of web services to run. There seems to be an issue with the following one:
🚨 HTML Diff Service - The HTML Diff Service is used to create HTML diffs of the spec changes suggested in a pull request.
🔗 [Related URL]([object Object])
If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.