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

React: Fix missing peer dependency #30371

Open
wants to merge 5 commits into
base: next
Choose a base branch
from

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Jan 24, 2025

Closes #30306

What I did

  • @storybook/preset-react-webpack has a dependency requirement on @storybook/react, which defines @storybook/test as a peer-dependency. @storybook/preset-react-webpack has broken the peer-dependency requirement chain by not listing it as a peer-dependency. This led to errors during upgrades.
  • @storybook/react-vite had a missing peer dependency requirement on typescript.
  • removed obsolete dependencies

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 pull request has been released as version 0.0.0-pr-30371-sha-07dc4675. Try it out in a new sandbox by running npx [email protected] sandbox or in an existing project with npx [email protected] upgrade.

More information
Published version 0.0.0-pr-30371-sha-07dc4675
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/fix-missing-peer-dependency
Commit 07dc4675
Datetime Fri Jan 24 13:36:47 UTC 2025 (1737725807)
Workflow run 12950726304

To request a new release of this pull request, mention the @storybookjs/core team.

core team members can create a new canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=30371

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 80.6 MB 80.6 MB 0 B 1.53 0%
initSize 80.6 MB 80.6 MB 0 B 1.53 0%
diffSize 97 B 97 B 0 B - 0%
buildSize 7.31 MB 7.31 MB 0 B 0.59 0%
buildSbAddonsSize 1.9 MB 1.9 MB 0 B 0.53 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 0.6 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.97 MB 3.97 MB 0 B 0.53 0%
buildPreviewSize 3.34 MB 3.34 MB 0 B 0.62 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.1s 7.1s 7ms -1.16 0.1%
generateTime 18.1s 19.2s 1s -0.44 5.4%
initTime 4.1s 4.8s 690ms 0.9 14.2%
buildTime 8.1s 8.5s 373ms -0.76 4.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5s 5.9s 924ms 0.4 15.4%
devManagerResponsive 3.7s 4.9s 1.1s 0.94 23%
devManagerHeaderVisible 700ms 648ms -52ms -1.15 -8%
devManagerIndexVisible 751ms 658ms -93ms -1.29 🔰-14.1%
devStoryVisibleUncached 3.2s 3.6s 419ms 0.21 11.5%
devStoryVisible 771ms 676ms -95ms -1.32 🔰-14.1%
devAutodocsVisible 699ms 656ms -43ms -1.06 -6.6%
devMDXVisible 662ms 644ms -18ms -1.1 -2.8%
buildManagerHeaderVisible 716ms 744ms 28ms -0.54 3.8%
buildManagerIndexVisible 723ms 799ms 76ms -0.52 9.5%
buildStoryVisible 662ms 731ms 69ms -0.42 9.4%
buildAutodocsVisible 623ms 523ms -100ms -0.61 -19.1%
buildMDXVisible 507ms 579ms 72ms -0.51 12.4%

@valentinpalkovic valentinpalkovic self-assigned this Jan 24, 2025
@valentinpalkovic valentinpalkovic changed the title CLI: Fix missing peer dependency React: Fix missing peer dependency Jan 24, 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 Jan 24, 2025

View your CI Pipeline Execution ↗ for commit bda6f0e.

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

☁️ Nx Cloud last updated this comment at 2025-02-16 02:11:53 UTC

@valentinpalkovic valentinpalkovic force-pushed the valentin/fix-missing-peer-dependency branch from 930bfd3 to e4f914e Compare January 24, 2025 11:27
@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @valentinpalkovic. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/12948750354

@valentinpalkovic valentinpalkovic force-pushed the valentin/fix-missing-peer-dependency branch from e4f914e to ebe7f62 Compare January 24, 2025 11:35
@storybook-pr-benchmarking
Copy link

storybook-pr-benchmarking bot commented Jan 24, 2025

Package Benchmarks

Commit: bda6f0e, ran on 16 February 2025 at 02:16:55 UTC

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

@storybook/angular

Before After Difference
Dependency count 266 263 🎉 -3 🎉
Self size 368 KB 368 KB 🎉 -134 B 🎉
Dependency size 33.75 MB 33.74 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/experimental-nextjs-vite

Before After Difference
Dependency count 186 182 🎉 -4 🎉
Self size 235 KB 235 KB 0 B
Dependency size 48.84 MB 48.84 MB 🎉 -8 KB 🎉
Bundle Size Analyzer Link Link

@storybook/html-vite

Before After Difference
Dependency count 15 12 🎉 -3 🎉
Self size 6 KB 6 KB 0 B
Dependency size 1.91 MB 1.91 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/html-webpack5

Before After Difference
Dependency count 251 248 🎉 -3 🎉
Self size 8 KB 8 KB 0 B
Dependency size 32.99 MB 32.98 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/nextjs

Before After Difference
Dependency count 588 584 🎉 -4 🎉
Self size 475 KB 475 KB 0 B
Dependency size 83.37 MB 83.37 MB 🎉 -8 KB 🎉
Bundle Size Analyzer Link Link

@storybook/preact-vite

Before After Difference
Dependency count 13 10 🎉 -3 🎉
Self size 5 KB 5 KB 0 B
Dependency size 1.31 MB 1.30 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/preact-webpack5

Before After Difference
Dependency count 249 246 🎉 -3 🎉
Self size 8 KB 8 KB 0 B
Dependency size 32.56 MB 32.56 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/react-native-web-vite

Before After Difference
Dependency count 176 172 🎉 -4 🎉
Self size 45 KB 45 KB 0 B
Dependency size 24.30 MB 24.30 MB 🎉 -8 KB 🎉
Bundle Size Analyzer Link Link

@storybook/react-vite

Before After Difference
Dependency count 128 124 🎉 -4 🎉
Self size 15 KB 15 KB 🚨 +80 B 🚨
Dependency size 20.48 MB 20.48 MB 🎉 -8 KB 🎉
Bundle Size Analyzer Link Link

@storybook/react-webpack5

Before After Difference
Dependency count 327 323 🎉 -4 🎉
Self size 8 KB 8 KB 0 B
Dependency size 44.61 MB 44.60 MB 🎉 -8 KB 🎉
Bundle Size Analyzer Link Link

@storybook/server-webpack5

Before After Difference
Dependency count 257 254 🎉 -3 🎉
Self size 15 KB 15 KB 0 B
Dependency size 33.72 MB 33.71 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/svelte-vite

Before After Difference
Dependency count 135 132 🎉 -3 🎉
Self size 23 KB 23 KB 0 B
Dependency size 36.43 MB 36.43 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/svelte-webpack5

Before After Difference
Dependency count 315 312 🎉 -3 🎉
Self size 7 KB 7 KB 0 B
Dependency size 40.61 MB 40.60 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/sveltekit

Before After Difference
Dependency count 143 140 🎉 -3 🎉
Self size 48 KB 48 KB 0 B
Dependency size 39.74 MB 39.74 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/vue3-vite

Before After Difference
Dependency count 108 105 🎉 -3 🎉
Self size 17 KB 17 KB 0 B
Dependency size 42.63 MB 42.62 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/vue3-webpack5

Before After Difference
Dependency count 499 496 🎉 -3 🎉
Self size 7 KB 7 KB 0 B
Dependency size 57.01 MB 57.00 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/web-components-vite

Before After Difference
Dependency count 16 13 🎉 -3 🎉
Self size 6 KB 6 KB 0 B
Dependency size 1.95 MB 1.94 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/web-components-webpack5

Before After Difference
Dependency count 249 246 🎉 -3 🎉
Self size 7 KB 7 KB 0 B
Dependency size 32.61 MB 32.61 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/preset-react-webpack

Before After Difference
Dependency count 182 178 🎉 -4 🎉
Self size 24 KB 24 KB 🚨 +94 B 🚨
Dependency size 31.73 MB 31.72 MB 🎉 -8 KB 🎉
Bundle Size Analyzer Link Link

@storybook/preset-server-webpack

Before After Difference
Dependency count 16 13 🎉 -3 🎉
Self size 10 KB 10 KB 0 B
Dependency size 1.23 MB 1.22 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/html

Before After Difference
Dependency count 6 3 🎉 -3 🎉
Self size 47 KB 47 KB 🎉 -134 B 🎉
Dependency size 40 KB 34 KB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/preact

Before After Difference
Dependency count 6 3 🎉 -3 🎉
Self size 23 KB 23 KB 🎉 -134 B 🎉
Dependency size 40 KB 34 KB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/react

Before After Difference
Dependency count 6 2 🎉 -4 🎉
Self size 1.73 MB 1.73 MB 🎉 -179 B 🎉
Dependency size 24 KB 16 KB 🎉 -8 KB 🎉
Bundle Size Analyzer Link Link

@storybook/server

Before After Difference
Dependency count 7 4 🎉 -3 🎉
Self size 13 KB 13 KB 🎉 -134 B 🎉
Dependency size 722 KB 716 KB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/svelte

Before After Difference
Dependency count 107 104 🎉 -3 🎉
Self size 96 KB 95 KB 🎉 -134 B 🎉
Dependency size 10.64 MB 10.64 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/vue3

Before After Difference
Dependency count 17 14 🎉 -3 🎉
Self size 87 KB 87 KB 🎉 -134 B 🎉
Dependency size 6.14 MB 6.13 MB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook/web-components

Before After Difference
Dependency count 7 4 🎉 -3 🎉
Self size 62 KB 62 KB 🎉 -134 B 🎉
Dependency size 55 KB 49 KB 🎉 -6 KB 🎉
Bundle Size Analyzer Link Link

@storybook-bot
Copy link
Contributor

Failed to publish canary version of this pull request, triggered by @valentinpalkovic. See the failed workflow run at: https://github.com/storybookjs/storybook/actions/runs/12950176182

@valentinpalkovic valentinpalkovic force-pushed the valentin/fix-missing-peer-dependency branch from 199c1b2 to 07dc467 Compare January 24, 2025 13:34
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.

Removing all the "obsolete" dependencies from renderers is breaking, and should be reverted. The dependencies are there to ensure that the dependencies exists in all users' projects even without users depending on them directly.

The dependencies were added in the CPC project, and can't be removed until that has been finalized in 9.0.

@ndelangen and @kasperpeulen will be able to describe this in more detail. See #28599

@ndelangen
Copy link
Member

The extra dependencies were added to renderers to assist with users using older community addons.
It's not the correct dependency graph structure indeed, and we should get rid of it.
We were planning of doing that in 9.0

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.

[Bug]: Upgrade fails with npx storybook@latest upgrade
6 participants