Skip to content

Commit 3ea74f9

Browse files
authored
Merge branch 'main' into feat/add-reload-module-to-remove-server-module-graph-future-deprecation
2 parents 084c5bd + 259f45d commit 3ea74f9

124 files changed

Lines changed: 1906 additions & 1992 deletions

File tree

Some content is hidden

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

.github/copilot-instructions.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
This is a TypeScript project that implements a frontend build tooling called Vite. Please follow these guidelines when contributing:
2+
3+
## Code Standards
4+
5+
### Required Before Each Commit
6+
7+
- Run `pnpm run lint` to ensure that your code adheres to the code standards.
8+
- Run `pnpm run format` to format your code.
9+
10+
### Development Flow
11+
12+
- Build: `pnpm run build`
13+
- Test: `pnpm run test` (uses Vitest and Playwright)
14+
15+
## Repository Structure
16+
17+
- `docs/`: Documentation.
18+
- `packages/create-vite`: Contains the source code for the `create-vite` command.
19+
- `packages/plugin-legacy`: Contains the source code for `@vitejs/plugin-legacy`.
20+
- `packages/vite`: Contains the source code for the Vite core.
21+
- `playground/`: E2E tests
22+
23+
## Key Guidelines
24+
25+
1. Follow TypeScript best practices.
26+
2. Maintain existing code structure and organization.
27+
3. Write tests for new functionality. Prefer unit tests if it can be tested without using mocks. E2E tests should be added in the `playground/` directory.
28+
4. Never write comments that explain what the code does. Instead, write comments that explain why the code does what it does.
29+
5. Suggest changes to the documentation if public API changes are made.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
paths:
5+
- .github/workflows/copilot-setup-steps.yml
6+
pull_request:
7+
paths:
8+
- .github/workflows/copilot-setup-steps.yml
9+
10+
jobs:
11+
copilot-setup-steps:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
21+
22+
- name: Set node version to 22
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
cache: "pnpm"
27+
28+
- name: Install deps
29+
run: pnpm install
30+
31+
# Install playwright's binary under custom directory to cache
32+
- name: (non-windows) Set Playwright path and Get playwright version
33+
if: runner.os != 'Windows'
34+
run: |
35+
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
36+
PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies["playwright-chromium"].version')"
37+
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
38+
- name: (windows) Set Playwright path and Get playwright version
39+
if: runner.os == 'Windows'
40+
run: |
41+
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
42+
$env:PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies["playwright-chromium"].version')"
43+
echo "PLAYWRIGHT_VERSION=$env:PLAYWRIGHT_VERSION" >> $env:GITHUB_ENV
44+
45+
- name: Install Playwright
46+
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
47+
run: pnpm playwright install chromium

.prettierignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
packages/*/CHANGELOG.md
2-
packages/vite/src/node/ssr/runtime/__tests__/fixtures
3-
packages/vite/src/node/ssr/__tests__/fixtures/errors
2+
packages/vite/src/node/ssr/__tests__/fixtures/errors/syntax-error.*
43
playground-temp/
54
dist/
6-
temp/
75
LICENSE.md
86
pnpm-lock.yaml
97
pnpm-workspace.yaml

docs/changes/per-environment-apis.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ The `Environment` instance was first introduced at `v6.0`. The deprecation of `s
1515
future: {
1616
removeServerModuleGraph: 'warn',
1717
removeServerReloadModule: 'warn',
18+
removeServerPluginContainer: 'warn',
19+
removeServerHot: 'warn',
1820
removeServerTransformRequest: 'warn',
21+
removeServerWarmupRequest: 'warn',
1922
}
2023
```
2124

@@ -30,6 +33,8 @@ In Vite v6, it is now possible to create any number of custom environments (`cli
3033
## Migration Guide
3134

3235
- `server.moduleGraph` -> [`environment.moduleGraph`](/guide/api-environment-instances#separate-module-graphs)
36+
- `server.reloadModule(module)` -> `environment.reloadModule(module)`
37+
- `server.pluginContainer` -> `environment.pluginContainer`
3338
- `server.transformRequest(url, ssr)` -> `environment.transformRequest(url)`
3439
- `server.warmupRequest(url, ssr)` -> `environment.warmupRequest(url)`
35-
- `server.reloadModule(module)` -> `environment.reloadModule(module)`
40+
- `server.hot` -> `server.client.environment.hot`

docs/changes/ssr-using-modulerunner.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ The `server.ssrLoadModule(url)` only allows importing modules in the `ssr` e
1919
## Migration Guide
2020

2121
Check out the [Environment API for Frameworks Guide](../guide/api-environment-frameworks.md).
22+
23+
`server.ssrFixStacktrace` and `server.ssrRewriteStacktrace` does not have to be called when using the Module Runner APIs. The stack traces will be updated unless `sourcemapInterceptor` is set to `false`.

docs/config/preview-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Automatically open the app in the browser on server start. When the value is a s
8080

8181
Configure custom proxy rules for the preview server. Expects an object of `{ key: options }` pairs. If the key starts with `^`, it will be interpreted as a `RegExp`. The `configure` option can be used to access the proxy instance.
8282

83-
Uses [`http-proxy`](https://github.com/http-party/node-http-proxy). Full options [here](https://github.com/http-party/node-http-proxy#options).
83+
Uses [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3). Full options [here](https://github.com/sagemathinc/http-proxy-3#options).
8484

8585
## preview.cors
8686

docs/config/server-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Configure custom proxy rules for the dev server. Expects an object of `{ key: op
122122

123123
Note that if you are using non-relative [`base`](/config/shared-options.md#base), you must prefix each key with that `base`.
124124

125-
Extends [`http-proxy`](https://github.com/http-party/node-http-proxy#options). Additional options are [here](https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/middlewares/proxy.ts#L13).
125+
Extends [`http-proxy-3`](https://github.com/sagemathinc/http-proxy-3#options). Additional options are [here](https://github.com/vitejs/vite/blob/main/packages/vite/src/node/server/middlewares/proxy.ts#L13).
126126

127127
In some cases, you might also want to configure the underlying dev server (e.g. to add custom middlewares to the internal [connect](https://github.com/senchalabs/connect) app). In order to do that, you need to write your own [plugin](/guide/using-plugins.html) and use [configureServer](/guide/api-plugin.html#configureserver) function.
128128

docs/guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ pnpm link --global # use your preferred package manager for this step
256256
Then go to your Vite based project and run `pnpm link --global vite` (or the package manager that you used to link `vite` globally). Now restart the development server to ride on the bleeding edge!
257257

258258
::: tip Dependencies using Vite
259-
To replace the Vite version used by dependencies transitively, you should use [npm overrides](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#overrides) or [pnpm overrides](https://pnpm.io/package_json#pnpmoverrides).
259+
To replace the Vite version used by dependencies transitively, you should use [npm overrides](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#overrides) or [pnpm overrides](https://pnpm.io/9.x/package_json#pnpmoverrides).
260260
:::
261261

262262
## Community

docs/guide/troubleshooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ You will need to access the file with `http` protocol. The easiest way to achiev
150150

151151
### Outdated pre-bundled deps when linking to a local package
152152

153-
The hash key used to invalidate optimized dependencies depends on the package lock contents, the patches applied to dependencies, and the options in the Vite config file that affects the bundling of node modules. This means that Vite will detect when a dependency is overridden using a feature as [npm overrides](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides), and re-bundle your dependencies on the next server start. Vite won't invalidate the dependencies when you use a feature like [npm link](https://docs.npmjs.com/cli/v9/commands/npm-link). In case you link or unlink a dependency, you'll need to force re-optimization on the next server start by using `vite --force`. We recommend using overrides instead, which are supported now by every package manager (see also [pnpm overrides](https://pnpm.io/package_json#pnpmoverrides) and [yarn resolutions](https://yarnpkg.com/configuration/manifest/#resolutions)).
153+
The hash key used to invalidate optimized dependencies depends on the package lock contents, the patches applied to dependencies, and the options in the Vite config file that affects the bundling of node modules. This means that Vite will detect when a dependency is overridden using a feature as [npm overrides](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides), and re-bundle your dependencies on the next server start. Vite won't invalidate the dependencies when you use a feature like [npm link](https://docs.npmjs.com/cli/v9/commands/npm-link). In case you link or unlink a dependency, you'll need to force re-optimization on the next server start by using `vite --force`. We recommend using overrides instead, which are supported now by every package manager (see also [pnpm overrides](https://pnpm.io/9.x/package_json#pnpmoverrides) and [yarn resolutions](https://yarnpkg.com/configuration/manifest/#resolutions)).
154154

155155
## Performance Bottlenecks
156156

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"docs-serve": "vitepress serve"
99
},
1010
"devDependencies": {
11-
"@shikijs/vitepress-twoslash": "^3.8.0",
11+
"@shikijs/vitepress-twoslash": "^3.8.1",
1212
"@types/express": "^5.0.3",
1313
"feed": "^5.1.0",
1414
"gsap": "^3.13.0",
1515
"vitepress": "^2.0.0-alpha.8",
1616
"vitepress-plugin-group-icons": "^1.6.1",
17-
"vitepress-plugin-llms": "^1.7.0",
17+
"vitepress-plugin-llms": "^1.7.1",
1818
"vue": "^3.5.17"
1919
}
2020
}

0 commit comments

Comments
 (0)