-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
[react] Deprecate types related to classic components in favor of types from create-react-class #68091
Conversation
…es from create-react-class
9b032cf
to
2a30f1f
Compare
render() { | ||
return DOM.div(this.props.text); | ||
}, | ||
}); | ||
|
||
// React.createFactory |
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.
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 Thank you for submitting this PR! This is a live comment which I will keep updated. 3 packages in this PR
Code ReviewsBecause 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
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"
} |
🔔 @jgoz @MartynasZilinskas @theruther4d @Jessidhia @johnnyreilly @bbenezech @pzavolinsky @ericanderson @DovydasNavickas @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @saranshkataria @lukyth @zieka @dancerphil @dimitropoulos @disjukr @vhfmag @hellatan @priyanshurav @Semigradsky — please review this PR in the next few days. Be sure to explicitly select |
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) |
Everything deprecated will be removed in 19 types. Added it to #64451 |
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.
@eps1lon 🙇🏻
@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:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ |
Ready to merge |
The "classic component" notion is only relevant for
create-react-class
. Therefore, its types should live there instead of bloating types inreact
. This PR deprecates:React.ClassicElement<Props>
(usecreateReactClass.ComponentElement<Props, InstanceType<T>>
React.ClassicComponentClass
(usecreateReactClass.ClassicComponentClass
)React.ClassicComponent
(usecreateClass.ClassicComponent
)React.Mixin
andReact.ComponentSpec
intocreate-react-class
that actually uses these types. Addons will usecreateReactClass.ComponentSpec
going forward instead of the deprecatedReact.ComponentSpec