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][react-is] Move experimental APIs to stable for React 18 #61634
Conversation
@steinybot Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. This is a live comment which I will keep updated. 2 packages in this PRCode 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
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": 61634,
"author": "steinybot",
"headCommitOid": "78c95c7e1bcad744140249c4135ce5d3e791ea2f",
"mergeBaseOid": "2d2f21e4ef13e725c7e1565fd8661d5389261c72",
"lastPushDate": "2022-08-10T01:11:41.000Z",
"lastActivityDate": "2022-08-10T16:21:49.000Z",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Critical",
"pkgInfo": [
{
"name": "react-is",
"kind": "edit",
"files": [
{
"path": "types/react-is/index.d.ts",
"kind": "definition"
},
{
"path": "types/react-is/test/react-is-tests.tsx",
"kind": "test"
},
{
"path": "types/react-is/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/react-is/v16/index.d.ts",
"kind": "definition"
},
{
"path": "types/react-is/v17/index.d.ts",
"kind": "definition"
},
{
"path": "types/react-is/v17/next.d.ts",
"kind": "definition"
},
{
"path": "types/react-is/v17/test/next-tests.tsx",
"kind": "test"
},
{
"path": "types/react-is/v17/test/react-is-tests.tsx",
"kind": "test"
},
{
"path": "types/react-is/v17/tsconfig.json",
"kind": "package-meta-ok"
},
{
"path": "types/react-is/v17/tslint.json",
"kind": "package-meta-ok"
}
],
"owners": [
"AviVahl",
"christianchown",
"eps1lon"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
},
{
"name": "react",
"kind": "edit",
"files": [
{
"path": "types/react/experimental.d.ts",
"kind": "definition"
},
{
"path": "types/react/global.d.ts",
"kind": "definition"
},
{
"path": "types/react/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/test/experimental.tsx",
"kind": "test"
},
{
"path": "types/react/test/index.ts",
"kind": "test"
},
{
"path": "types/react/test/tsx.tsx",
"kind": "test"
},
{
"path": "types/react/v15/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/v15/test/index.ts",
"kind": "test"
},
{
"path": "types/react/v16/global.d.ts",
"kind": "definition"
},
{
"path": "types/react/v16/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/v16/test/index.ts",
"kind": "test"
},
{
"path": "types/react/v17/global.d.ts",
"kind": "definition"
},
{
"path": "types/react/v17/index.d.ts",
"kind": "definition"
},
{
"path": "types/react/v17/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"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Critical"
}
],
"reviews": [
{
"type": "changereq",
"reviewer": "eps1lon",
"date": "2022-08-10T16:21:49.000Z"
}
],
"mainBotCommentID": 1210030351,
"ciResult": "fail",
"ciUrl": "https://github.com/DefinitelyTyped/DefinitelyTyped/commit/78c95c7e1bcad744140249c4135ce5d3e791ea2f/checks?check_suite_id=7743669136"
} |
🔔 @AviVahl @christianchown @eps1lon @johnnyreilly @bbenezech @pzavolinsky @ericanderson @DovydasNavickas @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @Jessidhia @saranshkataria @lukyth @zieka @dancerphil @dimitropoulos @disjukr @vhfmag @hellatan @priyanshurav — please review this PR in the next few days. Be sure to explicitly select |
@steinybot The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review. |
@steinybot The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review. |
@@ -0,0 +1,31 @@ | |||
{ |
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 copied this from v16.
"paths": { | ||
"react": ["react/v17"], | ||
"react-dom": ["react-dom/v17"], | ||
"react-is/*": ["react-is/v17/*"] |
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 don't know why this is different to v16 but I did what the build told me to do.
@@ -33,6 +24,7 @@ export function isProfiler(value: any): value is ReactElement; | |||
export function isPortal(value: any): value is ReactElement; | |||
export function isStrictMode(value: any): value is ReactElement; | |||
export function isSuspense(value: any): value is ReactElement; | |||
export function isSuspenseList(value: any): value is ReactElement; |
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.
Copied from types/react-is/v17/next.d.ts
|
||
// SuspenseList | ||
ReactIs.isSuspenseList(<React.SuspenseList children={<div />} />); // true | ||
ReactIs.typeOf(<React.SuspenseList children={<div />} />) === ReactIs.SuspenseList; // true |
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.
Copied from types/react-is/v17/test/next-tests.tsx
[K in keyof JSX.IntrinsicElements]: P extends JSX.IntrinsicElements[K] ? K : never | ||
}[keyof JSX.IntrinsicElements] | | ||
ComponentType<P>; | ||
| { |
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.
Most of this is formatting changes.
@@ -398,14 +426,70 @@ declare namespace React { | |||
} | |||
|
|||
const Suspense: ExoticComponent<SuspenseProps>; | |||
|
|||
export type SuspenseListRevealOrder = 'forwards' | 'backwards' | 'together'; |
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.
Copied from types/react/experimental.d.ts
const version: string; | ||
|
||
/** | ||
* {@link https://reactjs.org/docs/profiler.html#onrender-callback Profiler API} | ||
*/ | ||
type ProfilerOnRenderCallback = ( | ||
id: string, | ||
phase: "mount" | "update", | ||
phase: 'mount' | 'update', |
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.
Everything below is formatting.
@steinybot The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review. |
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.
Can we separate this into PRs for each package to understand more what the motivation is? react-is
needs a bump fro 18 as far as I understand but the changes to react
seem wrong.
Also: Please file this without the formatting changes so that git-blame
is unaffected. In the future this repository will be formatted automatically but until then these spurious formatting changes make reviewing needlessly hard.
* @see https://reactjs.org/docs/concurrent-mode-reference.html#suspenselist | ||
* @see https://reactjs.org/docs/concurrent-mode-patterns.html#suspenselist | ||
*/ | ||
export const SuspenseList: ExoticComponent<SuspenseListProps>; |
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.
SuspenseList is not part of the stable release
@steinybot 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! |
I thought changing react would break react-is but it is just the react PR here: #61649 |
Please fill in this template.
npm test <package to test>
.Select one of these and delete the others:
If changing an existing definition: