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 a short name to the schema (required) #545

Merged
merged 7 commits into from
Jan 29, 2024
Merged

Add a short name to the schema (required) #545

merged 7 commits into from
Jan 29, 2024

Conversation

foolip
Copy link
Collaborator

@foolip foolip commented Jan 26, 2024

Fixes #490.

Copy link
Collaborator Author

@foolip foolip left a comment

Choose a reason for hiding this comment

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

Self-review to point out some interesting bits.

@@ -1 +1,2 @@
name: "Anchor Positioning"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Name of the spec is "CSS Anchor Positioning", but prefix not needed.

feature-group-definitions/array-flat.yml Outdated Show resolved Hide resolved
feature-group-definitions/array-at.yml Outdated Show resolved Hide resolved
feature-group-definitions/border-image.yml Outdated Show resolved Hide resolved
feature-group-definitions/broadcast-channel.yml Outdated Show resolved Hide resolved
feature-group-definitions/navigation.yml Show resolved Hide resolved
feature-group-definitions/sanitizer.yml Outdated Show resolved Hide resolved
@@ -1,3 +1,4 @@
name: "Scheduler API"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

API because scheduling is a browser-internal thing as well. Similar argument to Navigation API.

Copy link
Collaborator

Choose a reason for hiding this comment

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

browser-internal thing

Do we have any evidence that web developers know or care about this fact?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I don't think most web developers think about how work is scheduled unless they specialize in performance. But it's like "paint", "layout" or "fetch". Browsers do these things, but there are also APIs for them.

feature-group-definitions/svg2-script-html-equivalence.yml Outdated Show resolved Hide resolved
feature-group-definitions/webcodecs.yml Outdated Show resolved Hide resolved
@foolip foolip requested a review from ddbeck January 26, 2024 11:10
Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

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

I think all of this is fine, so I'm approving it.

That said, I've made some suggestions, thinking about how we might want to use this field. I'm not strongly committed to these suggestions (or couldn't even settle one one, in some cases). So perhaps an approach here is to adopt the changes that you like and open issues for anything that we ought to document as a naming guideline/convention?

feature-group-definitions/anchor-positioning.yml Outdated Show resolved Hide resolved
feature-group-definitions/array-at.yml Outdated Show resolved Hide resolved
feature-group-definitions/array-flat.yml Outdated Show resolved Hide resolved
feature-group-definitions/async-clipboard.yml Outdated Show resolved Hide resolved
feature-group-definitions/broadcast-channel.yml Outdated Show resolved Hide resolved
feature-group-definitions/edit-context.yml Outdated Show resolved Hide resolved
feature-group-definitions/media-capture.yml Outdated Show resolved Hide resolved
feature-group-definitions/picture-in-picture.yml Outdated Show resolved Hide resolved
@@ -1,3 +1,4 @@
name: "Scheduler API"
Copy link
Collaborator

Choose a reason for hiding this comment

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

browser-internal thing

Do we have any evidence that web developers know or care about this fact?

feature-group-definitions/scrollintoview.yml Show resolved Hide resolved
@ddbeck
Copy link
Collaborator

ddbeck commented Jan 27, 2024

To recap, I think these are some initial guidelines to emerge from the various edits here:

Short name guidelines

Above all else, observe these two principles:

  • Prefer names that web developers would actually use. Ask yourself: could you imagine hearing this a meeting or written in an issue tracker?
  • Be open to revising in response to developer use and feedback. Descriptive names are cheap to change, as compared to identifiers.

In the absence of more definitive names, start from these guidelines:

  • Prefer sentence case, unless you must match an interface name, specification title, or conventional casing and punctuation.
  • Prefer ordinary descriptive nouns ("Idle detection") over interface names ("IdleDetector"), specification titles ("Idle Detection API"), or metonymy ("IdleDetector.start()"). This is a judgment call; use your head (and a StackOverflow and GitHub issue search).
  • If in doubt, choose the shortest plausible phrasing, but be open to revising it when someone is confused or complains. Someday we'll add a long name field, where we can be pedantic and consistent.
  • Adhere to long-standing conventions, even when they're silly (e.g., "referer" or "pseudo-class").
  • Specific issues:
    • CSS: Let syntax and casing—such as : (for pseudos), @ (for at-rules), and kebab-case—do the talking (e.g., ":indeterminate" not ":indeterminate pseudo-class").
    • HTML: Tags can stand in for the concept of an element (e.g., "<img>" not "<img> element" or "Image element").
    • JavaScript and Web APIs: If you must name a specific method, property, or other part of an interface, start with this template: <interface> <property/method/etc.> (e.g., "Array at()" not "Array at() method").
    • WebAPIs: Append "API" only if it's needed to avoid an ambiguity (e.g., "Navigation API" not "Navigation").

@foolip
Copy link
Collaborator Author

foolip commented Jan 28, 2024

Thank @ddbeck, that encapsulates well the decisions we landed on so far. A few thoughts:

Prefer sentence case, unless you must match an interface name, specification title, or conventional casing and punctuation.

This is the hardest guideline to follow I think. Both specification title and conventional casing would lead us to View Transitions and Idle Detections, but I stuck with sentence case. The hard part is the inconsistency we'd have between these and a case like "Fetch priority", and how to draw the line.

I think we should list only the exceptions we've used, which so far is only matching API names, which are also written together, e.g., BroadcastChannel.

Adhere to long-standing conventions, even when they're silly (e.g., "referer" or "pseudo-class").

Neither of these cases are at play in the names we've used. Do you have a case in mind where we'll need to use this part of the guideline?

@@ -1,3 +1,4 @@
name: "Sticky positioning"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to check if position: sticky might be more common.

@@ -1,3 +1,4 @@
name: "WebCodecs"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh right, this is the spec name, it's not code.

@tidoust
Copy link
Member

tidoust commented Jan 29, 2024

Side note: all entries in browser-specs have a shortTitle property. That could be a useful place to look at when a specification title is needed.

Most of the time, the property value is derived from the spec's title automatically but it is sometimes set manually, and we'd be happy to improve the values as needed.

The short title is typically used by Bikeshed when a spec references a section in another spec. For instance, the AVIF's spec full title is "AOMedia Film Grain Synthesis 1 (AFGS1) specification". Its short title is "AVIF", and [[av1-avif#layer-selector-property]] would thus render as "AVIF § 2.3.2.2 Layer Selector Property" in a spec.

@foolip
Copy link
Collaborator Author

foolip commented Jan 29, 2024

Thanks @tidoust, I didn't know about shortTitle. Looking over them, it looks like you're keeping "API" in more cases than we're leaning towards here. Do you have guidelines for which to use?

@foolip
Copy link
Collaborator Author

foolip commented Jan 29, 2024

I'm going to merge this now and filing a new issue for the guidlines.

@foolip foolip merged commit 30e6f40 into main Jan 29, 2024
2 checks passed
@foolip foolip deleted the name branch January 29, 2024 13:44
@tidoust
Copy link
Member

tidoust commented Jan 29, 2024

Thanks @tidoust, I didn't know about shortTitle. Looking over them, it looks like you're keeping "API" in more cases than we're leaning towards here. Do you have guidelines for which to use?

I don't think (or don't recall ;)) that we gave much thoughts about keeping or dropping "API". The shortTitle property was mainly introduced for CSS specs. It seems fine to me to favor dropping API when possible. I created w3c/browser-specs#1177 to track this from a browser-specs perspective.

@captainbrosset
Copy link
Contributor

captainbrosset commented Jan 30, 2024

  • CSS: Let syntax and casing—such as : (for pseudos), @ (for at-rules), and kebab-case—do the talking (e.g., ":indeterminate" not ":indeterminate pseudo-class").

I'm on the fence about this one because I always think about beginners. It feels much more beginner-friendly, from my opinion, to say things like "has pseudo-element" rather than ":has", or "dialog html element" rather than "<dialog>".

Note that it could be a mix of both: ":has pseudo" and "<dialog> element". But, asking people to recognize a tiny syntax character to know what we're talking about feels like an unnecessary barrier to me.

  • HTML: Tags can stand in for the concept of an element (e.g., "<img>" not "<img> element" or "Image element").

What if we have an SVG element feature at some point. How would someone know if "<foo>" is SVG or HTML?

jcscottiii added a commit to GoogleChrome/webstatus.dev that referenced this pull request Feb 8, 2024
Additionally, update the backend api to support returning the data now.

Given that web-platform-dx/web-features#545 is
now merged, we now have a user friendly name.

This commit updates our local version of defs.schema.json so that the
autogenerated model can now be used when consuming the data. The
backend/openapi.yaml now exposes that data through a field with the same
name.

Changes to the datastore (gds) library:
- The Upsert method now uses the actual FeatureData argument (which now
has the name field).
- This List method which returns a backend.Feature is modified to use
  the new name field

Change-Id: Ied10ce9eb36a6aac5bdf2f69384da555b7a9482e
foolip added a commit that referenced this pull request Mar 13, 2024
Short name and Baseline high date have been added to the schema:
#545
#593

Many features have also been added.
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.

Feature Request: Human Friendly Name for Feature Definitions
4 participants