-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
feat: v6 - Environment API #16471
feat: v6 - Environment API #16471
Conversation
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
After 2866d4f, we have opt-in for build plugins to be shared, matching the way things work during dev. We can deprecate One interesting problem about shared plugins is that once they are used, the only command that makes sense is |
@@ -1160,10 +1152,11 @@ const lockfileFormats = [ | |||
}) | |||
const lockfileNames = lockfileFormats.map((l) => l.name) | |||
|
|||
function getConfigHash(config: ResolvedConfig, ssr: boolean): string { | |||
function getConfigHash(environment: Environment): string { |
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 noticed that getConfigHash
became unstable for my use case (react-server
environment) hi-ogawa/vite-plugins#634 due to environment.config.resolve.noExternal
included as a hash seed, which wasn't the case when config.ssr.noExternal
.
I'm using https://github.com/svitejs/vitefu 's crawlFrameworkPkgs
to collect noExternal
and it's not deterministic. I can normalize it on my side with unique + sort
, but maybe we should remove it from JSON.stringify
if resolve.noExternal
doesn't affect deps optimization? (also what's the case with resolve.external
? does it affect deps optimization?)
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.
Maybe we should sort it ourselves then? 🤔 We sort other options
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.
Interesting. This is SSR only (we need to review if we can use them for the client too). And ya, I think it should not affect the fixed optimized deps we have during SSR 🤔
Maybe we should just remove it as you propose it for now.
9b847dc
to
6d128aa
Compare
/ecosystem-ci run |
📝 Ran ecosystem CI on
✅ analogjs, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, redwoodjs, storybook, unocss, vite-environment-examples, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress, vuepress |
Current ecosystem CI state in the Environment API PR. We're all green in main, so we know that these are produced by the new changes:
Note: SvelteKit was passing before, it is failing in main now too. It is unrelated to this PR. |
We discussed in today's Vite team meeting that we should merge this PR so we move further work to main. The changes in this PR are now backward compatible (see ecosystem-ci comment above) and all new APIs are experimental. We can continue refining them during the Vite 6 beta period that we will start now (and even after the stable release, we'll have opportunities for changes if needed until these are stabilized in 6.x). |
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.
Let's go! 🔥
Description
Note
Check out the Environment API Docs
We're starting a new PR for the Environment API work in progress proposal for v6 to have a clean slate for reviews and discussions now that the implementation and docs are more stable.
This PR merges the work done in:
Refer to the discussions in these PRs for context. If you have general feedback about the APIs, let's use this discussion so we can have proper threads:
If you have comments about the implementation or would like to collaborate a feature, fix, test, or docs, please comment in this PR as an usual review or send a PR against the
v6/environment-api
branch.Ecosystem Compatibility
These projects are failing in CI because of known reasons.
server._importGlobMap
, which is moved