storybook
storybook copied to clipboard
Vue: Add missing prop controls when using `vue-component-meta` docgen plugin
What I did
Follow up fix for #28589 and #28674 which caused missing prop controls for enum types (e.g. booleans or "small" | "medium"
etc in the current 8.3.0-alpha.3
version.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
- [x] stories
- [ ] unit tests
- [ ] integration tests
- [ ] end-to-end tests
Manual testing
- Run a sandbox for template, e.g.
yarn task --task sandbox --start-from auto --template vue3-vite/default-ts
- Open Storybook in your browser
- Access http://localhost:6006/?path=/docs/example-button--docs
🦋 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 | 76.4 MB | 76.4 MB | 0 B | 1.3 | 0% |
initSize | 198 MB | 198 MB | 0 B | 1.1 | 0% |
diffSize | 122 MB | 122 MB | 0 B | 1.04 | 0% |
buildSize | 7.6 MB | 7.6 MB | 0 B | 1.36 | 0% |
buildSbAddonsSize | 1.63 MB | 1.63 MB | 0 B | 1.22 | 0% |
buildSbCommonSize | 195 kB | 195 kB | 0 B | - | 0% |
buildSbManagerSize | 2.3 MB | 2.3 MB | 0 B | - | 0% |
buildSbPreviewSize | 349 kB | 349 kB | 0 B | - | 0% |
buildStaticSize | 0 B | 0 B | 0 B | - | - |
buildPrebuildSize | 4.47 MB | 4.47 MB | 0 B | 1.22 | 0% |
buildPreviewSize | 3.12 MB | 3.12 MB | 0 B | 1.36 | 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 | 16.2s | 6.1s | -10s -165ms | -1.28 | 🔰-166% |
generateTime | 20.8s | 19.6s | -1s -257ms | -1.41 | 🔰-6.4% |
initTime | 22.1s | 20.2s | -1s -893ms | -1.53 | 🔰-9.3% |
buildTime | 14.5s | 13.5s | -1s -54ms | -1.08 | -7.8% |
testBuildTime | 0ms | 0ms | 0ms | - | - |
devPreviewResponsive | 7.7s | 9.6s | 1.8s | 0.1 | 19.6% |
devManagerResponsive | 5.2s | 6.1s | 879ms | 0.04 | 14.3% |
devManagerHeaderVisible | 804ms | 781ms | -23ms | -0.75 | -2.9% |
devManagerIndexVisible | 841ms | 791ms | -50ms | -0.87 | -6.3% |
devStoryVisibleUncached | 966ms | 1.6s | 679ms | 0.67 | 41.3% |
devStoryVisible | 859ms | 855ms | -4ms | -0.64 | -0.5% |
devAutodocsVisible | 780ms | 723ms | -57ms | -0.85 | -7.9% |
devMDXVisible | 863ms | 768ms | -95ms | -0.04 | -12.4% |
buildManagerHeaderVisible | 803ms | 920ms | 117ms | 0.58 | 12.7% |
buildManagerIndexVisible | 805ms | 931ms | 126ms | 0.6 | 13.5% |
buildStoryVisible | 859ms | 983ms | 124ms | 0.58 | 12.6% |
buildAutodocsVisible | 923ms | 815ms | -108ms | 0.2 | -13.3% |
buildMDXVisible | 706ms | 797ms | 91ms | 0.38 | 11.4% |
Greptile Summary
This pull request addresses missing prop controls for enum types in Vue components when using the vue-component-meta
docgen plugin.
- Modified
code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts
to retain nested schemas for enum entries, ensuring prop controls are displayed correctly. - Added safeguards to remove nested schemas for other types to prevent performance bottlenecks and potential memory issues.
- Ensured that the changes are covered by automated tests and provided steps for manual testing.