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: Add extra entries to optimizeDeps #30117

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

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Dec 20, 2024

Closes #29812

What I did

I added more packages/files to our liost of optimizeDeps. The entries i added we got from running mealdrop & inkline, as well as some logical deduction.

It's not likely this list if 100% complete, and we might be unable to actually ensure it's 100% complete.

I also discussed with @JReinhold about the idea that individual addons and renderers should really be responsible for setting these themselves.

I'd be great if the underlaying issue (refreshes and flaky test runs) could be solved in some other way.

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

@yannbf on his machine added these entries manually to his viteFinal config in mealdrop & inkline & module-mocking-demo, and verified that storybook no longer refreshes, and the re no messages in the command-line about missing optimizedDeps

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-30117-sha-7ec361e1. 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-30117-sha-7ec361e1
Triggered by @yannbf
Repository storybookjs/storybook
Branch norbert/add-optimizedeps-prevent-reloads
Commit 7ec361e1
Datetime Fri Dec 20 12:21:49 UTC 2024 (1734697309)
Workflow run 12431329748

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

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.8 MB 77.8 MB 0 B 2.38 0%
initSize 133 MB 133 MB 3.51 kB -3 0%
diffSize 55.3 MB 55.3 MB 3.51 kB -3 0%
buildSize 7.23 MB 7.23 MB 0 B -1.93 0%
buildSbAddonsSize 1.86 MB 1.86 MB 0 B -2 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.87 MB 1.87 MB 0 B 1.53 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.92 MB 3.92 MB 0 B -1.93 0%
buildPreviewSize 3.3 MB 3.3 MB 0 B -0.43 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 17.7s 25.5s 7.8s 1.46 🔺30.8%
generateTime 20.7s 20.3s -418ms -0.35 -2.1%
initTime 14.6s 14.6s 64ms 0.04 0.4%
buildTime 8.4s 8.6s 195ms -0.95 2.3%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.3s 4.7s -1s -579ms -0.93 -33.4%
devManagerResponsive 4.9s 3.5s -1s -418ms -0.96 -40.3%
devManagerHeaderVisible 657ms 523ms -134ms -1.33 🔰-25.6%
devManagerIndexVisible 691ms 555ms -136ms -1.28 🔰-24.5%
devStoryVisibleUncached 2s 1.2s -832ms -1.6 🔰-65.9%
devStoryVisible 693ms 555ms -138ms -1.33 🔰-24.9%
devAutodocsVisible 648ms 570ms -78ms -0.18 -13.7%
devMDXVisible 580ms 495ms -85ms -0.86 -17.2%
buildManagerHeaderVisible 735ms 544ms -191ms -1 -35.1%
buildManagerIndexVisible 829ms 648ms -181ms -0.9 -27.9%
buildStoryVisible 697ms 533ms -164ms -0.88 -30.8%
buildAutodocsVisible 655ms 464ms -191ms -0.42 -41.2%
buildMDXVisible 637ms 462ms -175ms -0.57 -37.9%

Greptile Summary

Based on the provided information, I'll create a concise summary of the pull request:

Added numerous Storybook addon preview files and dependencies to Vite's optimizeDeps configuration to prevent hard reloads during dependency optimization.

  • Added preview entry points for core Storybook addons (actions, backgrounds, docs, etc.) to INCLUDE_CANDIDATES array
  • Added utility packages like mockdate, msw-storybook-addon, and chromatic/isChromatic
  • Added framework-specific preview files for HTML, Preact, React, Svelte, Vue3, and Web Components
  • Removed duplicate entry for @storybook/addon-essentials/actions/preview
  • Fixed issue causing flaky test runs and unnecessary refreshes in Vite builder

Copy link

nx-cloud bot commented Dec 20, 2024

View your CI Pipeline Execution ↗ for commit 5240a4a.

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

☁️ Nx Cloud last updated this comment at 2024-12-20 14:28:20 UTC

@ndelangen ndelangen marked this pull request as ready for review December 20, 2024 12:08
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.

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +20 to +21
'@storybook/addon-essentials/actions/preview',
'@storybook/addon-essentials/actions/preview',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: '@storybook/addon-essentials/actions/preview' is duplicated

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] revisit dependency optimization behavior
2 participants