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

Addon Docs: Make new code panel opt in #30248

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

shilman
Copy link
Member

@shilman shilman commented Jan 12, 2025

Closes N/A

What I did

There are some open questions about the new code panel. Since we don't have time to address them before 8.5, making the panel opt in instead of opt out for now.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

  • Run a storybook on the branch/canary and observe no Code panel by default
  • Set the docs.codePanel parameter to true and observe the Code panel when you restart your storybook.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.8 MB 77.8 MB 0 B 1.97 0%
initSize 131 MB 131 MB -18.9 kB 0.36 0%
diffSize 53 MB 52.9 MB -18.9 kB -38.14 0%
buildSize 7.19 MB 7.19 MB -31 B 0.17 0%
buildSbAddonsSize 1.85 MB 1.85 MB -30 B -Infinity 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.87 MB 1.87 MB -1 B -0.61 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.91 MB 3.91 MB -31 B -8.94 0%
buildPreviewSize 3.28 MB 3.28 MB 0 B 0.58 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 6.8s 25.9s 19s 1.28 🔺73.5%
generateTime 20.9s 19.9s -1s -36ms -0.7 -5.2%
initTime 14.2s 13s -1s -185ms -1 -9.1%
buildTime 10.7s 10.6s -131ms 1.02 -1.2%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5s 5.6s 586ms 1.74 🔺10.3%
devManagerResponsive 3.9s 4.2s 337ms 2.27 🔺7.8%
devManagerHeaderVisible 647ms 708ms 61ms 1.33 🔺8.6%
devManagerIndexVisible 724ms 739ms 15ms 1.08 2%
devStoryVisibleUncached 1.9s 2.2s 262ms 1.05 11.9%
devStoryVisible 722ms 740ms 18ms 1.05 2.4%
devAutodocsVisible 525ms 660ms 135ms 1.51 🔺20.5%
devMDXVisible 522ms 632ms 110ms 1.37 🔺17.4%
buildManagerHeaderVisible 571ms 761ms 190ms 1.51 🔺25%
buildManagerIndexVisible 656ms 892ms 236ms 1.88 🔺26.5%
buildStoryVisible 553ms 737ms 184ms 1.8 🔺25%
buildAutodocsVisible 435ms 601ms 166ms 2.33 🔺27.6%
buildMDXVisible 448ms 568ms 120ms 1.7 🔺21.1%

Greptile Summary

Makes the code panel in Storybook docs addon opt-in rather than opt-out by default, requiring explicit enablement through the docs.codePanel parameter.

  • Changed disabled logic in code/addons/docs/src/manager.tsx to disable panel by default
  • Panel can be enabled via parameters.docs.codePanel = true
  • Replaces previous Storysource addon functionality
  • Configurable at both global and story level

@shilman shilman added maintenance User-facing maintenance tasks addon: docs ci:normal labels Jan 12, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

parameters[PARAM_KEY].codePanel === false
);
},
disabled: (parameters) => !!parameters?.docs?.codePanel,
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: This logic is incorrect - it disables the panel when codePanel is true, which is the opposite of what the documentation suggests. Should be !parameters?.docs?.codePanel to disable when false/undefined.

Copy link

nx-cloud bot commented Jan 12, 2025

View your CI Pipeline Execution ↗ for commit 523f051.

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 1m 37s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-13 08:46:10 UTC

@storybook-pr-benchmarking
Copy link

storybook-pr-benchmarking bot commented Jan 12, 2025

Package Benchmarks

Commit: 523f051, ran on 13 January 2025 at 08:53:39 UTC

The following packages have significant changes to their size or dependencies:

@storybook/addon-a11y

Before After Difference
Dependency count 59 59 0
Self size 410 KB 228 KB 🎉 -183 KB 🎉
Dependency size 13.46 MB 13.46 MB 0 B
Bundle Size Analyzer Link Link

@storybook/addon-essentials

Before After Difference
Dependency count 36 36 0
Self size 17 KB 12 KB 🎉 -4 KB 🎉
Dependency size 13.83 MB 13.83 MB 🎉 -160 B 🎉
Bundle Size Analyzer Link Link

@storybook/addon-mdx-gfm

Before After Difference
Dependency count 69 69 0
Self size 4 KB 3 KB 🎉 -1 KB 🎉
Dependency size 2.41 MB 2.41 MB 0 B
Bundle Size Analyzer Link Link

@shilman shilman force-pushed the shilman/docs-disable-codepanel branch from 97c64f7 to b451851 Compare January 12, 2025 15:04
@valentinpalkovic valentinpalkovic merged commit 909605c into next Jan 13, 2025
56 of 60 checks passed
@valentinpalkovic valentinpalkovic deleted the shilman/docs-disable-codepanel branch January 13, 2025 09:22
@valentinpalkovic valentinpalkovic changed the title Addon-docs: Make new code panel opt in Addon Docs: Make new code panel opt in Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: docs ci:normal maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants