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

DOCS: Fix changes to property output from source #11840

Closed
IgorSzyporyn opened this issue Aug 8, 2020 · 2 comments
Closed

DOCS: Fix changes to property output from source #11840

IgorSzyporyn opened this issue Aug 8, 2020 · 2 comments

Comments

@IgorSzyporyn
Copy link
Contributor

IgorSzyporyn commented Aug 8, 2020

Describe the bug
The new feature with removing pipes to present property types in a tag is a breaking change and will mangle function types as example

To Reproduce
Steps to reproduce the behavior:

  1. Open any story that has an arrow function call as a property type
  2. Click on Docs
  3. Scroll down to description for this property
  4. See error: (here using example for ref property in SvgIconProps from material ui)
    ((instance: SVGSVGElement null) => void)
    RefObject<SVGSVGElement> null

Expected behavior
Expected to see: (here again using example for ref property in SvgIconProps from material ui)
((instance: SVGSVGElement | null) => void) React.RefObject<SVGSVGElement> null undefined

Screenshots
Capture

System:
OS: Windows 10 10.0.19041
CPU: (4) x64 Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz
Binaries:
Node: 12.13.1 - C:\Program Files\nodejs\node.EXE
npm: 6.13.1 - ~\AppData\Roaming\npm\npm.CMD
Browsers:
Chrome: 84.0.4147.105
Edge: Spartan (44.19041.1.0)
npmPackages:
@storybook/addon-a11y: next => 6.0.0-rc.29
@storybook/addon-essentials: next => 6.0.0-rc.29
@storybook/addon-knobs: next => 6.0.0-rc.29
@storybook/addons: next => 6.0.0-rc.29
@storybook/api: next => 6.0.0-rc.29
@storybook/cli: next => 6.0.0-rc.29
@storybook/components: next => 6.0.0-rc.29
@storybook/core: next => 6.0.0-rc.29
@storybook/core-events: next => 6.0.0-rc.29
@storybook/react: next => 6.0.0-rc.29
@storybook/theming: next => 6.0.0-rc.29

@IgorSzyporyn IgorSzyporyn changed the title Undo changes to property output from source DOCS: Undo changes to property output from source Aug 8, 2020
@IgorSzyporyn IgorSzyporyn changed the title DOCS: Undo changes to property output from source DOCS: Fix changes to property output from source Aug 8, 2020
@IgorSzyporyn
Copy link
Contributor Author

Think I found the problem and solution

In the file: addons/docs/src/frameworks/angular/compodoc.ts
In the function: extractTypeFromValue (line 106)
Change: const valueType = typeof defaultValue into const valueType = typeof(defaultValue) (line 107)

In the file: addons/docs/src/frameworks/react/lib/defaultValues/createFromRawDefaultProp.ts
In the function: createDefaultValueFromRawDefaultProp (line 167)
Change: switch (typeof rawDefaultProp) { into switch (typeof(rawDefaultProp)) { (line 174)

Seems to be the only places - can it be right this is only supported for Angular and React?

@shilman
Copy link
Member

shilman commented Aug 28, 2020

Whoopee!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.20 containing PR #11868 that references this issue. Upgrade today to try it out!

Closing this issue. Please re-open if you think there's still more to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants