storybookjs/storybook

[Bug]: SB v8 beta empty source code (disable on purpose) in not working as in v7

Open

#26.193 aberto em 26 de fev. de 2024

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (10.058 forks)batch import
block: sourcebughelp wantedsev:S3upgrade:8.x

Métricas do repositório

Stars
 (89.909 stars)
Métricas de merge de PR
 (Mesclagem média 7d 22h) (184 fundiu PRs em 30d)

Description

Describe the bug

In v7 we could override the source parameter to disable code in Doc pages.

CScreenshot 2024-02-26 at 11 03 54@2x

Example is also here.

In the latest v8 beta 8.0.0-beta.5, the source code of null results in a clickable Show Code button that displays effectively nothing.

https://github.com/storybookjs/storybook/assets/12672541/b3384464-e057-4c92-9f7e-0c2d421844ec

To Reproduce

A reproduction repo is here generated by npx storybook@next sandbox: https://github.com/konsalex/sb-null-source-code/blob/main/src/stories/Button.stories.ts#L12

System

Storybook Environment Info:

  System:
    OS: macOS 14.3.1
    CPU: (10) x64 Apple M1 Max
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.7.0 - ~/Library/Caches/fnm_multishells/9693_1708939965986/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn <----- active
    npm: 10.1.0 - ~/Library/Caches/fnm_multishells/9693_1708939965986/bin/npm
    pnpm: 8.6.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 121.0.6167.184
    Safari: 17.3.1
  npmPackages:
    @storybook/addon-essentials: ^8.0.0-beta.5 => 8.0.0-beta.5
    @storybook/addon-interactions: ^8.0.0-beta.5 => 8.0.0-beta.5
    @storybook/addon-links: ^8.0.0-beta.5 => 8.0.0-beta.5
    @storybook/addon-onboarding: ^1.0.11 => 1.0.11
    @storybook/blocks: ^8.0.0-beta.5 => 8.0.0-beta.5
    @storybook/react: ^8.0.0-beta.5 => 8.0.0-beta.5
    @storybook/react-vite: ^8.0.0-beta.5 => 8.0.0-beta.5
    @storybook/test: ^8.0.0-beta.5 => 8.0.0-beta.5
    storybook: ^8.0.0-beta.5 => 8.0.0-beta.5

Additional context

No response

Guia do colaborador