Skip to content

Conversation

@brettchalupa
Copy link

The API that currently exists in the repo has been deprecated and the
new API has been added.

This allows gamepads to be rumbled.

I tried to follow the instructions in https://github.com/rustwasm/wasm-bindgen/tree/main/crates/web-sys#how-to-add-an-interface as best as I could.

Spec: https://w3c.github.io/gamepad/

More details: #4089

It's not entirely clear to me how to best test this out, but I'm happy to if anyone's able to provide a little guidance. Thanks!

@brettchalupa brettchalupa marked this pull request as ready for review August 29, 2024 16:34
Copy link
Member

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

Considering this is a working draft, these new APIs should be unstable.
This works by just moving the WebIDL to the unstable folder.

Otherwise this is great, thank you!

@daxpedda daxpedda added the waiting for author Waiting for author to respond label Sep 7, 2024
@brettchalupa brettchalupa force-pushed the gamepads-vibrationActuator branch from 9718a4d to 0296a06 Compare September 13, 2024 18:15
@brettchalupa
Copy link
Author

@daxpedda thanks for the guidance! I just pushed up a new commit with that change and addressed a merge conflict with the CHANGELOG.md file

Copy link
Member

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

The CI is failing because bindings have to be regenerated.

Please let me know if you have any issues doing that or if anything is unclear!

Comment on lines +37 to +42
interface GamepadHapticActuator
{
[RustDeprecated]
readonly attribute GamepadHapticActuatorType type;
[Throws, NewObject, RustDeprecated]
Promise<boolean> pulse(double value, double duration);
Copy link
Member

Choose a reason for hiding this comment

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

Already stabilized APIs can't simply be made unstable, this would be a breaking change.

Comment on lines +11 to +14
[RustDeprecated]
enum GamepadHapticActuatorType {
"vibration"
};
Copy link
Member

Choose a reason for hiding this comment

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

Same as before, this can't be made unstable without a breaking change anymore.

@daxpedda daxpedda mentioned this pull request Sep 28, 2024
@daxpedda
Copy link
Member

Replaced by #4134.

Turns out hapticActuators isn't deprecated and the Gamepad Extensions API is still valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for author Waiting for author to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants