Skip to content

Guideline for entrypoints that are too long to spell out #1388

@foolip

Description

@foolip

In #1363 (comment) @captainbrosset wrote:

We usually try to name the entry point of the feature in the description. In this case it would be ServiceWorkerRegistration.sync. Although it's a bit long, and devs don't actually write ServiceWorkerRegistration in their code, but instead get a registration object by doing await navigator.serviceWorker.ready. So I'm not too sure what to do here.

I don't think we've dealt with this before, but it will happen quite a lot. This would be terrible:

The (await navigator.serviceWorker.ready).sync API ...

Because it's extremely unlikely anyone would write the code like that.

This specific case is complicated by the fact that there are many ways to get a ServiceWorkerRegistration instance, see the backreferences from https://w3c.github.io/ServiceWorker/#get-the-service-worker-registration-object

Another case is properties on methods on elements. Some precedent from that:

The showPicker() method for <input> elements shows the user interface for picking a value. For example, for <input type="date"> it shows the interface for picking a date.

The preservesPitch property for <audio> or <video> adjusts the pitch of audio to sound more natural when the playback rate is faster or slower than the default.

What should a guideline say?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions