Skip to content

[docs] Increased support for TS types -> props table/docgen#6000

Merged
chandlerprall merged 1 commit intoelastic:mainfrom
chandlerprall:bug/props-from-ts-type
Jun 27, 2022
Merged

[docs] Increased support for TS types -> props table/docgen#6000
chandlerprall merged 1 commit intoelastic:mainfrom
chandlerprall:bug/props-from-ts-type

Conversation

@chandlerprall
Copy link
Copy Markdown
Contributor

Summary

This started by looking at why EuiPopoverPanelProps were not showing in the props table in #5977. Turns out the code for TS->docgen was limited to a very specific type def. This PR adds support for basic types and a fallback to use whatever TS gives us in other cases.

It doesn't solve EuiPopoverPanelProps in a great way,

Screen Shot 2022-06-24 at 2 05 10 PM

but at least it shows up now and aligns with how other complex types are displayed. The basic type handling does include meaningful details,

type FooProps = {
  foo: string;
  bar?: number;
}

Screen Shot 2022-06-24 at 2 05 05 PM

Checklist

- [ ] Checked in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in Chrome, Safari, Edge, and Firefox

  • Props have proper autodocs and playground toggles
    - [ ] Added documentation
    - [ ] Checked Code Sandbox works for any docs examples
    - [ ] Added or updated jest and cypress tests
    - [ ] Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
    - [ ] Updated the Figma library counterpart
    - [ ] A changelog entry exists and is marked appropriately

@chandlerprall chandlerprall requested a review from thompsongl June 24, 2022 20:39
@chandlerprall chandlerprall added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Jun 24, 2022
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_6000/

Copy link
Copy Markdown
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

Awesome! Tested locally with a few different type and interface shapes

@thompsongl thompsongl mentioned this pull request Jun 27, 2022
4 tasks
@chandlerprall chandlerprall merged commit 90172cf into elastic:main Jun 27, 2022
@chandlerprall chandlerprall deleted the bug/props-from-ts-type branch June 27, 2022 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants