Skip to content

Commit 76e5a34

Browse files
committed
chore: merge commit '9c6cbe602187644887b0a4342de6b486c8f60f4d' into rolldown-vite
2 parents bf77840 + 9c6cbe6 commit 76e5a34

File tree

91 files changed

+1480
-1044
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1480
-1044
lines changed

.github/renovate.json5

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["config:base", "schedule:weekly", "group:allNonMajor"],
3+
"extends": ["config:recommended", "schedule:weekly", "group:allNonMajor"],
44
"labels": ["dependencies"],
55
"ignorePaths": ["**/__tests__/**"],
66
"rangeStrategy": "bump",
77
"packageRules": [
88
{
9-
"depTypeList": ["peerDependencies"],
9+
"matchDepTypes": ["peerDependencies"],
1010
"enabled": false,
1111
},
1212
{
1313
"matchDepTypes": ["action"],
14-
"excludePackagePrefixes": ["actions/", "github/"],
1514
"pinDigests": true,
15+
"matchPackageNames": ["!actions/{/,}**", "!github/{/,}**"],
1616
},
1717
{
1818
"groupName": "rolldown-related dependencies",
@@ -38,20 +38,20 @@
3838
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
3939
],
4040
"github-actions": {
41-
"fileMatch": [
41+
"managerFilePatterns": [
4242
// default values
43-
"(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$",
44-
"(^|/)action\\.ya?ml$",
43+
"/(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$/",
44+
"/(^|/)action\\.ya?ml$/",
4545
// custom value
46-
"(^|/)docs/guide/static-deploy-github-pages\\.yaml$",
46+
"/(^|/)docs/guide/static-deploy-github-pages\\.yaml$/",
4747
],
4848
},
4949
"customManagers": [
5050
{
5151
"customType": "regex",
52-
"fileMatch": ["packages\/create-vite\/src\/index\\.ts$"],
52+
"managerFilePatterns": ["/packages/create-vite/src/index\\.ts$/"],
5353
"matchStrings": [
54-
"\/\/\\s*renovate:\\s+datasource=(?<datasource>\\S+)\\s+depName=(?<depName>\\S+)\\s+(?:var|let|const)\\s+\\S+\\s*=\\s*[\"'](?<currentValue>[^\"']+)[\"']",
54+
"//\\s*renovate:\\s+datasource=(?<datasource>\\S+)\\s+depName=(?<depName>\\S+)\\s+(?:var|let|const)\\s+\\S+\\s*=\\s*[\"'](?<currentValue>[^\"']+)[\"']",
5555
],
5656
},
5757
],

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ Some errors are masked and hidden away because of the layers of abstraction and
120120

121121
You can set the `--debug` option to turn on debugging logs (e.g. `vite --debug resolve`). To see all debug logs, you can set `vite --debug *`, but be warned that it will be quite noisy. You can run `grep -r "createDebugger('vite:" packages/vite/src/` to see a list of available debug scopes.
122122

123+
### Disabling Source Maps
124+
125+
Source maps for Vite's source code are enabled by default when Vite is placed outside `node_modules` so that you can easily debug it. When bundling Vite in watch mode, source maps will be generated.
126+
127+
However, this behavior may not be desirable when you are developing source map related features. In that case, you can disable source maps by setting the `DEBUG_DISABLE_SOURCE_MAP` environment variable to `1` when running Vite (e.g. `DEBUG_DISABLE_SOURCE_MAP=1 vite`). This environment variable can also be used to disable source map generation.
128+
123129
## Testing Vite against external packages
124130

125131
You may wish to test your locally modified copy of Vite against another package that is built with Vite. For pnpm, after building Vite, you can use [`pnpm.overrides`](https://pnpm.io/package_json#pnpmoverrides) to do this. Note that `pnpm.overrides` must be specified in the root `package.json`, and you must list the package as a dependency in the root `package.json`:

docs/changes/hotupdate-hook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ We're planning to deprecate the `handleHotUpdate` plugin hook in favor of [`hotU
99
Affected scope: `Vite Plugin Authors`
1010

1111
::: warning Future Deprecation
12-
`hotUpdate` was first introduced in `v6.0`. The deprecation of `handleHotUpdate` is planned for `v7.0`. We don't yet recommend moving away from `handleHotUpdate` yet. If you want to experiment and give us feedback, you can use the `future.removePluginHookHandleHotUpdate` to `"warn"` in your vite config.
12+
`hotUpdate` was first introduced in `v6.0`. The deprecation of `handleHotUpdate` is planned for a future major. We don't yet recommend moving away from `handleHotUpdate` yet. If you want to experiment and give us feedback, you can use the `future.removePluginHookHandleHotUpdate` to `"warn"` in your vite config.
1313
:::
1414

1515
## Motivation

docs/changes/per-environment-apis.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Multiple APIs from `ViteDevServer` related to module graph and modules transform
99
Affect scope: `Vite Plugin Authors`
1010

1111
::: warning Future Deprecation
12-
The `Environment` instance was first introduced at `v6.0`. The deprecation of `server.moduleGraph` and other methods that are now in environments is planned for `v7.0`. We don't recommend moving away from server methods yet. To identify your usage, set these in your vite config.
12+
The `Environment` instance was first introduced at `v6.0`. The deprecation of `server.moduleGraph` and other methods that are now in environments is planned for a future major. We don't recommend moving away from server methods yet. To identify your usage, set these in your vite config.
1313

1414
```ts
1515
future: {
@@ -28,6 +28,6 @@ In Vite v6, it is now possible to create any number of custom environments (`cli
2828

2929
## Migration Guide
3030

31-
- `server.moduleGraph` -> [`environment.moduleGraph`](/guide/api-environment#separate-module-graphs)
31+
- `server.moduleGraph` -> [`environment.moduleGraph`](/guide/api-environment-instances#separate-module-graphs)
3232
- `server.transformRequest(url, ssr)` -> `environment.transformRequest(url)`
3333
- `server.warmupRequest(url, ssr)` -> `environment.warmupRequest(url)`

docs/changes/this-environment-in-hooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Before Vite 6, only two environments were available: `client` and `ssr`. A singl
99
Affect scope: `Vite Plugin Authors`
1010

1111
::: warning Future Deprecation
12-
`this.environment` was introduced in `v6.0`. The deprecation of `options.ssr` is planned for `v7.0`. At that point we'll start recommending migrating your plugins to use the new API. To identify your usage, set `future.removePluginHookSsrArgument` to `"warn"` in your vite config.
12+
`this.environment` was introduced in `v6.0`. The deprecation of `options.ssr` is planned for a future major. At that point we'll start recommending migrating your plugins to use the new API. To identify your usage, set `future.removePluginHookSsrArgument` to `"warn"` in your vite config.
1313
:::
1414

1515
## Motivation
@@ -40,4 +40,4 @@ export function myPlugin(): Plugin {
4040
}
4141
```
4242

43-
For a more robust long term implementation, the plugin hook should handle for [multiple environments](/guide/api-environment.html#accessing-the-current-environment-in-hooks) using fine-grained environment options instead of relying on the environment name.
43+
For a more robust long term implementation, the plugin hook should handle for [multiple environments](/guide/api-environment-plugins.html#accessing-the-current-environment-in-hooks) using fine-grained environment options instead of relying on the environment name.

docs/guide/api-environment-frameworks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Environment API for Frameworks
22

33
:::warning Experimental
4-
Environment API is experimental. We'll keep the APIs stable during Vite 6 to let the ecosystem experiment and build on top of it. We're planning to stabilize these new APIs with potential breaking changes in Vite 7.
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.
55

66
Resources:
77

docs/guide/api-environment-instances.md

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

33
:::warning Experimental
4-
Environment API is experimental. We'll keep the APIs stable during Vite 6 to let the ecosystem experiment and build on top of it. We're planning to stabilize these new APIs with potential breaking changes in Vite 7.
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.
55

66
Resources:
77

@@ -185,7 +185,7 @@ export class EnvironmentModuleGraph {
185185
invalidateModule(
186186
mod: EnvironmentModuleNode,
187187
seen: Set<EnvironmentModuleNode> = new Set(),
188-
timestamp: number = Date.now(),
188+
timestamp: number = monotonicDateNow(),
189189
isHmr: boolean = false,
190190
): void
191191

docs/guide/api-environment-plugins.md

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

33
:::warning Experimental
4-
Environment API is experimental. We'll keep the APIs stable during Vite 6 to let the ecosystem experiment and build on top of it. We're planning to stabilize these new APIs with potential breaking changes in Vite 7.
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.
55

66
Resources:
77

@@ -184,6 +184,8 @@ export default defineConfig({
184184
})
185185
```
186186
187+
The `applyToEnvironment` hook is called at config time, currently after `configResolved` due to projects in the ecosystem modifying the plugins in it. Environment plugins resolution may be moved before `configResolved` in the future.
188+
187189
## Environment in Build Hooks
188190
189191
In the same way as during dev, plugin hooks also receive the environment instance during build, replacing the `ssr` boolean.
@@ -198,7 +200,7 @@ Before Vite 6, the plugins pipelines worked in a different way during dev and bu
198200
199201
This forced frameworks to share state between the `client` build and the `ssr` build through manifest files written to the file system. In Vite 6, we are now building all environments in a single process so the way the plugins pipeline and inter-environment communication can be aligned with dev.
200202
201-
In a future major (Vite 7 or 8), we aim to have complete alignment:
203+
In a future major, we could have complete alignment:
202204
203205
- **During both dev and build:** plugins are shared, with [per-environment filtering](#per-environment-plugins)
204206

docs/guide/api-environment-runtimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Environment API for Runtimes
22

33
:::warning Experimental
4-
Environment API is experimental. We'll keep the APIs stable during Vite 6 to let the ecosystem experiment and build on top of it. We're planning to stabilize these new APIs with potential breaking changes in Vite 7.
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.
55

66
Resources:
77

docs/guide/api-environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Environment API
22

33
:::warning Experimental
4-
Environment API is experimental. We'll keep the APIs stable during Vite 6 to let the ecosystem experiment and build on top of it. We're planning to stabilize these new APIs with potential breaking changes in Vite 7.
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.
55

66
Resources:
77

0 commit comments

Comments
 (0)