Skip to content

Core: Export BROWSER_TARGETS and NODE_TARGET for addon-kit #31584

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

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

Sidnioulz
Copy link
Member

@Sidnioulz Sidnioulz commented May 27, 2025

No linked issue. This would prevent further desync between addon-kit's targets and Storybook's, as it seems we've forgotten to update the addon-kit side in both SB 8 and SB 9.

What I did

Re-exported targets from the only public-facing package I could find that uses them. A better place would likely need to be found.

Checklist for Contributors

Testing

Note

Not relevant.

Documentation

Note

Maybe not relevant as this is provided/consumed via addon-kit and I could not find any issue from end users wanting to know SB's browser targets.

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 re-exports BROWSER_TARGETS and NODE_TARGET constants from the builder-manager to prevent version desynchronization between Storybook and addon-kit.

  • Inconsistent handling in code/core/src/builder-manager/index.ts: BROWSER_TARGETS is both imported and re-exported while NODE_TARGET is only re-exported
  • Re-export placement between imports and code in builder-manager breaks conventional code organization
  • Consider moving exports to a more appropriate public-facing location for better maintainability

@Sidnioulz Sidnioulz added api: addons build Internal-facing build tooling & test updates ci:normal labels May 27, 2025
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

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

Copy link

nx-cloud bot commented May 27, 2025

View your CI Pipeline Execution ↗ for commit f579269.

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

☁️ Nx Cloud last updated this comment at 2025-05-27 15:51:32 UTC

@storybook-pr-benchmarking
Copy link

Package Benchmarks

Commit: f579269, ran on 27 May 2025 at 15:57:12 UTC

The following packages have significant changes to their size or dependencies:

storybook

Before After Difference
Dependency count 49 49 0
Self size 31.37 MB 31.39 MB 🚨 +17 KB 🚨
Dependency size 17.41 MB 17.41 MB 0 B
Bundle Size Analyzer Link Link

sb

Before After Difference
Dependency count 50 50 0
Self size 1 KB 1 KB 0 B
Dependency size 48.78 MB 48.79 MB 🚨 +17 KB 🚨
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 324 324 0
Self size 243 KB 243 KB 🎉 -227 B 🎉
Dependency size 97.39 MB 97.41 MB 🚨 +19 KB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 267 267 0
Self size 31 KB 31 KB 0 B
Dependency size 81.79 MB 81.81 MB 🚨 +19 KB 🚨
Bundle Size Analyzer Link Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: addons build Internal-facing build tooling & test updates ci:normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant