Closed brettchalupa closed 3 weeks ago
This API should probably not have been made stable in the first place, but fortunately none of these new additions require a breaking change to the already existing API.
Generally speaking we follow the spec no matter the browser support, but non-stable specifications should never override stable ones.
In this case adding all this new API unstably shouldn't be an issue and we can go ahead and deprecate the old API.
Let me know if you have any issues accomplishing any of this.
@daxpedda thanks for the guidance, makes sense! I'll dig into adding the new API. Is there any reference/guidance for how to deprecate the old API?
To deprecate an API you just slap the [RustDeprecated]
attribute on it.
Summary
The Gamepad specification is in draft for for how force feedback (a.k.a. rumble, a.k.a. vibration) works. The specification within web-sys for
hapticActuators
is in Editor's Draft as of 09 August 2024 to change to:Notice the last line:
hapticActuators
has changed tovibrationActuator
, and then the API for what that attribute is, aGamepadHapticActuator
, has a new API:This definition differs from what's currently enabled in GamepadHapticActuator.webidl
So my question is this: how does one go about contributing a change to an existing specification in this scenario? Would we add the new ones side-by-side with the existing? Or something else?
Additional Details
hapticActuators
API is only supported in Firefox (MDN) and is marked as experimental; it does not work from my testingvibrationActuator
api is supported in Chrome, Edge, Opera, and Safari (MDN) and functions from my testinghapticActuators
appears to be part of an older specification extensionBecause many browsers do support the
vibrationActuator
property and it's in the Gamepad spec draft, it seems like it's the future standard; it'd be awesome is web-sys supported it for implementing rumble for controllers in WASM; that's the core motivation for this addition/change.I'm happy to do the work to contribute this, but I figure since it's something changing, I should open an issue to start the conversation and get guidance. Thank you!