Skip to content

[gestalt] Fix tests assuming onDismissStart would be a valid child#58291

Merged
typescript-bot merged 1 commit into
DefinitelyTyped:masterfrom
eps1lon:fix/react-fragment/gestalt
Jan 19, 2022
Merged

[gestalt] Fix tests assuming onDismissStart would be a valid child#58291
typescript-bot merged 1 commit into
DefinitelyTyped:masterfrom
eps1lon:fix/react-fragment/gestalt

Conversation

@eps1lon
Copy link
Copy Markdown
Collaborator

@eps1lon eps1lon commented Jan 18, 2022

We plan to remove {} from ReactFragment since it's not actually an allowed type for children of host components (e.g. <div>{{}}</div> would throw at runtime) (see #56026 for previous attempts).

This change is required to pass #56210

@DangerBotOSS
Copy link
Copy Markdown

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files.
The check for missing properties isn't always right, so take this list as advice, not a requirement.

gestalt (unpkg)

was missing the following properties:

  1. Fragment
  2. jsx
  3. jsxs
  4. Collection
  5. MasonryDefaultLayout
as well as these 3 other properties...

MasonryUniformRowLayout, ScrollFetch, useColorScheme

Generated by 🚫 dangerJS against b5deaca

onDismiss={() => {}}
footer={<Heading>Footer</Heading>}
>
{({ onDismissStart }) => <Heading>Content {onDismissStart}</Heading>}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Can't render a function.

/>;
<Checkbox id={'1'} onChange={() => {}} />;
<Collage columns={1} height={1} renderImage={({ height, index, width }) => () => {}} width={1} />;
<Collage columns={1} height={1} renderImage={({ height, index, width }) => null} width={1} />;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We can't render a function i.e. <div>{() => {}}</div> would throw.

@eps1lon eps1lon marked this pull request as ready for review January 18, 2022 19:47
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Jan 18, 2022

@eps1lon Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and there were no type definition changes, I can help you merge this PR once someone else signs off on it.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners, DT maintainers or others

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": 58291,
  "author": "eps1lon",
  "headCommitOid": "b5deaca99319b48c00cfcc2bda3ac8afd7c1f97f",
  "mergeBaseOid": "c609479376c92be2991c6d072a70201f7e225047",
  "lastPushDate": "2022-01-18T19:28:08.000Z",
  "lastActivityDate": "2022-01-19T05:59:40.000Z",
  "mergeOfferDate": "2022-01-18T20:06:53.000Z",
  "mergeRequestDate": "2022-01-19T05:59:40.000Z",
  "mergeRequestUser": "eps1lon",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Well-liked by everyone",
  "pkgInfo": [
    {
      "name": "gestalt",
      "kind": "edit",
      "files": [
        {
          "path": "types/gestalt/gestalt-tests.tsx",
          "kind": "test"
        }
      ],
      "owners": [
        "serranoarevalo",
        "joshgachnang",
        "calvinchhour",
        "zifahm",
        "k-yle",
        "jimenezff",
        "czgu",
        "keyworks",
        "v4iv",
        "juanjalvarez"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "czgu",
      "date": "2022-01-18T20:06:16.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 1015778082,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @serranoarevalo @joshgachnang @CalvinChhour @zifahm @k-yle @jimenezff @czgu @keyworks @v4iv @juanjalvarez — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner labels Jan 18, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@eps1lon: Everything looks good here. I am ready to merge this PR (at b5deaca) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@serranoarevalo, @joshgachnang, @CalvinChhour, @zifahm, @k-yle, @jimenezff, @czgu, @keyworks, @v4iv, @juanjalvarez: you can do this too.)

@eps1lon
Copy link
Copy Markdown
Collaborator Author

eps1lon commented Jan 19, 2022

Ready to merge

@typescript-bot typescript-bot merged commit 4301437 into DefinitelyTyped:master Jan 19, 2022
@eps1lon eps1lon deleted the fix/react-fragment/gestalt branch January 19, 2022 06:26
martin-badin pushed a commit to martin-badin/DefinitelyTyped that referenced this pull request Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants