-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
CSF: Story ComponentAnnotations['subcomponents'] to correctly use its own type for subcomponents rather than attempt to inherit from the component #31723
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
Conversation
… own type for subcomponents rather than attempt to inherit from the component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2 files reviewed, no comments
Edit PR Review Bot Settings | Greptile
|
View your CI Pipeline Execution ↗ for commit fc6b24f.
☁️ Nx Cloud last updated this comment at |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 199 | 209 | 🚨 +10 🚨 |
| Self size | 189 KB | 607 KB | 🚨 +418 KB 🚨 |
| Dependency size | 29.70 MB | 29.79 MB | 🚨 +94 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 216 | 324 | 🚨 +108 🚨 |
| Self size | 582 KB | 235 KB | 🎉 -347 KB 🎉 |
| Dependency size | 94.67 MB | 99.89 MB | 🚨 +5.22 MB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 185 | 267 | 🚨 +82 🚨 |
| Self size | 31 KB | 31 KB | 🚨 +361 B 🚨 |
| Dependency size | 78.74 MB | 82.77 MB | 🚨 +4.03 MB 🚨 |
| Bundle Size Analyzer | Link | Link |
…ents CSF: Story ComponentAnnotations['subcomponents'] to correctly use its own type for subcomponents rather than attempt to inherit from the component (cherry picked from commit 7429e3c)
Closes #23170
What I did
Brings in ComponentDriven/csf#103 to core. This annotation broke with Storybook 9 upgrade again, as I guess the csf module was also brought into core without the fixes.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake 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-31723-sha-fc6b24f9. Try it out in a new sandbox by runningnpx [email protected] sandboxor in an existing project withnpx [email protected] upgrade.More information
0.0.0-pr-31723-sha-fc6b24f9feature/fix-csf-subcomponentsfc6b24f91749631684)To request a new release of this pull request, mention the
@storybookjs/coreteam.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=31723Greptile Summary
Fixed TypeScript typing for
subcomponentsproperty in Component Story Format (CSF) to allow subcomponents to use their own independent type definitions rather than inheriting from the parent component.ComponentAnnotationsinterface incode/core/src/csf/story.tsto correctly handle component types with their own generic argumentscode/core/src/csf/story.test.tsdemonstrating ButtonIcon component with{ icon: string }props working as Button subcomponentsubcomponentsmeta property always invalid with TypeScript Strict mode for React #23170