-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Migrate to Vite 3 ⚡️ #3570
Migrate to Vite 3 ⚡️ #3570
Conversation
🦋 Changeset detectedLatest commit: 247494e The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Thanks for quicking this out! Just sent a PR to point vite-ecosystem-ci to this branch, so we get reports in Vite Land. Link to the latest migration guide from v2: https://github.com/vitejs/vite/blob/main/docs/guide/migration.md |
edc897c
to
6b5efd0
Compare
eebb21b
to
72da034
Compare
We just saw Astro 🟢 for the first time with Vite v3 in #ecosystem-ci. Thanks a lot for all your efforts here @bholmesdev 🙌🏼 |
4472f9e
to
34d21f1
Compare
5157be9
to
dbce9b5
Compare
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.
Looks great! Had a few comments.
packages/astro/package.json
Outdated
@@ -136,7 +136,7 @@ | |||
"strip-ansi": "^7.0.1", | |||
"supports-esm": "^1.0.0", | |||
"tsconfig-resolver": "^3.0.1", | |||
"vite": "^2.9.14", | |||
"vite": "3.0.0", |
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.
Any reason to pin to 3.0.0
exactly? Should we use ~3.0.0
?
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.
Ack, didn't catch this! I'm using ^3.0.0
but would we prefer ~3.0.0
?
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.
I’m almost sure they’re following semver, but given all the noise around this release I’d be +1 to use ~ until 3.x has had some time to bake. Don’t feel too strongly tho
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.
Choosing to keep ^3.0.0
. Using ~3.0.0
is one more thing to question and circle back to. I trust the Vite team here 😁
lgtm, glad to see no nasty regexes required! |
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.
LGTM!
Be it so ordered, by the power vested in me by fredkbot, I deem this PR merged. 🔨 |
Changes
This bumps Vite to the next major version. Still in beta, but we need to align this week so Astro 1.0 is aligned with Vite!
middlewareMode
to new APIALWAYS_EXTERNAL
array 🥳ssr.noExternal
array. Vite 3 now errors out when attempting tossr.noExternal
a package that is not installed, so we need a manual check on our end.ssr.noExternal
for relevant example projects.external
is the default, so we'll need this fix more often than before now.Flip onVite 3 reverted this change for their stable release! Sounds like they'll revisit for Vite 4 though, so keep this in mind with new HMR work.legacy.devDepsScanner
to revert to Vite 2.X dev experience. Otherwise, non-hydrated components will fail to hot-update without a manual page refresh. The Vite team confirmed this flag will be around for a few months, but let's track this for the near term!Testing
Add
package.json
across integration test fixtures. This prevents anyssr.noExternal
failures for nested Astro dependenciesDocs
TODO - Vite 3 migration guide!