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

Adjust Bluetooth IDL for Rust #2385

Merged

Conversation

chrysn
Copy link
Contributor

@chrysn chrysn commented Dec 2, 2020

  • navigator.bluetooth is optional -- it may be manatory by the
    WebBluetooth spec, but the Rust code should still be able to handle
    the errors resulting from a browser not implementing the spec at all
    without panicking.

  • requestDevice: While it's marked optional upstream, practically it's
    mandatory (the default value, an empty dictionary, is not accepted).

Contributes-To: #2381


These two don't fully resolve #2381, but the easy parts. The navigator.bluetooth part is necessary in the sense that without this, panics on unsupported browsers need manual workarounds to avoid. The latter is more of a usability thing (keeping name clutter low).

* navigator.bluetooth is optional -- it may be manatory by the
  WebBluetooth spec, but the Rust code should still be able to handle
  the errors resulting from a browser not implementing the spec at all
  without panicking.

* requestDevice: While it's marked optional upstream, practically it's
  mandatory (the default value, an empty dictionary, is not accepted).

Contributes-To: rustwasm#2381
@alexcrichton
Copy link
Contributor

Looks good to me, thanks!

@alexcrichton alexcrichton merged commit 7702823 into rustwasm:master Dec 2, 2020
@chrysn chrysn deleted the bluetooth-adaptions branch December 3, 2020 14:04
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.

web-sys: Bluetooth usability issues
2 participants