From 480386ba822c8f4378aa93e80b2c74067417e68c Mon Sep 17 00:00:00 2001 From: su <60057515+suqi776@users.noreply.github.com> Date: Thu, 3 Jul 2025 20:43:27 +0800 Subject: [PATCH 1/4] docs: update to vite 7 (#20345) --- guide/rolldown.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/rolldown.md b/guide/rolldown.md index 712abce9..7bc950d3 100644 --- a/guide/rolldown.md +++ b/guide/rolldown.md @@ -37,7 +37,7 @@ The rolldown-powered version of Vite is currently available as a separate packag ```json { "dependencies": { - "vite": "^6.0.0" // [!code --] + "vite": "^7.0.0" // [!code --] "vite": "npm:rolldown-vite@latest" // [!code ++] } } From 4a634eb9565a00c2dff289c3da67948759c117b0 Mon Sep 17 00:00:00 2001 From: Alexander Lichter Date: Fri, 4 Jul 2025 08:56:41 +0200 Subject: [PATCH 2/4] docs(rolldown): update manualChunks status (#20347) --- guide/rolldown.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/rolldown.md b/guide/rolldown.md index 7bc950d3..b2008061 100644 --- a/guide/rolldown.md +++ b/guide/rolldown.md @@ -103,7 +103,7 @@ If you don't pass the option in yourself, this must be fixed by the utilized fra #### `manualChunks` to `advancedChunks` -Rolldown does not support the `manualChunks` option that was available in Rollup. Instead, it offers a more fine-grained setting via the [`advancedChunks` option](https://rolldown.rs/guide/in-depth/advanced-chunks#advanced-chunks), which is more similar to webpack's `splitChunk`: +While Rolldown has support for the `manualChunks` option that is also exposed by Rollup, it is marked deprecated. Instead of it, Rolldown offers a more fine-grained setting via the [`advancedChunks` option](https://rolldown.rs/guide/in-depth/advanced-chunks#advanced-chunks), which is more similar to webpack's `splitChunk`: ```js // Old configuration (Rollup) From e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Fri, 4 Jul 2025 17:01:43 +0800 Subject: [PATCH 3/4] docs: update environment api as release candidate (#20353) --- changes/index.md | 7 +++---- guide/api-environment-frameworks.md | 6 ++++-- guide/api-environment-instances.md | 6 ++++-- guide/api-environment-plugins.md | 6 ++++-- guide/api-environment-runtimes.md | 6 ++++-- guide/api-environment.md | 10 ++++++---- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/changes/index.md b/changes/index.md index ef9ff004..9e9d66c2 100644 --- a/changes/index.md +++ b/changes/index.md @@ -6,7 +6,9 @@ List of breaking changes in Vite including API deprecations, removals, and chang These changes are planned for the next major version of Vite. The deprecation or usage warnings will guide you where possible, and we're reaching out to framework, plugin authors, and users to apply these changes. -- _No planned changes yet_ +- [`this.environment` in Hooks](/changes/this-environment-in-hooks) +- [HMR `hotUpdate` Plugin Hook](/changes/hotupdate-hook) +- [SSR Using `ModuleRunner` API](/changes/ssr-using-modulerunner) ## Considering @@ -14,10 +16,7 @@ These changes are being considered and are often experimental APIs that intend t We don't recommend switching to these APIs yet. They are included in Vite to help us gather feedback. Please check these proposals and let us know how they work in your use case in each's linked GitHub Discussions. -- [`this.environment` in Hooks](/changes/this-environment-in-hooks) -- [HMR `hotUpdate` Plugin Hook](/changes/hotupdate-hook) - [Move to Per-environment APIs](/changes/per-environment-apis) -- [SSR Using `ModuleRunner` API](/changes/ssr-using-modulerunner) - [Shared Plugins During Build](/changes/shared-plugins-during-build) ## Past diff --git a/guide/api-environment-frameworks.md b/guide/api-environment-frameworks.md index b676f19c..43af341e 100644 --- a/guide/api-environment-frameworks.md +++ b/guide/api-environment-frameworks.md @@ -1,7 +1,9 @@ # Environment API for Frameworks -:::warning Experimental -Environment API is experimental. We'll still maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. +:::info Release Candidate +The Environment API is generally in the release candidate phase. We'll maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. However, note that [some specific APIs](/changes/#considering) are still considered experimental. + +We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. Resources: diff --git a/guide/api-environment-instances.md b/guide/api-environment-instances.md index d59ef543..9c459250 100644 --- a/guide/api-environment-instances.md +++ b/guide/api-environment-instances.md @@ -1,7 +1,9 @@ # Using `Environment` Instances -:::warning Experimental -Environment API is experimental. We'll still maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. +:::info Release Candidate +The Environment API is generally in the release candidate phase. We'll maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. However, note that [some specific APIs](/changes/#considering) are still considered experimental. + +We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. Resources: diff --git a/guide/api-environment-plugins.md b/guide/api-environment-plugins.md index b456d4c4..0c28643d 100644 --- a/guide/api-environment-plugins.md +++ b/guide/api-environment-plugins.md @@ -1,7 +1,9 @@ # Environment API for Plugins -:::warning Experimental -Environment API is experimental. We'll still maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. +:::info Release Candidate +The Environment API is generally in the release candidate phase. We'll maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. However, note that [some specific APIs](/changes/#considering) are still considered experimental. + +We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. Resources: diff --git a/guide/api-environment-runtimes.md b/guide/api-environment-runtimes.md index 2d62e733..991b9a31 100644 --- a/guide/api-environment-runtimes.md +++ b/guide/api-environment-runtimes.md @@ -1,7 +1,9 @@ # Environment API for Runtimes -:::warning Experimental -Environment API is experimental. We'll still maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. +:::info Release Candidate +The Environment API is generally in the release candidate phase. We'll maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. However, note that [some specific APIs](/changes/#considering) are still considered experimental. + +We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. Resources: diff --git a/guide/api-environment.md b/guide/api-environment.md index e75259d3..c9a82fd0 100644 --- a/guide/api-environment.md +++ b/guide/api-environment.md @@ -1,7 +1,9 @@ # Environment API -:::warning Experimental -Environment API is experimental. We'll still maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. +:::info Release Candidate +The Environment API is generally in the release candidate phase. We'll maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. However, note that [some specific APIs](/changes/#considering) are still considered experimental. + +We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. Resources: @@ -13,7 +15,7 @@ Please share your feedback with us. ## Formalizing Environments -Vite 6 formalizes the concept of Environments. Until Vite 5, there were two implicit Environments (`client`, and optionally `ssr`). The new Environment API allows users and framework authors to create as many environments as needed to map the way their apps work in production. This new capability required a big internal refactoring, but a lot of effort has been placed on backward compatibility. The initial goal of Vite 6 is to move the ecosystem to the new major as smoothly as possible, delaying the adoption of these new experimental APIs until enough users have migrated and frameworks and plugin authors have validated the new design. +Vite 6 formalizes the concept of Environments. Until Vite 5, there were two implicit Environments (`client`, and optionally `ssr`). The new Environment API allows users and framework authors to create as many environments as needed to map the way their apps work in production. This new capability required a big internal refactoring, but a lot of effort has been placed on backward compatibility. The initial goal of Vite 6 is to move the ecosystem to the new major as smoothly as possible, delaying the adoption of the APIs until enough users have migrated and frameworks and plugin authors have validated the new design. ## Closing the Gap Between Build and Dev @@ -117,7 +119,7 @@ export default { ## Backward Compatibility -The current Vite server API are not yet deprecated and are backward compatible with Vite 5. The new Environment API is experimental. +The current Vite server API is not yet deprecated and is backward compatible with Vite 5. The `server.moduleGraph` returns a mixed view of the client and ssr module graphs. Backward compatible mixed module nodes will be returned from all its methods. The same scheme is used for the module nodes passed to `handleHotUpdate`. From d1dee29445ec777b8f2c6a7285cf85fcfab5304f Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Sat, 5 Jul 2025 09:59:17 +0800 Subject: [PATCH 4/4] fix: resolved conflict --- changes/index.md | 18 +++--------------- guide/api-environment-frameworks.md | 13 ++++--------- guide/api-environment-instances.md | 13 ++++--------- guide/api-environment-plugins.md | 13 ++++--------- guide/api-environment-runtimes.md | 13 ++++--------- guide/api-environment.md | 23 +++++------------------ guide/rolldown.md | 6 +----- 7 files changed, 25 insertions(+), 74 deletions(-) diff --git a/changes/index.md b/changes/index.md index 265bcccd..e6193514 100644 --- a/changes/index.md +++ b/changes/index.md @@ -6,13 +6,9 @@ Vite 中的破坏性变更列表,包括 API 废弃、移除和变更。在你 这些变更计划在 Vite 的下一个主要版本中进行。我们会通过废弃或使用警告来尽可能地引导你,同时我们也正在联系框架、插件的作者以及用户来实施这些变更。 -<<<<<<< HEAD -- _目前还没有计划中的变更_ -======= -- [`this.environment` in Hooks](/changes/this-environment-in-hooks) -- [HMR `hotUpdate` Plugin Hook](/changes/hotupdate-hook) -- [SSR Using `ModuleRunner` API](/changes/ssr-using-modulerunner) ->>>>>>> e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f +- [钩子函数中的 `this.environment`](/changes/this-environment-in-hooks) +- [HMR `hotUpdate` 插件钩子](/changes/hotupdate-hook) +- [使用 `ModuleRunner` API 进行服务端渲染](/changes/ssr-using-modulerunner) ## 考虑中 {#considering} @@ -20,16 +16,8 @@ Vite 中的破坏性变更列表,包括 API 废弃、移除和变更。在你 我们目前还不建议你切换到这些 API。我们将它们包含在 Vite 中是为了帮助我们收集反馈。请查看这些提案,并在每个提案相关联的 GitHub Discussions 中告诉我们它们在你的使用场景中的表现如何。 -<<<<<<< HEAD -- [钩子函数中的 `this.environment`](/changes/this-environment-in-hooks) -- [HMR `hotUpdate` 插件钩子](/changes/hotupdate-hook) - [迁移到基于环境的API](/changes/per-environment-apis) -- [使用 `ModuleRunner` API 进行服务端渲染](/changes/ssr-using-modulerunner) - [构建过程中的共享插件](/changes/shared-plugins-during-build) -======= -- [Move to Per-environment APIs](/changes/per-environment-apis) -- [Shared Plugins During Build](/changes/shared-plugins-during-build) ->>>>>>> e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f ## 历史 {#past} diff --git a/guide/api-environment-frameworks.md b/guide/api-environment-frameworks.md index 0837ffde..ccfac4f1 100644 --- a/guide/api-environment-frameworks.md +++ b/guide/api-environment-frameworks.md @@ -1,14 +1,9 @@ # 用于框架的环境 API {#environment-api-for-frameworks} -<<<<<<< HEAD -:::warning 实验性 -环境 API 仍处于实验阶段。我们仍将在主要版本之间保持 API 的稳定性,以便生态系统进行实验和构建。我们计划在下游项目有时间试验并验证新功能后,在未来的主要版本中稳定这些新 API(可能包含重大更改)。 -======= -:::info Release Candidate -The Environment API is generally in the release candidate phase. We'll maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. However, note that [some specific APIs](/changes/#considering) are still considered experimental. - -We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. ->>>>>>> e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f +:::info 发布候选版本 +环境 API 目前处于发布候选阶段。我们将在主要版本发布之间保持 API 的稳定性,以便生态系统能够进行实验并在此基础上进行开发。然而,请注意,[某些特定的 API](/changes/#considering) 仍被视为实验性 API。 + +我们计划在未来主要版本发布时,待下游项目有足够时间对新功能进行实验并验证后,对这些新 API(可能包含兼容性变更)进行稳定化处理。 资料: diff --git a/guide/api-environment-instances.md b/guide/api-environment-instances.md index e3a109fd..4f210bf0 100644 --- a/guide/api-environment-instances.md +++ b/guide/api-environment-instances.md @@ -1,14 +1,9 @@ # 使用 `Environment` 实例 {#using-environment-instances} -<<<<<<< HEAD -:::warning 实验性 -环境 API 仍处于实验阶段。我们仍将在主要版本之间保持 API 的稳定性,以便生态系统进行实验和构建。我们计划在下游项目有时间试验并验证新功能后,在未来的主要版本中稳定这些新 API(可能包含重大更改)。 -======= -:::info Release Candidate -The Environment API is generally in the release candidate phase. We'll maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. However, note that [some specific APIs](/changes/#considering) are still considered experimental. - -We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. ->>>>>>> e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f +:::info 发布候选版本 +环境 API 目前处于发布候选阶段。我们将在主要版本发布之间保持 API 的稳定性,以便生态系统能够进行实验并在此基础上进行开发。然而,请注意,[某些特定的 API](/changes/#considering) 仍被视为实验性 API。 + +我们计划在未来主要版本发布时,待下游项目有足够时间对新功能进行实验并验证后,对这些新 API(可能包含兼容性变更)进行稳定化处理。 资料: diff --git a/guide/api-environment-plugins.md b/guide/api-environment-plugins.md index f2ff868d..4a7bda9e 100644 --- a/guide/api-environment-plugins.md +++ b/guide/api-environment-plugins.md @@ -1,14 +1,9 @@ # 用于插件的环境 API {#environment-api-for-plugins} -<<<<<<< HEAD -:::warning 实验性 -环境 API 仍处于实验阶段。我们仍将在主要版本之间保持 API 的稳定性,以便生态系统进行实验和构建。我们计划在下游项目有时间试验并验证新功能后,在未来的主要版本中稳定这些新 API(可能包含重大更改)。 -======= -:::info Release Candidate -The Environment API is generally in the release candidate phase. We'll maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. However, note that [some specific APIs](/changes/#considering) are still considered experimental. - -We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. ->>>>>>> e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f +:::info 发布候选版本 +环境 API 目前处于发布候选阶段。我们将在主要版本发布之间保持 API 的稳定性,以便生态系统能够进行实验并在此基础上进行开发。然而,请注意,[某些特定的 API](/changes/#considering) 仍被视为实验性 API。 + +我们计划在未来主要版本发布时,待下游项目有足够时间对新功能进行实验并验证后,对这些新 API(可能包含兼容性变更)进行稳定化处理。 资料: diff --git a/guide/api-environment-runtimes.md b/guide/api-environment-runtimes.md index d285d563..c5c99733 100644 --- a/guide/api-environment-runtimes.md +++ b/guide/api-environment-runtimes.md @@ -1,14 +1,9 @@ # 用于运行时的环境 API {#environment-api-for-runtimes} -<<<<<<< HEAD -:::warning 实验性 -环境 API 仍处于实验阶段。我们仍将在主要版本之间保持 API 的稳定性,以便生态系统进行实验和构建。我们计划在下游项目有时间试验并验证新功能后,在未来的主要版本中稳定这些新 API(可能包含重大更改)。 -======= -:::info Release Candidate -The Environment API is generally in the release candidate phase. We'll maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. However, note that [some specific APIs](/changes/#considering) are still considered experimental. - -We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. ->>>>>>> e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f +:::info 发布候选版本 +环境 API 目前处于发布候选阶段。我们将在主要版本发布之间保持 API 的稳定性,以便生态系统能够进行实验并在此基础上进行开发。然而,请注意,[某些特定的 API](/changes/#considering) 仍被视为实验性 API。 + +我们计划在未来主要版本发布时,待下游项目有足够时间对新功能进行实验并验证后,对这些新 API(可能包含兼容性变更)进行稳定化处理。 资料: diff --git a/guide/api-environment.md b/guide/api-environment.md index d579ec0c..41a19574 100644 --- a/guide/api-environment.md +++ b/guide/api-environment.md @@ -1,14 +1,9 @@ # 环境 API {#environment-api} -<<<<<<< HEAD -:::warning 实验性 -环境 API 仍处于实验阶段。我们仍将在主要版本之间保持 API 的稳定性,以便生态系统进行实验和构建。我们计划在下游项目有时间试验并验证新功能后,在未来的主要版本中稳定这些新 API(可能包含重大更改)。 -======= -:::info Release Candidate -The Environment API is generally in the release candidate phase. We'll maintain stability in the APIs between major releases to allow the ecosystem to experiment and build upon them. However, note that [some specific APIs](/changes/#considering) are still considered experimental. +:::info 发布候选版本 +环境 API 目前处于发布候选阶段。我们将在主要版本发布之间保持 API 的稳定性,以便生态系统能够进行实验并在此基础上进行开发。然而,请注意,[某些特定的 API](/changes/#considering) 仍被视为实验性 API。 -We plan to stabilize these new APIs (with potential breaking changes) in a future major release once downstream projects have had time to experiment with the new features and validate them. ->>>>>>> e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f +我们计划在未来主要版本发布时,待下游项目有足够时间对新功能进行实验并验证后,对这些新 API(可能包含兼容性变更)进行稳定化处理。 资料: @@ -20,11 +15,7 @@ We plan to stabilize these new APIs (with potential breaking changes) in a futur ## 引入环境概念 {#formalizing-environments} -<<<<<<< HEAD -Vite 6 正式引入了环境(Environments)的概念。在 Vite 5 之前,有两个隐式环境(`client`,以及可选的 `ssr`)。新的环境 API 允许用户和框架作者根据他们的应用在生产环境中的工作方式创建尽可能多的环境。这些新的功能需要大规模的内部重构,而我们也已经在保持向后兼容性上做出了很大的努力。Vite 6 的初始目标是尽可能平滑地将整个生态系统迁移到新的主要版本,直到有足够的用户已经迁移,并且框架和插件作者已经验证了新的设计后,再采用这些新的实验性 API。 -======= -Vite 6 formalizes the concept of Environments. Until Vite 5, there were two implicit Environments (`client`, and optionally `ssr`). The new Environment API allows users and framework authors to create as many environments as needed to map the way their apps work in production. This new capability required a big internal refactoring, but a lot of effort has been placed on backward compatibility. The initial goal of Vite 6 is to move the ecosystem to the new major as smoothly as possible, delaying the adoption of the APIs until enough users have migrated and frameworks and plugin authors have validated the new design. ->>>>>>> e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f +Vite 6 正式引入了“环境”的概念。在 Vite 5 之前,系统中存在两个隐式环境(`client` 和可选的 `ssr`)。新的环境 API 允许用户和框架作者根据应用在生产环境中的运行方式,创建任意数量的环境。这一新功能需要进行大规模的内部重构,但我们已投入大量精力确保向后兼容性。Vite 6 的初始目标是尽可能平滑地将生态系统迁移到新版本,推迟 API 的采用,直到足够多的用户完成迁移,且框架和插件作者已验证新设计。 ## 缩小构建和开发模式间的差距 {#closing-the-gap-between-build-and-dev} @@ -128,11 +119,7 @@ export default { ## 向后兼容性 {#backward-compatibility} -<<<<<<< HEAD -当前的 Vite 服务器 API 尚未被弃用,并且与 Vite 5 向后兼容。新的环境 API 是实验性的。 -======= -The current Vite server API is not yet deprecated and is backward compatible with Vite 5. ->>>>>>> e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f +当前的 Vite 服务器 API 尚未被弃用,并且与 Vite 5 向后兼容。 `server.moduleGraph` 返回客户端和服务器端渲染(ssr)模块图的混合视图。所有其方法都将返回向后兼容的混合模块节点。对于传递给 `handleHotUpdate` 的模块节点,也使用相同的方案。 diff --git a/guide/rolldown.md b/guide/rolldown.md index a3e298bf..8a9f6b67 100644 --- a/guide/rolldown.md +++ b/guide/rolldown.md @@ -103,11 +103,7 @@ Rolldown 专注于三个主要原则: #### `manualChunks` 改为 `advancedChunks` {#manualchunks-changed-to-advancedchunks} -<<<<<<< HEAD -Rolldown 不再支持 Rollup 中可用的 `manualChunks` 选项。取而代之的是,它提供了一个更细粒度的设置:[`advancedChunks`](https://rolldown.rs/guide/in-depth/advanced-chunks#advanced-chunks),其行为与 webpack 的 `splitChunk` 类似。 -======= -While Rolldown has support for the `manualChunks` option that is also exposed by Rollup, it is marked deprecated. Instead of it, Rolldown offers a more fine-grained setting via the [`advancedChunks` option](https://rolldown.rs/guide/in-depth/advanced-chunks#advanced-chunks), which is more similar to webpack's `splitChunk`: ->>>>>>> e3930bf08cc81753cbcdb29baaf8185c8c6a9d3f +虽然 Rolldown 支持与 Rollup 相同的 `manualChunks` 选项,但该选项已被标记为过时。作为替代,Rolldown 通过 [`advancedChunks` 选项](https://rolldown.rs/guide/in-depth/advanced-chunks#advanced-chunks) 提供更精细的设置,该选项与 webpack 的 `splitChunk` 功能更为相似: ```js // 旧配置 (Rollup)