-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
[WebXR] Add hapticActuators to gamepad on XRInputSource #69613
base: master
Are you sure you want to change the base?
Conversation
@sorskoot Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 13 days — please try to get reviewers! Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 69613,
"author": "sorskoot",
"headCommitOid": "155c25164847c7463eb8b45c280b1df9b647cd9b",
"mergeBaseOid": "bfdcd1c2bad2ed372ebf698103824f4171e5e972",
"lastPushDate": "2024-05-15T06:36:34.000Z",
"lastActivityDate": "2024-05-22T16:00:31.000Z",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Popular",
"pkgInfo": [
{
"name": "webxr",
"kind": "edit",
"files": [
{
"path": "types/webxr/index.d.ts",
"kind": "definition"
},
{
"path": "types/webxr/webxr-tests.ts",
"kind": "test"
}
],
"owners": [
"robrohan",
"RaananW",
"capnmidnight",
"sorskoot"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
}
],
"reviews": [],
"mainBotCommentID": 2111691459,
"ciResult": "pass"
} |
🔔 @robrohan @RaananW @capnmidnight — please review this PR in the next few days. Be sure to explicitly select |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whereas I can see why it does make sense to have it here, I am not sure it is the right place to include it, as this is an extension of the gamepad module, and not a webxr specific feature. I will wait for others to comment on that as well.
} | ||
|
||
interface Gamepad { | ||
readonly hapticActuators: readonly GamepadHapticActuator[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be optional? This is not supported by all implementations. And the initial value (per specs) is undefined
The reason I added it to this type is that, while the hapticActuators property is still experimental, it is often used with VR controllers. I always have to add some extra type information to avoid errors in my code. Other people in the community have mentioned this as well. The definition of the gamepad API itself is not a part of DT. Do you think it's better to add a separate type for the Gamepad API to DT to incorporate this? |
Sorry, I didn't mean to delay the merge so much. Was just waiting for feedback from others. |
Re-ping @robrohan, @RaananW, @capnmidnight: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
Add haptic actuators to the gamepad and include pulse function.
Please fill in this template.
Use a meaningful title for the pull request. Include the name of the package modified.
Test the change in your own code. (Compile and run.)
Add or edit tests to reflect the change.
Follow the advice from the readme.
Avoid common mistakes.
Run
pnpm test <package to test>
.Provide a URL to documentation or source code which provides context for the suggested changes: <>
If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the
package.json
.