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 Viewport: Add default options via parameters #28944

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Aug 21, 2024

What I did

Add parameters.viewport.options to have default MINIMAL_VIEWPORTS

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

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

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.3 MB 76.3 MB 0 B -0.24 0%
initSize 169 MB 169 MB 1.07 kB 1.27 0%
diffSize 92.8 MB 92.8 MB 1.07 kB 0.96 0%
buildSize 7.46 MB 7.46 MB 370 B 1.17 0%
buildSbAddonsSize 1.62 MB 1.62 MB 41 B 1.04 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.3 MB 2.3 MB 0 B - 0%
buildSbPreviewSize 351 kB 351 kB 0 B 0.82 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.46 MB 4.46 MB 41 B 0.96 0%
buildPreviewSize 3 MB 3 MB 329 B 1.71 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 20.5s 23.7s 3.2s 1.15 13.7%
generateTime 19.1s 21.2s 2.1s 0.89 10.2%
initTime 16s 17.3s 1.2s -0.13 7.2%
buildTime 11.9s 13.3s 1.4s 0.62 10.8%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 7.4s 8.4s 1s 1.05 12%
devManagerResponsive 5s 5.8s 848ms 1.96 🔺14.4%
devManagerHeaderVisible 905ms 999ms 94ms 1.55 🔺9.4%
devManagerIndexVisible 948ms 1s 85ms 1.48 🔺8.2%
devStoryVisibleUncached 1.3s 1.4s 80ms 0.6 5.4%
devStoryVisible 950ms 1s 84ms 1.49 🔺8.1%
devAutodocsVisible 676ms 951ms 275ms 1.82 🔺28.9%
devMDXVisible 716ms 882ms 166ms 1.12 18.8%
buildManagerHeaderVisible 723ms 701ms -22ms -0.49 -3.1%
buildManagerIndexVisible 725ms 711ms -14ms -0.44 -2%
buildStoryVisible 792ms 952ms 160ms 1.21 16.8%
buildAutodocsVisible 682ms 644ms -38ms -0.7 -5.9%
buildMDXVisible 679ms 800ms 121ms 2.13 🔺15.1%

Greptile Summary

This PR adds default viewport options to the addon-viewport parameters when the viewportStoryGlobals feature is enabled.

  • Added MINIMAL_VIEWPORTS as default options in code/addons/viewport/src/preview.ts when viewportStoryGlobals is enabled
  • Removed default viewport options from code/.storybook/preview.tsx
  • Modified code/addons/viewport/preview.js to export all named exports from './dist/preview'
  • These changes provide predefined viewport sizes out of the box while allowing more flexibility in exports

@ndelangen ndelangen changed the title add default options for addon-viewports via parameters Addon Viewport: add default options for addon-viewports via parameters Aug 21, 2024
@ndelangen ndelangen self-assigned this Aug 21, 2024
@ndelangen ndelangen changed the title Addon Viewport: add default options for addon-viewports via parameters Addon Viewport: Add default options via parameters Aug 21, 2024
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.

LGTM

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

Copy link

nx-cloud bot commented Aug 21, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1a59b66. 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 2 targets

Sent with 💌 from NxCloud.

@ndelangen ndelangen merged commit 1dddc61 into next Aug 22, 2024
61 of 67 checks passed
@ndelangen ndelangen deleted the norbert/viewport-default-values branch August 22, 2024 06:51
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.

1 participant