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: Export returntype of ReactMeta#story #30580

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

Conversation

mrginglymus
Copy link
Contributor

@mrginglymus mrginglymus commented Feb 19, 2025

Closes #30579

What I did

Export the return type of ReactMeat#story, to prevent typescript errors for users.

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>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 80.5 MB 80.5 MB 0 B -0.62 0%
initSize 80.5 MB 80.5 MB 0 B -0.62 0%
diffSize 97 B 97 B 0 B - 0%
buildSize 7.31 MB 7.31 MB 0 B 1.4 0%
buildSbAddonsSize 1.9 MB 1.9 MB 0 B -0.78 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.88 MB 1.88 MB 0 B 1.11 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.97 MB 3.97 MB 0 B 1.3 0%
buildPreviewSize 3.34 MB 3.34 MB 0 B 1.11 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.3s 7.1s -223ms -0.78 -3.1%
generateTime 20.3s 19.1s -1s -205ms -0.8 -6.3%
initTime 4.6s 4.2s -376ms -1.27 🔰-8.8%
buildTime 9.6s 8.5s -1s -102ms -1.15 -12.9%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 9.2s 5.2s -3s -981ms -0.58 -76.2%
devManagerResponsive 8.6s 5s -3s -614ms 0.2 -71.6%
devManagerHeaderVisible 686ms 744ms 58ms -0.65 7.8%
devManagerIndexVisible 746ms 789ms 43ms -0.45 5.4%
devStoryVisibleUncached 1.6s 1.7s 127ms -1.28 🔺7.3%
devStoryVisible 775ms 817ms 42ms -0.46 5.1%
devAutodocsVisible 761ms 764ms 3ms -0.44 0.4%
devMDXVisible 647ms 751ms 104ms -0.39 13.8%
buildManagerHeaderVisible 738ms 782ms 44ms -0.23 5.6%
buildManagerIndexVisible 741ms 795ms 54ms -0.38 6.8%
buildStoryVisible 725ms 765ms 40ms -0.11 5.2%
buildAutodocsVisible 672ms 715ms 43ms 0.36 6%
buildMDXVisible 584ms 587ms 3ms -0.8 0.5%

Greptile Summary

Based on the provided information, I'll create a concise summary of this PR:

Exports the ReactStory interface from preview.tsx to fix TypeScript errors when users access the return type of ReactMeta#story in their Storybook React projects.

  • Adds export keyword to existing ReactStory interface in /code/renderers/react/src/preview.tsx
  • Interface extends Story<ReactRenderer> which is already part of public API
  • Fixes TypeScript error TS4023: Exported variable Default has or is using name ReactStory from external module
  • Safe change that doesn't modify existing functionality or structure

💡 (5/5) You can turn off certain types of comments like style here!

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 Feb 19, 2025

View your CI Pipeline Execution ↗ for commit 63aa2b8.

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

☁️ Nx Cloud last updated this comment at 2025-02-21 11:28:06 UTC

@storybook-pr-benchmarking
Copy link

storybook-pr-benchmarking bot commented Feb 19, 2025

Package Benchmarks

Commit: 63aa2b8, ran on 21 February 2025 at 11:35:29 UTC

No significant changes detected, all good. 👏

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]: CSF Factories/React - return type of meta.story (ReactStory) is not exported
2 participants