-
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 that are related to the prop-types
package
#69002
[react] Deprecate types that are related to the prop-types
package
#69002
Conversation
@eps1lon Thank you for submitting this PR! This is a live comment which I will keep updated. 2 packages in this PRCode ReviewsThis PR can be merged once it's reviewed. You can test the changes of this PR in the Playground. Status
Once every item on this list is checked, I'll ask you for permission to merge and publish the changes. InactiveThis PR has been inactive for 7 days. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 69002,
"author": "eps1lon",
"headCommitOid": "575b3a778985459b2191f7b185af999673a84002",
"mergeBaseOid": "b0e683d4a7c4aaa3df73b397dcaa4e80bea25cb6",
"lastPushDate": "2024-03-15T11:17:05.000Z",
"lastActivityDate": "2024-03-18T18:45:21.000Z",
"maintainerBlessed": "Waiting for Code Reviews",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "prop-types",
"kind": "edit",
"files": [
{
"path": "types/prop-types/index.d.ts",
"kind": "definition"
},
{
"path": "types/prop-types/prop-types-tests.ts",
"kind": "test"
}
],
"owners": [
"DovydasNavickas",
"ferdaber",
"eps1lon"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
},
{
"name": "react",
"kind": "edit",
"files": [
{
"path": "types/react/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/ts5.0/index.d.ts",
"kind": "definition"
}
],
"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",
"mattpocock"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [],
"mainBotCommentID": 2000567435,
"ciResult": "pass"
} |
🔔 @DovydasNavickas @ferdaber @johnnyreilly @bbenezech @pzavolinsky @ericanderson @theruther4d @guilhermehubner @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @Jessidhia @saranshkataria @lukyth @zieka @dancerphil @dimitropoulos @disjukr @vhfmag @hellatan @priyanshurav @Semigradsky @mattpocock — please review this PR in the next few days. Be sure to explicitly select |
Landing since nobody seems to have an issue with this. |
React 19 will ignore
.propTypes
which means we no longer have any use for the types related to that.Turns out that we don't even need most of the related types since these are just aliases to
prop-types
types. So if you use runtime validation withprop-types
and TypeScript, you can continue using the relevant types fromprop-types
instead ofreact
.To ease migration, I ported the
WeakValidationMap
type which was introduced in #31280.The following types are deprecated:
WeakValidationMap
ValidationMap
Requireable
Validator
ReactPropTypes
To keep using these types, the following diff is required (can be handled with the
deprecated-react-prop-types-types
codemod):ReactPropTypes
is deprecated without removal. You should pick the relevant validators fromPropTypes
instead.Migration away from the deprecated types within DT is illustrated in #69011 which I'll split out into one PR per package.