w3c / w3c/ServiceWorker

Better hooks for functional events

Open
#1,808 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Bikeshed
Stars
3.6k
Forks
324
Avg merge
14d 22h
Merged PRs (30d)
1

Description

Most specifications that define functional events don't seem to fire them with the arguments Service Workers prescribes. In particular postDispatchSteps is often rather hand-wavy.

And given that some of the arguments are optional, but none are named (see Infra), it's rather unclear how to properly do this.

On top of that specifications might want to do something only after the events extension period is over, and perhaps do different things depending on whether the promise resolves or rejects. Doing this cleanly is somewhat murky at the moment. In Push API for instance we simply wait for some state to flip while in parallel: https://w3c.github.io/push-api/#dfn-fire-a-push-event

This should be organized a bit better.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the issue's references to Infra and the Push API's “fire a push event” definition, then compare how functional events currently describe postDispatchSteps and optional arguments. Determine a consistent hook organization that covers the events extension period and promise resolution or rejection. Done means the specification guidance is concrete and consistently applicable to the affected event definitions.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.