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

[@types/react] Add onResize event to video elements #63076

Merged
merged 1 commit into from Nov 4, 2022

Conversation

Semigradsky
Copy link
Contributor

Please fill in this template.

If changing an existing definition:

Closes #63061

@typescript-bot
Copy link
Contributor

typescript-bot commented Nov 4, 2022

@Semigradsky Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

@Semigradsky: I see that you have added yourself as an owner, are you sure you want to become an owner?

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

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 a DT maintainer

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


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 63076,
  "author": "Semigradsky",
  "headCommitOid": "c2c6a52b59ebdfc0fe847bf79c305c57acfb8235",
  "mergeBaseOid": "17956ab1d255c6e739a2eed81f92e76bc60665b0",
  "lastPushDate": "2022-11-04T10:11:26.000Z",
  "lastActivityDate": "2022-11-04T10:37:00.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "react",
      "kind": "edit",
      "files": [
        {
          "path": "types/react/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/react/test/elementAttributes.tsx",
          "kind": "test"
        }
      ],
      "owners": [
        "johnnyreilly",
        "bbenezech",
        "pzavolinsky",
        "ericanderson",
        "DovydasNavickas",
        "theruther4d",
        "guilhermehubner",
        "ferdaber",
        "jrakotoharisoa",
        "pascaloliv",
        "hotell",
        "franklixuefei",
        "Jessidhia",
        "saranshkataria",
        "lukyth",
        "eps1lon",
        "zieka",
        "dancerphil",
        "dimitropoulos",
        "disjukr",
        "vhfmag",
        "hellatan",
        "priyanshurav"
      ],
      "addedOwners": [
        "Semigradsky"
      ],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 1303213708,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Edits Owners This PR adds or removes owners Critical package labels Nov 4, 2022
@typescript-bot
Copy link
Contributor

@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board Nov 4, 2022
@DangerBotOSS
Copy link

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files.
The check for missing properties isn't always right, so take this list as advice, not a requirement.

react (unpkg)

was missing the following properties:

  1. unstable_act

Generated by 🚫 dangerJS against c2c6a52

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Nov 4, 2022
Copy link
Collaborator

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thanks!

@eps1lon eps1lon merged commit e288812 into DefinitelyTyped:master Nov 4, 2022
@typescript-bot typescript-bot removed this from Needs Maintainer Review in New Pull Request Status Board Nov 4, 2022
@robinmetral
Copy link

robinmetral commented Nov 8, 2022

It looks like this breaks TS compatibility between our app on React 17 and a library on React 18. Can we make the same change to React 17 types?

Screenshot 2022-11-08 at 15 21 09

☝️ Body extends React 18 HTMLAttributes<HTMLParagraphElement> and this somehow clashes with React 17 types in the repository.

I can fix this locally by adding the new lines from this PR to the React type defs in node_modules:

        onRateChangeCapture?: ReactEventHandler<T> | undefined;
+       onResize?: ReactEventHandler<T> | undefined;
+       onResizeCapture?: ReactEventHandler<T> | undefined;
        onSeeked?: ReactEventHandler<T> | undefined;

(e.g. #62879 updates the attribute in types for React 16, 17 and 18 and didn't cause issues for us)

@robinmetral
Copy link

Ah but the problem here is that onResize was only added in React 18 (facebook/react#24195), so backporting the change would be inaccurate. Does anyone with better TS skills know how to avoid the conflict I'm describing above? If a reproduction would help I'd be happy to provide one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical package Edits Owners This PR adds or removes owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add types definition for resize event on video element.
5 participants