Intent to Ship: ServiceWorker static routing API

670 views
Skip to first unread message

Yoshisato Yanagisawa

unread,
Feb 8, 2024, 10:56:50 PMFeb 8
to blink-dev, sisid...@chromium.org

Contact emails

yyana...@chromium.org, sisid...@chromium.org


Explainer

https://github.com/WICG/service-worker-static-routing-api


Specification

https://github.com/w3c/ServiceWorker/pull/1701


Summary

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.



Blink component

Blink>ServiceWorker


TAG review

https://github.com/w3ctag/design-reviews/issues/863


TAG review status

Issues addressed


Chromium Trial Name

ServiceWorkerStaticRouter


Link to origin trial feedback summary

https://docs.google.com/document/d/1mE3tngHQdz0s66Z_iIGksFxQui3taogP8pDafLUHMEg/edit#heading=h.ia9i7k1ocjnq



Origin Trial documentation link

https://github.com/WICG/service-worker-static-routing-api?tab=readme-ov-file#origin-trial


Risks



Interoperability and Compatibility



Gecko: Positive (https://github.com/mozilla/standards-positions/issues/828)


WebKit: No signal (https://github.com/WebKit/standards-positions/issues/206) Informal positive signals at TPAC, but no official standards position.


Web developers: Positive (https://github.com/w3c/ServiceWorker/issues/1373) We see many positive signals and feedback from developers on the Github issue and other places (e.g. https://jakearchibald.com/2019/service-worker-declarative-router/#disqus_thread). Also, we have partners who participated in the OT (feedback).


Other signals:


WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

Authors don’t foresee any obvious issue with WebView. WebView supports ServiceWorkers, and any existing applications would not be affected unless they opt-in to the static routing API explicitly. 



Debuggability

The registered router rules are visible via chrome://serviceworker-internals and the DevTools application panel.  The matched rule can be seen in the size field of the DevTools network panel.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes


Is this feature fully tested by web-platform-tests?

Yes

https://wpt.fyi/results/service-workers/service-worker/tentative/static-router?label=master&label=experimental&aligned

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/?q=service-workers%2Fservice-worker%2Ftentative%2Fstatic-router



Flag name on chrome://flags

#service-worker-static-router


Finch feature name

ServiceWorkerStaticRouter


Requires code in //chrome?

False


Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1371756


Launch bug

https://launch.corp.google.com/launch/4261120


Measurement

The number of partners who started to use the API in their production. UKM's LCP and the partner's business metrics. UseCounter: ServiceWorkerStaticRouter_AddRoutes and ServiceWorkerStaticRouter_Evaluate


Availability expectation

Feature will eventually be available on Web Platform mainline. The URLPattern became the standard, and currently no concerns exist.


Adoption expectation

Feature is considered as a best practice to mitigate the ServiceWorker performance issue on its cold start. Several internal/external partners have already started trying the feature during the OT, and some of them see performance improvement. They are expected to use the feature within 12 months of launch in Chrome.


Adoption plan

We have already started the incubation process with several partners. We intend to move them forward to help them launch. By using the results as case studies, we intend to expand usage by helping libraries support the API.


Non-OSS dependencies

Does the feature depend on any code or APIs outside the Chromium open source repository and its open-source dependencies to function?

n/a


Estimated milestones

Shipping on desktop

123

OriginTrial desktop last

121

OriginTrial desktop first

116


Shipping on Android

123

OriginTrial Android last

121

OriginTrial Android first

116


OriginTrial webView last

121

OriginTrial webView first

116




Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

Limit the size of rules.

https://github.com/WICG/service-worker-static-routing-api/issues/5

https://github.com/WICG/service-worker-static-routing-api/issues/6

If the limit is large enough to cover the relevant usages, it should not be a source of issues.


Timing Info

https://github.com/WICG/service-worker-static-routing-api/issues/19

The timing info for the API will be decided in a backward-compatible way.  It should not be a source of issues.


Making subsequent subresource request uses the navigation request’s source

https://github.com/WICG/service-worker-static-routing-api/issues/7

This can be implemented as another condition, and should not break backward compatibility.


https://github.com/WICG/service-worker-static-routing-api/blob/main/final-form.md

tells conditions and sources that can be added in the future.  The time condition and conditional syntaxes are not implemented yet.  Also, some sources are considered to have fields.  However, they should come as new conditions / sources, it should not break backward compatibility.



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5185352976826368


Links to previous Intent discussions

Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/fyvsde2ay2A/m/RH9E8hB0AgAJ Intent to Experiment: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGMyg-abNsH2mfBw3%2BiaJgMn3SKCEzBzw0FuMudbmQ9XhkjEVg%40mail.gmail.com

Intent to Extend Experiment: https://groups.google.com/a/chromium.org/g/blink-dev/c/gTy-fpBOXDM

Intent to Ship: https://groups.google.com/a/chromium.org/g/blink-dev/c/gTy-fpBOXDM



This intent message was generated by Chrome Platform Status.


Vladimir Levin

unread,
Feb 8, 2024, 11:20:41 PMFeb 8
to Yoshisato Yanagisawa, blink-dev, sisid...@chromium.org


On Thu, Feb 8, 2024, 22:56 Yoshisato Yanagisawa <yyana...@chromium.org> wrote:

Contact emails

yyana...@chromium.org, sisid...@chromium.org


Explainer

https://github.com/WICG/service-worker-static-routing-api


Specification

https://github.com/w3c/ServiceWorker/pull/1701


Summary

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.



Blink component

Blink>ServiceWorker


TAG review

https://github.com/w3ctag/design-reviews/issues/863


TAG review status

Issues addressed


Chromium Trial Name

ServiceWorkerStaticRouter


Link to origin trial feedback summary

https://docs.google.com/document/d/1mE3tngHQdz0s66Z_iIGksFxQui3taogP8pDafLUHMEg/edit#heading=h.ia9i7k1ocjnq


I just want to say that it's heartening to see OT feedback being taken seriously and addressed in rigorous manner.


Origin Trial documentation link

https://github.com/WICG/service-worker-static-routing-api?tab=readme-ov-file#origin-trial


Risks



Interoperability and Compatibility



Gecko: Positive (https://github.com/mozilla/standards-positions/issues/828)


WebKit: No signal (https://github.com/WebKit/standards-positions/issues/206) Informal positive signals at TPAC, but no official standards position.


It seems like the only concerns with this proposal (in TAG and elsewhere) was the status of URLPattern in the spec, but that has been since resolved. Is this your understanding as well?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPNB-6WZdPweNTAvcG4k3kuB9EzV2AbGVme4Byxzg%2BRKganb2Q%40mail.gmail.com.

Yoshisato Yanagisawa

unread,
Feb 9, 2024, 12:21:36 AMFeb 9
to Vladimir Levin, blink-dev, sisid...@chromium.org


2024年2月9日(金) 13:20 Vladimir Levin <vmp...@chromium.org>:


On Thu, Feb 8, 2024, 22:56 Yoshisato Yanagisawa <yyana...@chromium.org> wrote:

Contact emails

yyana...@chromium.org, sisid...@chromium.org


Explainer

https://github.com/WICG/service-worker-static-routing-api


Specification

https://github.com/w3c/ServiceWorker/pull/1701


Summary

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.



Blink component

Blink>ServiceWorker


TAG review

https://github.com/w3ctag/design-reviews/issues/863


TAG review status

Issues addressed


Chromium Trial Name

ServiceWorkerStaticRouter


Link to origin trial feedback summary

https://docs.google.com/document/d/1mE3tngHQdz0s66Z_iIGksFxQui3taogP8pDafLUHMEg/edit#heading=h.ia9i7k1ocjnq


I just want to say that it's heartening to see OT feedback being taken seriously and addressed in rigorous manner.

Thank you.
 


Origin Trial documentation link

https://github.com/WICG/service-worker-static-routing-api?tab=readme-ov-file#origin-trial


Risks



Interoperability and Compatibility



Gecko: Positive (https://github.com/mozilla/standards-positions/issues/828)


WebKit: No signal (https://github.com/WebKit/standards-positions/issues/206) Informal positive signals at TPAC, but no official standards position.


It seems like the only concerns with this proposal (in TAG and elsewhere) was the status of URLPattern in the spec, but that has been since resolved. Is this your understanding as well?


Yes.  I think we are on the same page.
As I have left a comment in the WebKit link, URLPattern has already become the standard, and is actively maintained.

Yoshisato Yanagisawa

unread,
Feb 13, 2024, 8:39:05 PMFeb 13
to Vladimir Levin, blink-dev, sisid...@chromium.org
Do you have any other questions? concerns? comments?
There were many Intent to Ship/Experiment emails at the same time, and I am afraid this mail thread was overlooked.


2024年2月9日(金) 14:20 Yoshisato Yanagisawa <yyana...@chromium.org>:

Domenic Denicola

unread,
Feb 13, 2024, 11:55:45 PMFeb 13
to Yoshisato Yanagisawa, Vladimir Levin, blink-dev, sisid...@chromium.org
At the moment it appears the spec is not complete, as a possibly-large chunk of behavior (regarding request/response reuse that modifies the behavior of fetch() inside service worker fetch handlers) needs to have its spec written: https://github.com/yoshisatoyanagisawa/ServiceWorker/pull/10/files#r1483835014

Chris Harrelson

unread,
Feb 26, 2024, 11:33:41 AMFeb 26
to Domenic Denicola, Yoshisato Yanagisawa, Vladimir Levin, blink-dev, sisid...@chromium.org
I see the main spec PR has landed and a small related Fetch PR is done. Thanks all for doing that!

LGTM1


Domenic Denicola

unread,
Feb 26, 2024, 5:39:53 PMFeb 26
to Chris Harrelson, Domenic Denicola, Yoshisato Yanagisawa, Vladimir Levin, blink-dev, sisid...@chromium.org
LGTM2

Mike Taylor

unread,
Feb 26, 2024, 6:19:12 PMFeb 26
to Domenic Denicola, Chris Harrelson, Yoshisato Yanagisawa, Vladimir Levin, blink-dev, sisid...@chromium.org
Reply all
Reply to author
Forward
0 new messages