Skip to content

Commit 86be7a2

Browse files
committed
chore: merge main
2 parents 1667c24 + 2f17d2f commit 86be7a2

File tree

9 files changed

+47
-47
lines changed

9 files changed

+47
-47
lines changed

docs/changes/index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ List of breaking changes in Vite including API deprecations, removals, and chang
66

77
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.
88

9-
- _No planned changes yet_
9+
- [`this.environment` in Hooks](/changes/this-environment-in-hooks)
10+
- [HMR `hotUpdate` Plugin Hook](/changes/hotupdate-hook)
11+
- [SSR Using `ModuleRunner` API](/changes/ssr-using-modulerunner)
1012

1113
## Considering
1214

1315
These changes are being considered and are often experimental APIs that intend to improve upon current usage patterns. As not all changes are listed here, please check out the [Experimental Label in Vite GitHub Discussions](https://github.com/vitejs/vite/discussions/categories/feedback?discussions_q=label%3Aexperimental+category%3AFeedback) for the full list.
1416

1517
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.
1618

17-
- [`this.environment` in Hooks](/changes/this-environment-in-hooks)
18-
- [HMR `hotUpdate` Plugin Hook](/changes/hotupdate-hook)
1919
- [Move to Per-environment APIs](/changes/per-environment-apis)
20-
- [SSR Using `ModuleRunner` API](/changes/ssr-using-modulerunner)
2120
- [Shared Plugins During Build](/changes/shared-plugins-during-build)
2221

2322
## Past

docs/guide/api-environment-frameworks.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Environment API for Frameworks
22

3-
:::warning Experimental
4-
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.
3+
:::info Release Candidate
4+
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.
5+
6+
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.
57

68
Resources:
79

docs/guide/api-environment-instances.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Using `Environment` Instances
22

3-
:::warning Experimental
4-
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.
3+
:::info Release Candidate
4+
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.
5+
6+
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.
57

68
Resources:
79

docs/guide/api-environment-plugins.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Environment API for Plugins
22

3-
:::warning Experimental
4-
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.
3+
:::info Release Candidate
4+
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.
5+
6+
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.
57

68
Resources:
79

docs/guide/api-environment-runtimes.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Environment API for Runtimes
22

3-
:::warning Experimental
4-
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.
3+
:::info Release Candidate
4+
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.
5+
6+
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.
57

68
Resources:
79

docs/guide/api-environment.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Environment API
22

3-
:::warning Experimental
4-
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.
3+
:::info Release Candidate
4+
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.
5+
6+
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.
57

68
Resources:
79

@@ -13,7 +15,7 @@ Please share your feedback with us.
1315

1416
## Formalizing Environments
1517

16-
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.
18+
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.
1719

1820
## Closing the Gap Between Build and Dev
1921

@@ -117,7 +119,7 @@ export default {
117119

118120
## Backward Compatibility
119121

120-
The current Vite server API are not yet deprecated and are backward compatible with Vite 5. The new Environment API is experimental.
122+
The current Vite server API is not yet deprecated and is backward compatible with Vite 5.
121123

122124
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`.
123125

docs/guide/rolldown.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The rolldown-powered version of Vite is currently available as a separate packag
3737
```json
3838
{
3939
"dependencies": {
40-
"vite": "^6.0.0" // [!code --]
40+
"vite": "^7.0.0" // [!code --]
4141
"vite": "npm:rolldown-vite@latest" // [!code ++]
4242
}
4343
}
@@ -103,7 +103,7 @@ If you don't pass the option in yourself, this must be fixed by the utilized fra
103103

104104
#### `manualChunks` to `advancedChunks`
105105

106-
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`:
106+
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`:
107107

108108
```js
109109
// Old configuration (Rollup)

packages/vite/src/node/plugins/css.ts

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,31 +2462,23 @@ const makeScssWorker = (
24622462
return unquotedUrl.startsWith('#{')
24632463
}
24642464

2465-
const createInternalImporter = (
2466-
isForRelative: boolean,
2467-
): Sass.Importer<'async'> => ({
2465+
const internalImporter: Sass.Importer<'async'> = {
24682466
async canonicalize(url, context) {
2469-
if (isForRelative) {
2470-
// sass passes resolved paths for importer passed to `importer` option
2471-
const resolved = new URL(url, context.containingUrl ?? undefined)
2472-
if (fs.existsSync(resolved)) return resolved
2473-
} else {
2474-
const importer = context.containingUrl
2475-
? fileURLToPath(context.containingUrl)
2476-
: options.filename
2477-
const resolved = await resolvers.sass(
2478-
environment,
2479-
url,
2480-
cleanScssBugUrl(importer),
2481-
)
2482-
if (
2483-
resolved &&
2484-
(resolved.endsWith('.css') ||
2485-
resolved.endsWith('.scss') ||
2486-
resolved.endsWith('.sass'))
2487-
) {
2488-
return pathToFileURL(resolved)
2489-
}
2467+
const importer = context.containingUrl
2468+
? fileURLToPath(context.containingUrl)
2469+
: options.filename
2470+
const resolved = await resolvers.sass(
2471+
environment,
2472+
url,
2473+
cleanScssBugUrl(importer),
2474+
)
2475+
if (
2476+
resolved &&
2477+
(resolved.endsWith('.css') ||
2478+
resolved.endsWith('.scss') ||
2479+
resolved.endsWith('.sass'))
2480+
) {
2481+
return pathToFileURL(resolved)
24902482
}
24912483
return null
24922484
},
@@ -2509,13 +2501,12 @@ const makeScssWorker = (
25092501
result.contents ?? (await fsp.readFile(result.file, 'utf-8'))
25102502
return { contents, syntax, sourceMapUrl: canonicalUrl }
25112503
},
2512-
})
2513-
2504+
}
25142505
sassOptions.importers = [
25152506
...(sassOptions.importers ?? []),
2516-
createInternalImporter(false),
2507+
internalImporter,
25172508
]
2518-
sassOptions.importer ??= createInternalImporter(true)
2509+
sassOptions.importer ??= internalImporter
25192510

25202511
const result = await compiler.compileStringAsync(data, sassOptions)
25212512
return {

playground/css/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default defineConfig({
6464
resolve: {
6565
alias: [
6666
{ find: '=', replacement: __dirname },
67-
{ find: /=replace\/(.*)/, replacement: `${__dirname}/$1` },
67+
{ find: /^=replace\/(.*)/, replacement: `${__dirname}/$1` },
6868
{ find: 'spacefolder', replacement: __dirname + '/folder with space' },
6969
{ find: '#alias', replacement: __dirname + '/aliased/foo.css' },
7070
{

0 commit comments

Comments
 (0)