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 HMR #28876

Merged
merged 2 commits into from
Aug 13, 2024
Merged

Vite: Fix HMR #28876

merged 2 commits into from
Aug 13, 2024

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Aug 13, 2024

Closes #28871

What I did

  • Added a test to ensure the HMR works by checking if the button component is shown after save-from-controls
  • Fix the HMR bug

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/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 76.3 MB 76.3 MB 0 B 1.98 0%
initSize 167 MB 167 MB -24 B 1.74 0%
diffSize 91.1 MB 91.1 MB -24 B 0.33 0%
buildSize 7.42 MB 7.42 MB 0 B 0.65 0%
buildSbAddonsSize 1.61 MB 1.61 MB 0 B -0.65 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.29 MB 2.29 MB 0 B 0.65 0%
buildSbPreviewSize 351 kB 351 kB 0 B -0.65 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.45 MB 4.45 MB 0 B 0.65 0%
buildPreviewSize 2.97 MB 2.97 MB 0 B -0.65 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 23s 18.8s -4s -282ms 0.34 -22.8%
generateTime 18.1s 21.5s 3.4s 0.57 16.1%
initTime 16.3s 16.7s 363ms -0.25 2.2%
buildTime 10.1s 11.7s 1.5s 0.09 13.5%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 7.4s 8.7s 1.2s 0.22 14.2%
devManagerResponsive 4.7s 5.2s 567ms 0.19 10.7%
devManagerHeaderVisible 804ms 966ms 162ms 1.27 🔺16.8%
devManagerIndexVisible 841ms 986ms 145ms 1.15 14.7%
devStoryVisibleUncached 1.2s 1.6s 397ms 1.69 🔺24.3%
devStoryVisible 852ms 1s 196ms 1.55 🔺18.7%
devAutodocsVisible 673ms 953ms 280ms 1.91 🔺29.4%
devMDXVisible 664ms 784ms 120ms 0.29 15.3%
buildManagerHeaderVisible 701ms 867ms 166ms 0.88 19.1%
buildManagerIndexVisible 710ms 869ms 159ms 0.85 18.3%
buildStoryVisible 744ms 919ms 175ms 0.92 19%
buildAutodocsVisible 689ms 763ms 74ms 0.58 9.7%
buildMDXVisible 665ms 692ms 27ms 0.07 3.9%

Greptile Summary

This PR adds an end-to-end test for the 'save-from-controls' feature, focusing on verifying Hot Module Replacement (HMR) functionality in Storybook.

  • Added assertion in code/e2e-tests/save-from-controls.spec.ts to check if Button component renders after story updates
  • Test verifies HMR by updating and creating a new story, then checking preview content
  • Addresses issue [Bug]: SfC not working in 8.3.0-alpha.5 #28871 where Save from Controls (SfC) feature wasn't working in a specific alpha version
  • Enhances test coverage for critical HMR functionality in Storybook's control panel

@ndelangen ndelangen changed the title add e2e test for save-from-controls, testing if the preview is actually rendered. This tests HMR ;) Vite: Fix HMR Aug 13, 2024
@ndelangen ndelangen self-assigned this Aug 13, 2024
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

Copy link

nx-cloud bot commented Aug 13, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit fe8bf33. 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.

@ndelangen ndelangen merged commit ac5d162 into next Aug 13, 2024
53 checks passed
@ndelangen ndelangen deleted the norbert/vite-hmr-fix branch August 13, 2024 10:58
@github-actions github-actions bot mentioned this pull request Aug 13, 2024
8 tasks
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]: SfC not working in 8.3.0-alpha.5
1 participant