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][react-is] Move experimental APIs to stable for React 18 #61634

Closed

Conversation

steinybot
Copy link

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.

@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 10, 2022

@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 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 failed
  • 🕐 A DT maintainer needs to approve changes which affect more than one package

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"
}

@typescript-bot
Copy link
Contributor

@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Aug 10, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Aug 10, 2022
@typescript-bot
Copy link
Contributor

@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.

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Aug 10, 2022
@typescript-bot typescript-bot moved this from Needs Author Action to Waiting for Code Reviews in New Pull Request Status Board Aug 10, 2022
@typescript-bot typescript-bot added the The CI failed When GH Actions fails label Aug 10, 2022
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Author Action in New Pull Request Status Board Aug 10, 2022
@typescript-bot
Copy link
Contributor

@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.

@typescript-bot typescript-bot added Where is GH Actions? GH Actions didn't give a response to this PR and removed The CI failed When GH Actions fails labels Aug 10, 2022
@typescript-bot typescript-bot moved this from Needs Author Action to Other in New Pull Request Status Board Aug 10, 2022
@@ -0,0 +1,31 @@
{
Copy link
Author

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/*"]
Copy link
Author

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;
Copy link
Author

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
Copy link
Author

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>;
| {
Copy link
Author

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';
Copy link
Author

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',
Copy link
Author

Choose a reason for hiding this comment

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

Everything below is formatting.

@typescript-bot typescript-bot added The CI failed When GH Actions fails and removed Where is GH Actions? GH Actions didn't give a response to this PR labels Aug 10, 2022
@typescript-bot typescript-bot moved this from Other to Needs Author Action in New Pull Request Status Board Aug 10, 2022
@typescript-bot
Copy link
Contributor

@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.

Copy link
Collaborator

@eps1lon eps1lon left a 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>;
Copy link
Collaborator

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

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Aug 10, 2022
@typescript-bot
Copy link
Contributor

@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!

@steinybot
Copy link
Author

I thought changing react would break react-is but it is just the /// <reference that won't be 100%.

react PR here: #61649

@steinybot steinybot closed this Aug 10, 2022
@typescript-bot typescript-bot removed this from Needs Author Action in New Pull Request Status Board Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical package Edits multiple packages Revision needed This PR needs code changes before it can be merged. The CI failed When GH Actions fails
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants