Skip to content

Adding the Web Bluetooth API feature - #691

Merged
captainbrosset merged 3 commits into
mainfrom
bluetooth
Mar 15, 2024
Merged

captainbrosset merged 3 commits into
mainfrom
bluetooth

Conversation

@captainbrosset

Copy link
Copy Markdown
Contributor

This depends on mdn/browser-compat-data#22627 which introduces the web-features:bluetooth tag to the corresponding BCD entries.

@foolip foolip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving to allow merging after applying suggestions/rename.

Comment thread feature-group-definitions/bluetooth.yml Outdated
@@ -0,0 +1,4 @@
name: bluetooth

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Everything called WebSomething or Web Something feels extra hard to pick a short name for, but in this case I think we should go with:

Suggested change
name: bluetooth
name: Web Bluetooth

Web because it's a web version of a thing that exists outside the web and I've never seen the feature called just "Bluetooth". And capitalized Bluetooth because https://en.wikipedia.org/wiki/Bluetooth does that consistently, so I guess Bluetooth is a proper noun.

I think the identifier should be web-bluetooth, matching web-animations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No strong opinion from me on the ID for the feature. I thought we had a guideline against adding unnecessary prefixes like web, css, etc. though. Also, many of the web APIs start with "Web". So, we might end up with a lot of web-*.yaml file.
That said, people do refer to it as Web Bluetooth, not just Bluetooth.

@Elchi3 what do you think? I need another perspective on this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have no strong feelings but it irked me before that when looking up things alphabetically you basically need to check B for Bluetooth and then again W for Web Bluetooth to find it. This problem becomes quite obvious when you look at https://developer.mozilla.org/en-US/docs/Web/API for example.

Also, we have webusb, should that be web-usb?

Ultimately, I would think, that no one has thought this through from a broader perspective. So I guess we have two paths going forward:

  • either web-features comes up with strong guidelines on how to name web platform capabilities (and possibly bring that back to spec authors and others),
  • or we don't want to shape existing and future naming and we use what is common today among web developers and what matches with the existing specs. This path will probably not lead to consistent names.

@captainbrosset captainbrosset Mar 15, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it irked me before that when looking up things alphabetically you basically need to check B for Bluetooth and then again W for Web Bluetooth to find it. This problem becomes quite obvious when you look at https://developer.mozilla.org/en-US/docs/Web/API for example.

I share your feelings here.

or we don't want to shape existing and future naming and we use what is common today among web developers and what matches with the existing specs. This path will probably not lead to consistent names.

This sounds appealing. We've always said that web-features should match how developers think about things. On the one hand, we have an opportunity of making web-features a shared language between browser makers and web developers, by coming up with unique IDs that everyone use to talk about the web. So it would feel good to get this right. But on the other hand, I don't see how we'd land on better names than the ones that have appeared organically and have been used for years in the ecosystem already.

So, I'm leaning towards adding the web- prefix.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree this should have the web- prefix and have said all I have to say about the topic in #548 (comment) :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Elchi3 I filed #694 for the sorting problem, which is a problem I'm sensitive to.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

FWIW, I never imagined "name" would be the only name field, just the "conventional" (to web developers) one. I'd love to see—when relevant—short_name (e.g., "Bluetooth", as here) or long_name (e.g., "CSS Grid").

Comment thread feature-group-definitions/bluetooth.yml Resolved
@foolip

foolip commented Mar 15, 2024

Copy link
Copy Markdown
Collaborator

I've applied the naming suggestion but won't merge. @captainbrosset can you merge if you're happy with that?

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.

4 participants