storybookjs/storybook

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

开放

#26,193 创建于 2024年2月26日

 (0 条评论) (0 个反应) (0 位负责人)TypeScript (10,058 个派生)batch import
block: sourcebughelp wantedsev:S3upgrade:8.x

仓库指标

星标
 (89,909 个星标)
PR 合并指标
 (平均合并 7天 22小时) (30 天内合并 184 个 PR)

描述

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

贡献者指南