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

Build: Fix infinite reloading of internal storybook #30217

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Jan 8, 2025

Closes #

What I did

This PR fixes this annoying behavior in yarn storybook:ui in the internal storybook

image

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 77.8 MB 77.8 MB 692 B -0.31 0%
initSize 131 MB 131 MB 692 B -0.65 0%
diffSize 53 MB 53 MB 0 B -0.65 0%
buildSize 7.19 MB 7.19 MB 0 B 1.67 0%
buildSbAddonsSize 1.85 MB 1.85 MB 0 B - 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.87 MB 1.87 MB 0 B -1.22 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.91 MB 3.91 MB 0 B -1.22 0%
buildPreviewSize 3.28 MB 3.28 MB 0 B 1.7 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 6.6s 7.6s 1s -1.09 13.2%
generateTime 19.2s 23.5s 4.2s 2.09 🔺18.2%
initTime 13.7s 15.9s 2.1s 1.55 🔺13.6%
buildTime 9s 8.4s -630ms -1.35 🔰-7.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 4.9s 4.5s -410ms -1.3 🔰-9%
devManagerResponsive 3.7s 3.4s -262ms -1.16 -7.6%
devManagerHeaderVisible 586ms 679ms 93ms 0.64 13.7%
devManagerIndexVisible 617ms 755ms 138ms 1.24 🔺18.3%
devStoryVisibleUncached 2s 2s -53ms -0.21 -2.6%
devStoryVisible 618ms 752ms 134ms 1.12 17.8%
devAutodocsVisible 444ms 563ms 119ms -0.18 21.1%
devMDXVisible 502ms 573ms 71ms 0.24 12.4%
buildManagerHeaderVisible 642ms 579ms -63ms -0.66 -10.9%
buildManagerIndexVisible 741ms 689ms -52ms -0.58 -7.5%
buildStoryVisible 610ms 558ms -52ms -0.72 -9.3%
buildAutodocsVisible 548ms 447ms -101ms -1.1 -22.6%
buildMDXVisible 487ms 454ms -33ms -0.81 -7.3%

Greptile Summary

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

Fixed infinite reloading issue in internal Storybook setup by modifying the Vite server watch configuration in code/.storybook/main.ts.

  • Added server.watch.ignored patterns in Vite config to exclude .nx/cache and tsconfig.json files
  • Prevents unnecessary reloading triggered by build cache and TypeScript config changes
  • Improves development workflow by eliminating disruptive reload loops
  • Change is specific to internal Storybook development environment

The changes are focused and minimal, addressing a specific development workflow issue without impacting the core functionality or addons.

@yannbf yannbf added build Internal-facing build tooling & test updates ci:normal labels Jan 8, 2025
@yannbf yannbf self-assigned this Jan 8, 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.

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

server: {
watch: {
// Something odd happens with tsconfig and nx which causes Storybook to keep reloading, so we ignore them
ignored: ['**/.nx/cache/**', '**/tsconfig.json'],
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The glob pattern for tsconfig.json will ignore ALL tsconfig files in the project. Consider being more specific about which tsconfig files to ignore if only certain ones are problematic.

Copy link

nx-cloud bot commented Jan 8, 2025

View your CI Pipeline Execution ↗ for commit 08ce74c.

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

☁️ Nx Cloud last updated this comment at 2025-01-08 13:54:55 UTC

@yannbf yannbf merged commit e890a40 into next Jan 9, 2025
55 of 62 checks passed
@yannbf yannbf deleted the yann/fix-internal-storybook branch January 9, 2025 07:28
@github-actions github-actions bot mentioned this pull request Jan 9, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Internal-facing build tooling & test updates ci:normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants