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-dom] fix: react-dom flushSync types #69241

Merged
merged 3 commits into from Apr 3, 2024

Conversation

2239559319
Copy link
Contributor

Please fill in this template.

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an npm package, match the name. If not, do not conflict with the name of an npm package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

  • 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.

If removing a declaration:

  • If a package was never on Definitely Typed, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

see ReactDOM.js
ReactFiberWorkLoop.js

Doc has been updated reactjs/react.dev#6730

@typescript-bot
Copy link
Contributor

typescript-bot commented Apr 2, 2024

@2239559319 Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

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": 69241,
  "author": "2239559319",
  "headCommitOid": "c07523fcd2b090f65dd2e15dc8ec10dafae22510",
  "mergeBaseOid": "e5d07ac1d28e211291ff804adcf0d18e0002e72d",
  "lastPushDate": "2024-04-02T06:08:16.000Z",
  "lastActivityDate": "2024-04-02T09:13:47.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "react-dom",
      "kind": "edit",
      "files": [
        {
          "path": "types/react-dom/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/react-dom/test/react-dom-tests.tsx",
          "kind": "test"
        }
      ],
      "owners": [
        "MartynasZilinskas",
        "theruther4d",
        "Jessidhia",
        "eps1lon"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "stale",
      "reviewer": "eps1lon",
      "date": "2024-04-02T09:13:47.000Z",
      "abbrOid": "f62cc2d"
    }
  ],
  "mainBotCommentID": 2031147484,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Contributor

🔔 @MartynasZilinskas @theruther4d @Jessidhia @eps1lon — 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.

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Apr 2, 2024
types/react-dom/index.d.ts Outdated Show resolved Hide resolved
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! The original types were motivated the typings of the reconciler instead of the intended usage: #51512

Flow types were updated in facebook/react#21887 which matches the proposed types.

Let's focus on the incorrect second param and then discuss separately if we really need typings for flushSync(): void

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Apr 2, 2024
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Needs Author Action in New Pull Request Status Board Apr 2, 2024
@typescript-bot
Copy link
Contributor

@2239559319 One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@typescript-bot typescript-bot removed the Revision needed This PR needs code changes before it can be merged. label Apr 2, 2024
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Apr 2, 2024
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board Apr 2, 2024
@typescript-bot
Copy link
Contributor

@eps1lon Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@2239559319 2239559319 requested a review from eps1lon April 2, 2024 09:06
@eps1lon
Copy link
Collaborator

eps1lon commented Apr 3, 2024

Thank you!

@eps1lon eps1lon merged commit da544a9 into DefinitelyTyped:master Apr 3, 2024
4 checks passed
@typescript-bot typescript-bot removed this from Needs Maintainer Review in New Pull Request Status Board Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants