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: Support vite 4 #20139

Merged
merged 8 commits into from
Dec 9, 2022
Merged

Vite: Support vite 4 #20139

merged 8 commits into from
Dec 9, 2022

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Dec 7, 2022

Issue: N/A

What I did

Vite 4 will be released soon. Let's test it out in storybook.

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@IanVS IanVS added builder-vite build Internal-facing build tooling & test updates labels Dec 7, 2022
@IanVS
Copy link
Member Author

IanVS commented Dec 7, 2022

This is currently passing, but note that there will be two versions of vite in these projects, until #20131 is merged. Maybe I should just pull that PR into this one?

I tested this out locally, by using npm create vite@beta, then npx sb@next init

Here's the output of npm ls vite:

├─┬ @storybook/[email protected]
│ ├─┬ @joshwooding/[email protected]
│ │ └── [email protected] deduped invalid: ">2.0.0-0" from node_modules/@joshwooding/vite-plugin-react-docgen-typescript
│ ├─┬ @storybook/[email protected]
│ │ ├─┬ @vitejs/[email protected]
│ │ │ └── [email protected] deduped
│ │ └── [email protected]
│ ├─┬ @vitejs/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected]
├─┬ @vitejs/[email protected]
│ └── [email protected] deduped
└── [email protected]

IanVS added 2 commits December 7, 2022 20:47
Not all frameworks use imports from "vite" directly.

# Conflicts:
#	code/frameworks/html-vite/package.json
#	code/frameworks/web-components-vite/package.json
#	code/yarn.lock
# Conflicts:
#	code/yarn.lock
@IanVS IanVS changed the title Vite: Use vite 4 beta in repros Vite: Support vite 4 Dec 8, 2022
@IanVS IanVS mentioned this pull request Dec 8, 2022
@@ -86,7 +86,7 @@ export const allTemplates: Record<string, Template> = {
},
'react-vite/default-js': {
name: 'React Vite (JS)',
script: 'yarn create vite . --template react',
script: 'yarn create vite@beta . --template react',
Copy link
Member

Choose a reason for hiding this comment

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

@IanVS This is awesome!!! So happy about this 🎉

Adding @beta is great for testing, but should stay as yarn create vite when we merge

We should have a separate yarn create vite@beta that only runs at the daily cadence. We can probably do this for TS only (since it's generally a superset of JS) and do it for all frameworks.

WDYT? @yannbf @kasperpeulen

Copy link
Member

Choose a reason for hiding this comment

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

Agreed!

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not so sure keeping @beta in the tests will be helpful. I don't think we need to officially support beta after the final release (likely tomorrow), and we can always add it back in before the next major change. I'd recommend at least deferring until then, personally.

Copy link
Contributor

Choose a reason for hiding this comment

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

So your recommended approach is that we test against the beta now, for the next couple of days. And when Vite 4.0 has been released, we go back to testing against stable.
And we do the same thing when Vite 5.0 is getting close, etc.

That sounds fair to me.

I think there's CI iteration 2 in the future where we have a setup that tests against all the betas continuously, (so eg. we would have caught Angular 15 breaking before it was released), and that system would likely supersede the work here.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could leave it in for a few days, or I've already taken it out of this PR. I think it's a low-risk item right now, especially since we showed here in this PR that it doesn't cause any trouble in any of the frameworks.

I'm also working on getting storybook back into vite-ecosystem-ci, which would mean that storybook would be continuously tested against unreleased versions of vite, which would be ideal.

IanVS added 3 commits December 8, 2022 07:25
# Conflicts:
#	code/frameworks/html-vite/package.json
#	code/frameworks/web-components-vite/package.json
@shilman shilman merged commit 087ecea into next Dec 9, 2022
@shilman shilman deleted the vite-beta branch December 9, 2022 04:15
@shilman shilman added maintenance User-facing maintenance tasks and removed build Internal-facing build tooling & test updates labels Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builder-vite maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants