Intent to Ship: The ServiceWorker static routing API not condition support

270 views
Skip to first unread message

Yoshisato Yanagisawa

unread,
May 24, 2024, 3:43:49 AMMay 24
to blink-dev

Contact emails

yyana...@chromium.org


Explainer

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


Specification

https://w3c.github.io/ServiceWorker/#dom-routercondition-not


Design docs


https://docs.google.com/document/d/1B2D8w_2M4j9CZC1VccBOAhfCdiRP3yPCSV5UKKDhU70/edit#heading=h.ns1mpsv4yi7x


Summary

The ServiceWorker static routing API is an API used for routing the request to the network, the ServiceWorker fetch handler, or directly looking up from cache, and so on.  Each route consists of a condition and a source, and the condition is used for matching the request.


For Chromium implementations, the "or" condition is only the supported condition.  However, to write the condition more flexibly, supporting the "not" condition is expected, which matches the inverted condition inside.



Blink component

Blink>ServiceWorker


TAG review

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


TAG review status

Issues addressed


Risks



Interoperability and Compatibility

No compatibility concerns.

This change just starts supporting the not condition.  Since existing routes won't have the not condition, adding the not condition support won't affect any existing router rules.




Gecko: Positive (https://github.com/mozilla/standards-positions/pull/894)


WebKit: Positive (https://github.com/WebKit/standards-positions/issues/206)


Web developers: No signals


Other signals:


Ergonomics

The "not" condition calculates the conditions below and inverts the result, such calculation may also take a time.  Also, the element does not run concurrently.  However, the inversion is very quick, and rules should be sequentially evaluated, it should not be a large performance risk.



Activation

n/a



Security

This just adds the "not" condition.  I believe the security risk is low.



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?

n/a



Debuggability

n/a The debuggability should not be changed by adding the not condition.  Note that the "not" condition also shows up in chrome://serviceworker-internals and devtools.



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

Yes

This is a part of the ServiceWorker static routing API.  There is no reason not enabling the feature in specific platforms.



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

Yes

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

* Main resource load should not match the condition with not

* Main resource load should match the condition without not


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

* Subresource load should not match with the not condition

* Subresource load should match with a file other than not


Flag name on chrome://flags

None


Finch feature name

ServiceWorkerStaticRouterNotConditionEnabled


Requires code in //chrome?

False


Tracking bug

https://crbug.com/328565554


Availability expectation

The feature should be implemented if the ServiceWorker static routing API has been implemented by the other browsers.


Estimated milestones

Shipping on desktop

126


Shipping on Android

126





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).

n/a This only adds the "not" condition. No backward compatibility issue should exist.


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5121714160926720?gate=5090378146643968


This intent message was generated by Chrome Platform Status, and modified a bit.


Vladimir Levin

unread,
May 27, 2024, 11:21:58 AMMay 27
to Yoshisato Yanagisawa, blink-dev
Two of the tests listed here are failing on wpt.fyi. Is that known?
 

Flag name on chrome://flags

None


Finch feature name

ServiceWorkerStaticRouterNotConditionEnabled


Requires code in //chrome?

False


Tracking bug

https://crbug.com/328565554


Availability expectation

The feature should be implemented if the ServiceWorker static routing API has been implemented by the other browsers.


Estimated milestones

Shipping on desktop

126


Shipping on Android

126


126 is already branched. Could you update the milestones for shipping?
 




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).

n/a This only adds the "not" condition. No backward compatibility issue should exist.


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5121714160926720?gate=5090378146643968


This intent message was generated by Chrome Platform Status, and modified a bit.


--
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-6VnjdThgwUG74T8dhpZ%2BtF6nDyuCJrWtB1ypn7dFrrEwg%40mail.gmail.com.

Yoshisato Yanagisawa

unread,
May 28, 2024, 8:39:02 PMMay 28
to Vladimir Levin, blink-dev


2024年5月28日(火) 0:21 Vladimir Levin <vmp...@chromium.org>:
Yes, it is intended.  Since I2S has not gotten lgtm yet, the not condition support is disabled via flag.
If you enable the flag, these tests pass.
 

Flag name on chrome://flags

None


Finch feature name

ServiceWorkerStaticRouterNotConditionEnabled


Requires code in //chrome?

False


Tracking bug

https://crbug.com/328565554


Availability expectation

The feature should be implemented if the ServiceWorker static routing API has been implemented by the other browsers.


Estimated milestones

Shipping on desktop

126


Shipping on Android

126


126 is already branched. Could you update the milestones for shipping?
 

sure.

Yoav Weiss (@Shopify)

unread,
May 29, 2024, 4:31:45 AMMay 29
to blink-dev, Yoshisato Yanagisawa, blink-dev, Vladimir Levin
LGTM1

For next time, a runtime enabled flag would have made it easier for developers to test this, and would have gotten the WPTs to pass, even if the flag is still "experimental" and not enabled by default.
 
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Daniel Bratell

unread,
May 29, 2024, 11:08:36 AMMay 29
to Yoav Weiss (@Shopify), blink-dev, Yoshisato Yanagisawa, Vladimir Levin

LGTM2

/Daniel

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/021eb309-3e79-4af0-9a6e-2afc879f703en%40chromium.org.

Alex Russell

unread,
May 29, 2024, 12:07:41 PMMay 29
to blink-dev, Daniel Bratell, Yoshisato Yanagisawa, Vladimir Levin, Yoav Weiss
Reply all
Reply to author
Forward
0 new messages