-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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: Support Vite 5 #24395
Vite: Support Vite 5 #24395
Conversation
Updated dependencies detected. Learn more about Socket for GitHub ↗︎
|
Hmmm, I wonder what this error means:
It looks like that logfile isn't archived as an artifact (maybe it should be?). And it's not failing locally for me... |
Thanks a lot @IanVS! Re: vitest we are actually doing a migration to it, with currently 2k tests passing and only 50 failing. Almost there! cc @ndelangen Regarding the error, we definitely should store the artifact. However I think you figured it out and fixed it already 👍 |
Co-authored-by: Josh Wooding <[email protected]>
I wonder if the changed Chromatic stories are actually valid here, and not just flakes. There's a bunch of fonts changed, which we've experienced before to a lesser degree, but then there's also this which looks very different: https://www.chromatic.com/test?appId=63b588a512565bfaace15e7c&id=65202d1f6d601fdca7587360 |
@IanVS canary release ongoing: https://github.com/storybookjs/storybook/actions/runs/6458019422 |
We will make a separate PR to pull in the HMR fix
@joshwooding, @valentinpalkovic I've returned to just using version 0.3.0, which added peerDependencies support for Vite 5. I think updating to 0.3.1 should be a PR on its own, so we can isolate any possible performance impacts. |
@valentinpalkovic you asked why tests aren't failing since vite 5 requires node 18. Am I remembering correctly that changes to If that's the case, then I'm not sure how we can test Vite 5 at all in our CI. |
A fix for now could be to create a new sandbox for Vite 5 that has However if we figure out CI and Node 18 soon, the temporary solution might not be worth it. |
@valentinpalkovic @JReinhold I believe the CI suite is now running node 18, correct? Does anything else need to be done before this can be merged? |
Go ahead. I don't see anything stopping us from merging this. Maybe getting a final approval from @ndelangen since he looked already at the PR. |
Hm, I updated it on the base branch, and now CI is failing. Bench fails with:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! 💪
I tested it out in our UI Storybook, where we get the CJS warning because we import This will be more critical when CJS is actually gone in Vite 6 though, as that will break anyone's usage of Vite in their |
Yeah, unless they have Thanks for the review/merge! |
Should the warning not show up already? I'm on storybook 7.5.3 but still get it 🤔
|
No, I'm not sure why it's happening, and unfortunately the stack trace when using The good news is that the message can be ignored for now. The removal of the CJS API will not happen for a while longer, and there has been talk of moving Storybook itself to ESM, which would solve the issue. But if anyone has a chance to dig in and find out what's happening, so we can avoid the warning in the meantime, that would be awesome. |
Closes #24333
What I did
This gets us ready for Vite 5.
^5.0.0
to the peer dependenciesUpdate the monorepo to use Vite 5 as a dev dependency.Not really possible because Jest cannot handle ESM easily. Need to stay on Vite 4 until we can migrate to vitest.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
I think the sandboxes should cover this, but it would be great if we could cut a canary for this change, and then test it out manually in projects using vite version 3 through 5, just to be sure the dynamic imports did not somehow break something.
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/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 pull request has been released as version
0.0.0-pr-24395-sha-2aacb587
. Install it by pinning all your Storybook dependencies to that version.More information
0.0.0-pr-24395-sha-2aacb587
vite-5
2aacb587
1696861762
)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=24395