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

Vue: Add missing prop controls when using vue-component-meta docgen plugin #28760

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

larsrickert
Copy link
Contributor

@larsrickert larsrickert commented Jul 31, 2024

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.

image

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

  1. Run a sandbox for template, e.g. yarn task --task sandbox --start-from auto --template vue3-vite/default-ts
  2. Open Storybook in your browser
  3. 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 77.4 MB 77.4 MB 12 B 1.89 0%
initSize 162 MB 162 MB 381 kB 3 0.2%
diffSize 84.7 MB 85.1 MB 381 kB 10.5 0.4%
buildSize 7.52 MB 7.52 MB 0 B 1.11 0%
buildSbAddonsSize 1.62 MB 1.62 MB 0 B 1.14 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.34 MB 2.34 MB 0 B 1.11 0%
buildSbPreviewSize 352 kB 352 kB 0 B - 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.51 MB 4.51 MB 0 B 1.11 0%
buildPreviewSize 3.01 MB 3.01 MB 0 B 1.11 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 7.5s 8.4s 902ms -0.79 10.6%
generateTime 22.8s 22.8s 5ms 1.38 0%
initTime 18.1s 19s 989ms 1.35 🔺5.2%
buildTime 11.4s 9.6s -1s -837ms -1.49 🔰-19%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.2s 7.2s 1s 0.15 14.5%
devManagerResponsive 4s 4.5s 450ms -0.08 9.9%
devManagerHeaderVisible 702ms 856ms 154ms 0.27 18%
devManagerIndexVisible 735ms 898ms 163ms 0.27 18.2%
devStoryVisibleUncached 1.1s 1.5s 367ms 0.3 24.1%
devStoryVisible 736ms 899ms 163ms 0.28 18.1%
devAutodocsVisible 616ms 867ms 251ms 0.87 29%
devMDXVisible 667ms 789ms 122ms 0.52 15.5%
buildManagerHeaderVisible 734ms 797ms 63ms 0.47 7.9%
buildManagerIndexVisible 744ms 798ms 54ms 0.14 6.8%
buildStoryVisible 776ms 865ms 89ms 0.58 10.3%
buildAutodocsVisible 630ms 745ms 115ms 0.57 15.4%
buildMDXVisible 639ms 705ms 66ms 0.46 9.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.

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.

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

Copy link

nx-cloud bot commented Jul 31, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 01d1ef2. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@larsrickert larsrickert changed the title Vue: add missing prop controls when using vue-component-meta docgen plugin Vue: Add missing prop controls when using vue-component-meta docgen plugin Jul 31, 2024
@yannbf
Copy link
Member

yannbf commented Aug 5, 2024

@kasperpeulen would you mind taking a look at this once you have the time?

@larsrickert larsrickert force-pushed the larsrickert/fix-missing-prop-controls branch from 7232754 to a923538 Compare August 28, 2024 09:27
@larsrickert
Copy link
Contributor Author

@yannbf @kasperpeulen Hey, is there any estimate when we can release this bug fix? :)

@larsrickert
Copy link
Contributor Author

larsrickert commented Sep 9, 2024

@storybookjs/core Hey guys :) Does someone have time to review and release this bug fix? This is currently a blocker for projects wanting to update to the new Vue version 3.5

Thanks!

Copy link
Contributor

@JReinhold JReinhold left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the code comments.

@kasperpeulen should look too though.

@kasperpeulen
Copy link
Contributor

@larsrickert Sorry, totally missed this because of holidays!

I have enabled auto-merge, so once the lint job is fixed, it should automatically merge. This will get into the 8.3 release.

@larsrickert
Copy link
Contributor Author

@larsrickert Sorry, totally missed this because of holidays!

I have enabled auto-merge, so once the lint job is fixed, it should automatically merge. This will get into the 8.3 release.

@kasperpeulen I hope you had a good vacation!
I fixed the lint issue but it seems like the next branch is protected from updates so the PR is not merged. Could you perhaps take a look at this? :)

@kasperpeulen kasperpeulen merged commit 87bf34c into next Sep 11, 2024
56 checks passed
@kasperpeulen kasperpeulen deleted the larsrickert/fix-missing-prop-controls branch September 11, 2024 09:43
@kasperpeulen
Copy link
Contributor

Thanks, and force merged now!

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

Successfully merging this pull request may close these issues.

4 participants