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

[WebXR] Add hapticActuators to gamepad on XRInputSource #69613

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sorskoot
Copy link
Contributor

@sorskoot sorskoot commented May 15, 2024

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.

@typescript-bot
Copy link
Contributor

typescript-bot commented May 15, 2024

@sorskoot Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because 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

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Most recent commit is approved by type definition owners or DT maintainers

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.

Inactive

This 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"
}

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Author is Owner The author of this PR is a listed owner of the package. labels May 15, 2024
@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board May 15, 2024
@typescript-bot
Copy link
Contributor

🔔 @robrohan @RaananW @capnmidnight — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

Copy link
Contributor

@RaananW RaananW left a 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[];
Copy link
Contributor

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

@sorskoot
Copy link
Contributor Author

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?

@RaananW
Copy link
Contributor

RaananW commented May 22, 2024

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.
I personally think it belongs in a different types file (or, TBH, in typescript's lib.dom directly). However, I'll follow your lead here - if you think it belongs here i'll approve it (maybe with addressing my one comment up there :-) ). If you want to submit a different PR (types/gamepad or something like that) I will be happy to comment on the new PR.

@typescript-bot
Copy link
Contributor

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!

@typescript-bot typescript-bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author is Owner The author of this PR is a listed owner of the package. Popular package This PR affects a popular package (as counted by NPM download counts). Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer.
Projects
New Pull Request Status Board
Waiting for Code Reviews
Development

Successfully merging this pull request may close these issues.

None yet

3 participants