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: Fix out of memory error when using vue-component-meta for events and slots #28674

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

larsrickert
Copy link
Contributor

@larsrickert larsrickert commented Jul 22, 2024

What I did

Follow up fix for #28589 which already fixed the issue for props and exposes. Based on this comment #28589 (comment) the issue still exists for events.

I extended the fix to also be applied to events and slots

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. In .storybook/main.ts, set the framework.options.docgen option to vue-component-meta
  3. Add new emit (e: 'click2', foo: MouseEvent): void to any Vue component or new slot someSlot(props: { foo?: HTMLElement }): any;
  4. Run build-storybook

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 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.5 MB 76.5 MB 25.6 kB -0.33 0%
initSize 198 MB 198 MB 25.6 kB 0.07 0%
diffSize 121 MB 121 MB 0 B 0.9 0%
buildSize 7.6 MB 7.6 MB 0 B 0.73 0%
buildSbAddonsSize 1.63 MB 1.63 MB 0 B 0.64 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.3 MB 2.3 MB 0 B 0.73 0%
buildSbPreviewSize 349 kB 349 kB 0 B 0.58 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.47 MB 4.47 MB 0 B 0.73 0%
buildPreviewSize 3.12 MB 3.12 MB 0 B 0.5 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 24.5s 25.2s 698ms 1.43 2.8%
generateTime 19.3s 20.8s 1.4s -0.98 7.1%
initTime 19.6s 21s 1.4s -1.2 6.9%
buildTime 13.8s 13.3s -467ms -1.12 -3.5%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 7.3s 8.4s 1s -0.48 12.7%
devManagerResponsive 5.1s 5.5s 408ms -0.49 7.3%
devManagerHeaderVisible 728ms 870ms 142ms -0.07 16.3%
devManagerIndexVisible 733ms 898ms 165ms -0.08 18.4%
devStoryVisibleUncached 1.3s 1.1s -129ms -0.74 -10.8%
devStoryVisible 775ms 920ms 145ms -0.09 15.8%
devAutodocsVisible 624ms 729ms 105ms -0.49 14.4%
devMDXVisible 631ms 773ms 142ms -0.03 18.4%
buildManagerHeaderVisible 751ms 794ms 43ms -0.43 5.4%
buildManagerIndexVisible 759ms 804ms 45ms -0.4 5.6%
buildStoryVisible 797ms 853ms 56ms -0.4 6.6%
buildAutodocsVisible 621ms 711ms 90ms -0.61 12.7%
buildMDXVisible 601ms 730ms 129ms -0.16 17.7%

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.

PR Summary

This pull request extends the previous fix for out-of-memory errors in vue-component-meta to include events and slots, ensuring comprehensive handling of all metadata types.

  • Extended Fix: Updated code/frameworks/vue3-vite/src/plugins/vue-component-meta.ts to handle events and slots, preventing out-of-memory errors.
  • Helper Function: Introduced removeNestedSchemas to encapsulate logic for removing nested schemas.
  • Metadata Handling: Ensured nested schemas are removed from props, events, slots, and exposed properties to reduce build size and memory usage.

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

Copy link

nx-cloud bot commented Jul 22, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 30efa20. 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.

@kasperpeulen kasperpeulen merged commit 8bccace into next Jul 23, 2024
53 of 55 checks passed
@kasperpeulen kasperpeulen deleted the larsrickert/out-of-memory-slots-events branch July 23, 2024 09:08
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.

2 participants