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

[react] Deprecate types related to classic components in favor of types from create-react-class #68091

Merged

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Jan 3, 2024

The "classic component" notion is only relevant for create-react-class. Therefore, its types should live there instead of bloating types in react. This PR deprecates:

  • React.ClassicElement<Props> (use createReactClass.ComponentElement<Props, InstanceType<T>>
  • React.ClassicComponentClass (use createReactClass.ClassicComponentClass)
  • React.ClassicComponent (use createClass.ClassicComponent)
  • moves the deprecated React.Mixin and React.ComponentSpec into create-react-class that actually uses these types. Addons will use createReactClass.ComponentSpec going forward instead of the deprecated React.ComponentSpec

@typescript-bot typescript-bot added this to Needs Author Action in New Pull Request Status Board Jan 3, 2024
@eps1lon eps1lon force-pushed the feat/react/deprecate-classic branch from 9b032cf to 2a30f1f Compare January 3, 2024 19:07
render() {
return DOM.div(this.props.text);
},
});

// React.createFactory
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've moved all these tests to react and react-dom. They were actually testing that non-standard instance methods were preserved in these APIs which is unrelated to create-react-class.

@eps1lon eps1lon marked this pull request as ready for review January 3, 2024 19:56
@typescript-bot
Copy link
Contributor

typescript-bot commented Jan 3, 2024

@eps1lon Thank you for submitting this PR!

This is a live comment which I will keep updated.

3 packages 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
  • ✅ A DT maintainer needs to approve changes which affect more than one package

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 68091,
  "author": "eps1lon",
  "headCommitOid": "2a30f1ff6dc67104fb4514c3f99c774cf5100486",
  "mergeBaseOid": "ba6c5b11a9d9ff910766625d58a45743a70f6503",
  "lastPushDate": "2024-01-03T18:46:15.000Z",
  "lastActivityDate": "2024-01-06T09:31:02.000Z",
  "mergeOfferDate": "2024-01-05T21:27:10.000Z",
  "mergeRequestDate": "2024-01-06T09:31:02.000Z",
  "mergeRequestUser": "eps1lon",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "create-react-class",
      "kind": "edit",
      "files": [
        {
          "path": "types/create-react-class/create-react-class-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/create-react-class/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "jgoz"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "react-dom",
      "kind": "edit",
      "files": [
        {
          "path": "types/react-dom/test/react-dom-tests.tsx",
          "kind": "test"
        }
      ],
      "owners": [
        "MartynasZilinskas",
        "theruther4d",
        "Jessidhia",
        "eps1lon"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    },
    {
      "name": "react",
      "kind": "edit",
      "files": [
        {
          "path": "types/react/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/react/test/index.ts",
          "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",
        "Semigradsky"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "peterblazejewicz",
      "date": "2024-01-05T21:26:24.000Z",
      "isMaintainer": true
    }
  ],
  "mainBotCommentID": 1875893828,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Contributor

@peterblazejewicz
Copy link
Member

so those @deprecations were be left there for some time (you don't have any actual plan to remove/replace them, just want people to update source of the mixing, etc). Sorry to bother, I didn't write a line of React code recently (or at least a decent one)

@eps1lon
Copy link
Collaborator Author

eps1lon commented Jan 5, 2024

Everything deprecated will be removed in 19 types. Added it to #64451

Copy link
Member

@peterblazejewicz peterblazejewicz left a comment

Choose a reason for hiding this comment

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

@eps1lon 🙇🏻

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Jan 5, 2024
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Waiting for Author to Merge in New Pull Request Status Board Jan 5, 2024
@typescript-bot
Copy link
Contributor

@eps1lon: Everything looks good here. I am ready to merge this PR (at 2a30f1f) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

@eps1lon
Copy link
Collaborator Author

eps1lon commented Jan 6, 2024

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Jan 6, 2024
@typescript-bot typescript-bot merged commit 619b1da into DefinitelyTyped:master Jan 6, 2024
3 checks passed
@eps1lon eps1lon deleted the feat/react/deprecate-classic branch January 6, 2024 10:27
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical package Edits multiple packages Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants