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

CSF: Fix CSF subcomponent type #30729

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

Conversation

filipemelo2002
Copy link
Contributor

@filipemelo2002 filipemelo2002 commented Mar 1, 2025

Closes #30713

What I did

Changed T's type from unknown to any, fixing the type error mentioned in the issue #30713

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

No manual testing needed

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=30729

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 79.9 MB 79.9 MB 0 B 0.52 0%
initSize 79.9 MB 79.9 MB 0 B 0.52 0%
diffSize 97 B 97 B 0 B - 0%
buildSize 7.57 MB 7.57 MB 0 B 1.78 0%
buildSbAddonsSize 1.98 MB 1.98 MB 0 B 2.38 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 0.82 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.06 MB 4.06 MB 0 B 2.38 0%
buildPreviewSize 3.51 MB 3.51 MB 0 B 0.99 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.4s 7.8s 407ms -1.45 🔺5.2%
generateTime 18.1s 21.7s 3.5s 1.58 🔺16.3%
initTime 4.3s 4.6s 308ms 0.39 6.6%
buildTime 8.2s 12.5s 4.3s 3.7 🔺34.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 7.2s 5.5s -1s -637ms 0.77 -29.3%
devManagerResponsive 6.8s 5.3s -1s -510ms 0.79 -28.3%
devManagerHeaderVisible 1s 829ms -187ms 0.18 -22.6%
devManagerIndexVisible 1s 919ms -107ms 0.56 -11.6%
devStoryVisibleUncached 2.9s 2.6s -327ms 0.38 -12.3%
devStoryVisible 1.4s 1.3s -128ms 0.55 -9.5%
devAutodocsVisible 1.5s 1.2s -293ms 0.71 -23.8%
devMDXVisible 1.5s 1.2s -243ms 0.66 -18.9%
buildManagerHeaderVisible 1.1s 1s -51ms 1.63 -4.8%
buildManagerIndexVisible 1.1s 1s -31ms 1.81 -2.8%
buildStoryVisible 1s 1s -52ms 1.59 -5%
buildAutodocsVisible 1s 971ms -43ms 1.21 -4.4%
buildMDXVisible 1.1s 982ms -148ms 1.84 🔰-15.1%

Greptile Summary

This PR modifies the type parameter in the Renderer interface to fix type errors with dot-notation subcomponents in Storybook's Component Story Format (CSF).

  • Changed type parameter T from unknown to any in code/core/src/csf/story.ts to allow proper typing of subcomponents
  • Fixes issue [Bug]: Problem with dot-notation subcomponents in meta #30713 where components with specific props couldn't be assigned to subcomponents in meta objects
  • Enables proper documentation of dot-notation components with their props in the UI
  • Note: While using any reduces type safety, it's necessary to support the complex type relationships needed for subcomponents

The change is minimal but important for fixing type errors when using the subcomponents property in meta objects, particularly for dot-notation components.

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

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
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
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 Mar 1, 2025

View your CI Pipeline Execution ↗ for commit e1c88d1.

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

☁️ Nx Cloud last updated this comment at 2025-03-05 13:32:28 UTC

@storybook-pr-benchmarking
Copy link

storybook-pr-benchmarking bot commented Mar 3, 2025

Package Benchmarks

Commit: e1c88d1, ran on 5 March 2025 at 13:49:33 UTC

No significant changes detected, all good. 👏

@kasperpeulen kasperpeulen enabled auto-merge March 5, 2025 13:28
@kasperpeulen kasperpeulen changed the title Fix: fix dot-notation type error CSF: Fix CSF subcomponent type Mar 5, 2025
@kasperpeulen kasperpeulen added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Mar 5, 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ci:normal patch:yes Bugfix & documentation PR that need to be picked to main branch typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Problem with dot-notation subcomponents in meta
3 participants