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

Adding the Web Bluetooth API feature #691

Merged
merged 3 commits into from
Mar 15, 2024
Merged

Adding the Web Bluetooth API feature #691

merged 3 commits into from
Mar 15, 2024

Conversation

captainbrosset
Copy link
Contributor

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

Copy link
Collaborator

@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.

Approving to allow merging after applying suggestions/rename.

@@ -0,0 +1,4 @@
name: bluetooth
Copy link
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
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
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.

Copy link
Contributor Author

@captainbrosset captainbrosset Mar 15, 2024

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
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
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
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").

@foolip
Copy link
Collaborator

foolip commented Mar 15, 2024

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

@captainbrosset captainbrosset merged commit eaa311b into main Mar 15, 2024
2 checks passed
@captainbrosset captainbrosset deleted the bluetooth branch March 15, 2024 14:43
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