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

[Bug]: 7.0.0-rc.9 Decorators are broken in custom render components #21900

Closed
IanVS opened this issue Apr 4, 2023 · 7 comments · Fixed by #21902
Closed

[Bug]: 7.0.0-rc.9 Decorators are broken in custom render components #21900

IanVS opened this issue Apr 4, 2023 · 7 comments · Fixed by #21902

Comments

@IanVS
Copy link
Member

IanVS commented Apr 4, 2023

Describe the bug

I started to get an error indicating that my react-router decorator was no longer working when I upgraded from rc.5 to 7.0.2. I narrowed it down to starting in rc.9, and have reproduced the issue in a stackblitz, linked below. It seems like decorators are no longer used in some situations, depending on whether arguments are provided to a custom render function.

To Reproduce

https://stackblitz.com/edit/github-ytdmum?file=src%2Fstories%2FPage.stories.tsx&preset=node

System

System:
    OS: macOS 13.2.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 18.12.1 - ~/Library/Caches/fnm_multishells/20832_1680559884027/bin/node
    Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/20832_1680559884027/bin/yarn
    npm: 9.6.3 - ~/Library/Caches/fnm_multishells/20832_1680559884027/bin/npm
  Browsers:
    Firefox: 111.0.1
    Safari: 16.3
  npmPackages:
    @storybook/addon-a11y: 7.0.0-rc.9 => 7.0.0-rc.9
    @storybook/addon-actions: 7.0.0-rc.9 => 7.0.0-rc.9
    @storybook/addon-docs: 7.0.0-rc.9 => 7.0.0-rc.9
    @storybook/addon-essentials: 7.0.0-rc.9 => 7.0.0-rc.9
    @storybook/addon-interactions: 7.0.0-rc.9 => 7.0.0-rc.9
    @storybook/addon-links: 7.0.0-rc.9 => 7.0.0-rc.9
    @storybook/addon-mdx-gfm: ^7.0.0-rc.9 => 7.0.2
    @storybook/addons: 7.0.0-rc.9 => 7.0.0-rc.9
    @storybook/expect: ^27.5.2-0 => 27.5.2-0
    @storybook/jest: 0.0.11-next.0 => 0.0.11-next.0
    @storybook/react: 7.0.0-rc.9 => 7.0.0-rc.9
    @storybook/react-vite: 7.0.0-rc.9 => 7.0.0-rc.9
    @storybook/test-runner: 0.10.0 => 0.10.0
    @storybook/testing-library: 0.0.14-next.1 => 0.0.14-next.1
    @storybook/testing-react: 2.0.0-next.0 => 2.0.0-next.0

Additional context

No response

@shilman
Copy link
Member

shilman commented Apr 4, 2023

There was an intentional breaking change to how we treat decorators in docs in rc.9: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#parametersdocssourceexcludedecorators-defaults-to-true

Can you try setting docs.source.excludeDecorators to false globally in .storybook/preview.js or for the stories that are breaking?

@IanVS
Copy link
Member Author

IanVS commented Apr 4, 2023

@shilman you're right, if I change that parameter it starts to work again. I've updated my reproduction to show it both ways.

@shilman
Copy link
Member

shilman commented Apr 5, 2023

Yee-haw!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.0 containing PR #21902 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb@next upgrade --prerelease

@StraightOuttaCrompton
Copy link

Seems to be related to the MR. The parameters.docs.source.excludeDecorators defaults to true link in https://github.com/storybookjs/storybook/blob/next/MIGRATION.md is dead.

@IanVS
Copy link
Member Author

IanVS commented Apr 5, 2023

@StraightOuttaCrompton yes that change has been reverted by the PR that closed this issue. It has not yet been released to 7.0, but there is a 7.1 alpha version that includes it.

@shilman it looks like the table of contents was not updated in your PR, though, which gives a dead link as noticed above.

@shilman
Copy link
Member

shilman commented Apr 5, 2023

Good catch @IanVS -- fixed

I'll patch this back to 7.0 in 10h or so unless issues are raised against the prerelrease in the meantime.

@shilman
Copy link
Member

shilman commented Apr 12, 2023

Son of a gun!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.3 containing PR #21902 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb@latest upgrade

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

Successfully merging a pull request may close this issue.

4 participants