Skip to content

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: wasm-bindgen#2381
@alexcrichton
Copy link
Contributor

Looks good to me, thanks!

@alexcrichton alexcrichton merged commit 7702823 into wasm-bindgen: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