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

Add or condition support. #7

Merged
merged 3 commits into from
Jan 25, 2024
Merged

Conversation

yoshisatoyanagisawa
Copy link
Owner

@yoshisatoyanagisawa yoshisatoyanagisawa commented Jan 24, 2024

The ServiceWorker static routing API has a or conditional syntax. This is a specification update to support that.


Preview | Diff

@yoshisatoyanagisawa
Copy link
Owner Author

@domenic @sisidovski Can I ask you to review the change?
Thank you in advance.

@@ -1567,6 +1567,8 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
RequestMode requestMode;
RequestDestination requestDestination;
RunningStatus runningStatus;

sequence<RouterCondition> _or;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure this has to have a leading underscore. https://webidl.spec.whatwg.org/#idl-names

This underscore in the chromium implementation actually comes from the chromium Web IDL compiler, but Web IDL spec itself doesn't think or is a reserved keyword?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is reserved: https://webidl.spec.whatwg.org/#index-prod-UnionType has it in monospaced font, which I think means it's a terminal symbol and thus the tokenizer will pick it up as part of the grammar? I'm pretty rusty on my grammar stuff though.

But we have had to do similar escaping in the past, e.g. note the definition of _any in https://dom.spec.whatwg.org/#interface-AbortSignal . So this makes sense to me.

Copy link
Collaborator

@sisidovski sisidovski Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find the whole list. That makes sense, thanks!

Copy link

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with nits

@@ -1567,6 +1567,8 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
RequestMode requestMode;
RequestDestination requestDestination;
RunningStatus runningStatus;

sequence<RouterCondition> _or;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is reserved: https://webidl.spec.whatwg.org/#index-prod-UnionType has it in monospaced font, which I think means it's a terminal symbol and thus the tokenizer will pick it up as part of the grammar? I'm pretty rusty on my grammar stuff though.

But we have had to do similar escaping in the past, e.g. note the definition of _any in https://dom.spec.whatwg.org/#interface-AbortSignal . So this makes sense to me.

docs/index.bs Outdated Show resolved Hide resolved
docs/index.bs Outdated Show resolved Hide resolved
docs/index.bs Outdated Show resolved Hide resolved
docs/index.bs Outdated Show resolved Hide resolved
- mutual to mutually.
- |or condition| or |or conditions| to |orCondition| or |orConditions|.
- simplify the for loop upon WICG/service-worker-static-routing-api#9.
@yoshisatoyanagisawa
Copy link
Owner Author

Thanks for the review. I am going to merge this.

@yoshisatoyanagisawa yoshisatoyanagisawa merged commit 2d0d848 into static_routing_api Jan 25, 2024
1 check passed
@yoshisatoyanagisawa yoshisatoyanagisawa deleted the or_condition branch January 25, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants