-
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] Add JSX namespace to React namespace #64464
[react] Add JSX namespace to React namespace #64464
Conversation
0e1d93a
to
9da1d85
Compare
b53ab5c
to
6607992
Compare
27c0b47
to
0181198
Compare
Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files. react (unpkg)was missing the following properties:
|
@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": 64464,
"author": "eps1lon",
"headCommitOid": "3dea0576b786da0267a9a890926d86aa62aa435f",
"mergeBaseOid": "1e4da9b225c67b2b14ecbcaf90da63c0a193f5d2",
"lastPushDate": "2023-04-28T18:42:03.000Z",
"lastActivityDate": "2023-05-06T11:15:12.000Z",
"maintainerBlessed": "Waiting for Code Reviews",
"hasMergeConflict": false,
"isFirstContribution": false,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "react-blessed",
"kind": "edit",
"files": [
{
"path": "types/react-blessed/index.d.ts",
"kind": "definition"
},
{
"path": "types/react-blessed/react-blessed-tests.tsx",
"kind": "test"
}
],
"owners": [
"guoshencheng",
"defnotrobbie"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Well-liked by everyone"
},
{
"name": "react",
"kind": "edit",
"files": [
{
"path": "types/react/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/jsx-dev-runtime.d.ts",
"kind": "definition"
},
{
"path": "types/react/jsx-runtime.d.ts",
"kind": "definition"
},
{
"path": "types/react/test/tsx.tsx",
"kind": "test"
},
{
"path": "types/react/ts5.0/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/ts5.0/jsx-dev-runtime.d.ts",
"kind": "definition"
},
{
"path": "types/react/ts5.0/jsx-runtime.d.ts",
"kind": "definition"
},
{
"path": "types/react/ts5.0/test/tsx.tsx",
"kind": "test"
},
{
"path": "types/react/v15/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/v15/test/tsx.tsx",
"kind": "test"
},
{
"path": "types/react/v16/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/v16/test/tsx.tsx",
"kind": "test"
},
{
"path": "types/react/v17/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/v17/test/tsx.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",
"Semigradsky"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "Andarist",
"date": "2023-05-06T11:15:12.000Z",
"isMaintainer": false
}
],
"mainBotCommentID": 1502029944,
"ciResult": "pass"
} |
🔔 @guoshencheng @defnotrobbie @johnnyreilly @bbenezech @pzavolinsky @ericanderson @DovydasNavickas @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @Jessidhia @saranshkataria @lukyth @zieka @dancerphil @dimitropoulos @disjukr @vhfmag @hellatan @priyanshurav @Semigradsky — please review this PR in the next few days. Be sure to explicitly select |
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.
react-blessed relied on a scoped namespace not existing. It wasn't actually using module augmentation. The changes are required to make it work with actual module augmentation since React now has a scoped JSX namespace
Re-ping @guoshencheng, @defnotrobbie, @johnnyreilly, @bbenezech, @pzavolinsky, @ericanderson, @DovydasNavickas, @theruther4d, @guilhermehubner, @ferdaber, @jrakotoharisoa, @pascaloliv, @Hotell, @franklixuefei, @Jessidhia, @saranshkataria, @lukyth, @zieka, @dancerphil, @dimitropoulos, @disjukr, @vhfmag, @hellatan, @priyanshurav, @Semigradsky: This PR has been out for over a week, yet I haven't seen any reviews. Could someone please give it some attention? Thanks! |
0181198
to
d6b72cf
Compare
This allows referring to JSX namespace as
React.JSX
instead of assuming a globalJSX
namespace. Module augmentations of the global namespace flow into the scoped namespace i.e. should still work like before.This deprecates the global
JSX
namespace..In code:
These diffs will work on all latest major types versions e.g. freshly installed
@types/react@latest
,@types/react@^17.0.0
etc.In a future major we'll drop the global namespace.
Potential breaking changes
If you added a
JSX
namespace tomodule "react"
you need to make sure this augmentation passes declaration merging i.e. just adds properties to theJSX
namespace.We don't consider these breaking changes under SemVer i.e. don't warrant a major release.
Otherwise each interface or type we add to React would warrant a major release.
Closes #52321
TODO: