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

Vite: Fix preview runtime import #29802

Merged
merged 1 commit into from
Dec 4, 2024
Merged

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Dec 4, 2024

Closes #29798

What I did

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-29802-sha-ecb67932. 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-29802-sha-ecb67932
Triggered by @yannbf
Repository storybookjs/storybook
Branch yann/fix-preview-runtime-import
Commit ecb67932
Datetime Wed Dec 4 09:56:08 UTC 2024 (1733306168)
Workflow run 12157252692

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

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.7 MB 77.7 MB 0 B 0.82 0%
initSize 130 MB 130 MB 6 B 0.2 0%
diffSize 52.4 MB 52.4 MB 6 B 0.06 0%
buildSize 6.75 MB 6.75 MB 0 B -1.73 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B - 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 0 B -0.41 0%
buildSbPreviewSize 0 B 0 B 0 B -1.73 -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.56 MB 3.56 MB 0 B -1.73 0%
buildPreviewSize 3.19 MB 3.19 MB 0 B 1.73 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 24.6s 6.8s -17s -762ms -1.13 -257.6%
generateTime 18.8s 19.1s 276ms -1.15 1.4%
initTime 12s 12.8s 775ms -0.63 6%
buildTime 9.9s 8.3s -1s -623ms -0.93 -19.5%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 4.4s 5.1s 637ms -0.03 12.5%
devManagerResponsive 3.2s 3.5s 345ms -0.31 9.6%
devManagerHeaderVisible 531ms 511ms -20ms -0.95 -3.9%
devManagerIndexVisible 580ms 574ms -6ms -0.98 -1%
devStoryVisibleUncached 1.8s 1.5s -256ms -1.04 -16.5%
devStoryVisible 559ms 538ms -21ms -1.17 -3.9%
devAutodocsVisible 508ms 491ms -17ms -0.58 -3.5%
devMDXVisible 462ms 569ms 107ms 0.3 18.8%
buildManagerHeaderVisible 501ms 551ms 50ms -0.4 9.1%
buildManagerIndexVisible 577ms 632ms 55ms -0.06 8.7%
buildStoryVisible 466ms 507ms 41ms -0.68 8.1%
buildAutodocsVisible 390ms 415ms 25ms -0.72 6%
buildMDXVisible 394ms 416ms 22ms -0.68 5.3%

Greptile Summary

Updates the import path for the preview runtime in Vite builder from '@storybook/core/preview/runtime' to 'storybook/internal/preview/runtime' to fix module resolution.

  • Modified code/builders/builder-vite/src/codegen-modern-iframe-script.ts to use correct import path for preview runtime
  • Eliminates need for users to explicitly install @storybook/core package
  • Maintains existing HMR and project annotation functionality while fixing import resolution

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 Dec 4, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit ecb6793. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@yannbf yannbf merged commit f344add into next Dec 4, 2024
45 of 63 checks passed
@yannbf yannbf deleted the yann/fix-preview-runtime-import branch December 4, 2024 10:11
@github-actions github-actions bot mentioned this pull request Dec 4, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant