Skip to content

Addons: Update the Viewport and Background Addon #30841

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

Merged
merged 18 commits into from
Mar 24, 2025

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Mar 18, 2025

What I did

This pull request includes significant changes to the viewport addon in Storybook, focusing on removing legacy code and simplifying the configuration. The most important changes include the removal of the viewportStoryGlobals feature flag, deletion of legacy code, and updates to the configuration and documentation.

Removal of legacy code:

Configuration updates:

Documentation updates:

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-storybook/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>

Greptile Summary

This PR modernizes the Viewport and Background addons by removing legacy implementations and standardizing configuration approaches for both addons.

  • Removes legacy implementations including ViewportToolLegacy, BackgroundSelectorLegacy, and related components, consolidating functionality into modern versions
  • Removes viewportStoryGlobals and backgroundsStoryGlobals feature flags from StorybookConfigRaw, making modern behavior the default
  • Updates type definitions in both addons, replacing Config with specific ViewportParameters and BackgroundsParameters types
  • Introduces simplified "shorthand" syntax for both viewport and background configurations
  • Removes legacy parameter-based test stories in favor of globals-based testing approach

…viewport addon to use modern globals. Clean up related documentation and types.
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

8 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

nx-cloud bot commented Mar 18, 2025

View your CI Pipeline Execution ↗ for commit 991d669.

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

☁️ Nx Cloud last updated this comment at 2025-03-24 13:29:21 UTC

…implify configuration by eliminating backgroundsStoryGlobals feature and related legacy tools. Update documentation accordingly.
@ndelangen ndelangen self-assigned this Mar 18, 2025
@ndelangen ndelangen marked this pull request as ready for review March 18, 2025 14:23
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.

25 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

@ndelangen ndelangen added ci:daily Run the CI jobs that normally run in the daily job. and removed ci:normal labels Mar 18, 2025
…ion for addon viewport and backgrounds, and adjust formatting for consistency.
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Looks good except for one nitpick!

Copy link
Contributor

github-actions bot commented Mar 20, 2025

Fails
🚫 PR is marked with "BREAKING CHANGE" label.

Generated by 🚫 dangerJS against 991d669

@valentinpalkovic valentinpalkovic removed the maintenance User-facing maintenance tasks label Mar 24, 2025
@ndelangen ndelangen merged commit 2bf6c27 into next Mar 24, 2025
5 of 6 checks passed
@ndelangen ndelangen deleted the norbert/viewport-background-addon branch March 24, 2025 13:24
@github-actions github-actions bot mentioned this pull request Mar 24, 2025
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: backgrounds addon: viewport BREAKING CHANGE ci:daily Run the CI jobs that normally run in the daily job.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants