Skip to content

Commit 5935619

Browse files
authored
refactor: move framework plugins out of core (#11158)
1 parent c26679a commit 5935619

File tree

248 files changed

+190
-8882
lines changed

Some content is hidden

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

248 files changed

+190
-8882
lines changed

README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,11 @@ In addition, Vite is highly extensible via its [Plugin API](https://vitejs.dev/g
3535

3636
## Packages
3737

38-
| Package | Version (click for changelogs) |
39-
| ------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------- |
40-
| [vite](packages/vite) | [![vite version](https://img.shields.io/npm/v/vite.svg?label=%20)](packages/vite/CHANGELOG.md) |
41-
| [@vitejs/plugin-vue](packages/plugin-vue) | [![plugin-vue version](https://img.shields.io/npm/v/@vitejs/plugin-vue.svg?label=%20)](packages/plugin-vue/CHANGELOG.md) |
42-
| [@vitejs/plugin-vue-jsx](packages/plugin-vue-jsx) | [![plugin-vue-jsx version](https://img.shields.io/npm/v/@vitejs/plugin-vue-jsx.svg?label=%20)](packages/plugin-vue-jsx/CHANGELOG.md) |
43-
| [@vitejs/plugin-react](packages/plugin-react) | [![plugin-react version](https://img.shields.io/npm/v/@vitejs/plugin-react.svg?label=%20)](packages/plugin-react/CHANGELOG.md) |
44-
| [@vitejs/plugin-legacy](packages/plugin-legacy) | [![plugin-legacy version](https://img.shields.io/npm/v/@vitejs/plugin-legacy.svg?label=%20)](packages/plugin-legacy/CHANGELOG.md) |
45-
| [create-vite](packages/create-vite) | [![create-vite version](https://img.shields.io/npm/v/create-vite.svg?label=%20)](packages/create-vite/CHANGELOG.md) |
38+
| Package | Version (click for changelogs) |
39+
| ----------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- |
40+
| [vite](packages/vite) | [![vite version](https://img.shields.io/npm/v/vite.svg?label=%20)](packages/vite/CHANGELOG.md) |
41+
| [@vitejs/plugin-legacy](packages/plugin-legacy) | [![plugin-legacy version](https://img.shields.io/npm/v/@vitejs/plugin-legacy.svg?label=%20)](packages/plugin-legacy/CHANGELOG.md) |
42+
| [create-vite](packages/create-vite) | [![create-vite version](https://img.shields.io/npm/v/create-vite.svg?label=%20)](packages/create-vite/CHANGELOG.md) |
4643

4744
## Contribution
4845

docs/blog/announcing-vite3.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ While working towards Vite 3, we also improved the contributing experience for c
239239
- Vite upgraded to [pnpm 7](https://pnpm.io/), following the rest of the ecosystem.
240240
- Playgrounds have been moved to [`/playgrounds`](https://github.com/vitejs/vite/tree/main/playground) out of packages directory.
241241
- The packages and playgrounds are now `"type": "module"`.
242-
- Plugins are now bundled using [unbuild](https://github.com/unjs/unbuild), and [plugin-vue-jsx](https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx) and [plugin-legacy](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) were moved to TypeScript.
242+
- Plugins are now bundled using [unbuild](https://github.com/unjs/unbuild), and [plugin-vue-jsx](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx) and [plugin-legacy](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) were moved to TypeScript.
243243

244244
## The Ecosystem is Ready for v3
245245

docs/guide/features.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Vite caches dependency requests via HTTP headers, so if you wish to locally edit
2222

2323
## Hot Module Replacement
2424

25-
Vite provides an [HMR API](./api-hmr) over native ESM. Frameworks with HMR capabilities can leverage the API to provide instant, precise updates without reloading the page or blowing away application state. Vite provides first-party HMR integrations for [Vue Single File Components](https://github.com/vitejs/vite/tree/main/packages/plugin-vue) and [React Fast Refresh](https://github.com/vitejs/vite/tree/main/packages/plugin-react). There are also official integrations for Preact via [@prefresh/vite](https://github.com/JoviDeCroock/prefresh/tree/main/packages/vite).
25+
Vite provides an [HMR API](./api-hmr) over native ESM. Frameworks with HMR capabilities can leverage the API to provide instant, precise updates without reloading the page or blowing away application state. Vite provides first-party HMR integrations for [Vue Single File Components](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue) and [React Fast Refresh](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react). There are also official integrations for Preact via [@prefresh/vite](https://github.com/JoviDeCroock/prefresh/tree/main/packages/vite).
2626

2727
Note you don't need to manually set these up - when you [create an app via `create-vite`](./), the selected templates would have these pre-configured for you already.
2828

@@ -120,16 +120,16 @@ declare module '*.svg' {
120120

121121
Vite provides first-class Vue support:
122122

123-
- Vue 3 SFC support via [@vitejs/plugin-vue](https://github.com/vitejs/vite/tree/main/packages/plugin-vue)
124-
- Vue 3 JSX support via [@vitejs/plugin-vue-jsx](https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx)
123+
- Vue 3 SFC support via [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue)
124+
- Vue 3 JSX support via [@vitejs/plugin-vue-jsx](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx)
125125
- Vue 2.7 support via [@vitejs/plugin-vue2](https://github.com/vitejs/vite-plugin-vue2)
126126
- Vue <2.7 support via [vite-plugin-vue2](https://github.com/underfin/vite-plugin-vue2)
127127

128128
## JSX
129129

130130
`.jsx` and `.tsx` files are also supported out of the box. JSX transpilation is also handled via [esbuild](https://esbuild.github.io).
131131

132-
Vue users should use the official [@vitejs/plugin-vue-jsx](https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx) plugin, which provides Vue 3 specific features including HMR, global component resolving, directives and slots.
132+
Vue users should use the official [@vitejs/plugin-vue-jsx](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx) plugin, which provides Vue 3 specific features including HMR, global component resolving, directives and slots.
133133

134134
If not using JSX with React or Vue, custom `jsxFactory` and `jsxFragment` can be configured using the [`esbuild` option](/config/shared-options.md#esbuild). For example for Preact:
135135

docs/guide/ssr.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ If you have questions, the community is usually helpful at [Vite Discord's #ssr
1818

1919
Vite provides built-in support for server-side rendering (SSR). The Vite playground contains example SSR setups for Vue 3 and React, which can be used as references for this guide:
2020

21-
- [Vue 3](https://github.com/vitejs/vite/tree/main/playground/ssr-vue)
22-
- [React](https://github.com/vitejs/vite/tree/main/playground/ssr-react)
21+
- [Vue 3](https://github.com/vitejs/vite-plugin-vue/tree/main/playground/ssr-vue)
22+
- [React](https://github.com/vitejs/vite-plugin-vue/tree/main/playground/ssr-react)
2323

2424
## Source Structure
2525

@@ -177,7 +177,7 @@ Then, in `server.js` we need to add some production specific logic by checking `
177177
178178
- Move the creation and all usage of the `vite` dev server behind dev-only conditional branches, then add static file serving middlewares to serve files from `dist/client`.
179179
180-
Refer to the [Vue](https://github.com/vitejs/vite/tree/main/playground/ssr-vue) and [React](https://github.com/vitejs/vite/tree/main/playground/ssr-react) demos for a working setup.
180+
Refer to the [Vue](https://github.com/vitejs/vite-plugin-vue/tree/main/playground/ssr-vue) and [React](https://github.com/vitejs/vite-plugin-react/tree/main/playground/ssr-react) demos for a working setup.
181181
182182
## Generating Preload Directives
183183
@@ -201,11 +201,11 @@ const html = await vueServerRenderer.renderToString(app, ctx)
201201
// ctx.modules is now a Set of module IDs that were used during the render
202202
```
203203
204-
In the production branch of `server.js` we need to read and pass the manifest to the `render` function exported by `src/entry-server.js`. This would provide us with enough information to render preload directives for files used by async routes! See [demo source](https://github.com/vitejs/vite/blob/main/playground/ssr-vue/src/entry-server.js) for a full example.
204+
In the production branch of `server.js` we need to read and pass the manifest to the `render` function exported by `src/entry-server.js`. This would provide us with enough information to render preload directives for files used by async routes! See [demo source](https://github.com/vitejs/vite-plugin-vue/blob/main/playground/ssr-vue/src/entry-server.js) for a full example.
205205
206206
## Pre-Rendering / SSG
207207
208-
If the routes and the data needed for certain routes are known ahead of time, we can pre-render these routes into static HTML using the same logic as production SSR. This can also be considered a form of Static-Site Generation (SSG). See [demo pre-render script](https://github.com/vitejs/vite/blob/main/playground/ssr-vue/prerender.js) for working example.
208+
If the routes and the data needed for certain routes are known ahead of time, we can pre-render these routes into static HTML using the same logic as production SSR. This can also be considered a form of Static-Site Generation (SSG). See [demo pre-render script](https://github.com/vitejs/vite-plugin-vue/blob/main/playground/ssr-vue/prerender.js) for working example.
209209
210210
## SSR Externals
211211

docs/plugins/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ Check out [Using Plugins](../guide/using-plugins) for information on how to use
88

99
## Official Plugins
1010

11-
### [@vitejs/plugin-vue](https://github.com/vitejs/vite/tree/main/packages/plugin-vue)
11+
### [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue)
1212

1313
- Provides Vue 3 Single File Components support.
1414

15-
### [@vitejs/plugin-vue-jsx](https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx)
15+
### [@vitejs/plugin-vue-jsx](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx)
1616

1717
- Provides Vue 3 JSX support (via [dedicated Babel transform](https://github.com/vuejs/jsx-next)).
1818

19-
### [@vitejs/plugin-react](https://github.com/vitejs/vite/tree/main/packages/plugin-react)
19+
### [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react)
2020

2121
- Provides all-in-one React Support.
2222

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@
114114
"packageManager": "[email protected]",
115115
"pnpm": {
116116
"overrides": {
117-
"vite": "workspace:*",
118-
"@vitejs/plugin-vue": "workspace:*"
117+
"vite": "workspace:*"
119118
},
120119
"packageExtensions": {
121120
"postcss-load-config": {

packages/create-vite/template-react-ts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"devDependencies": {
1616
"@types/react": "^18.0.25",
1717
"@types/react-dom": "^18.0.9",
18-
"@vitejs/plugin-react": "^2.2.0",
18+
"@vitejs/plugin-react": "^3.0.0-alpha.0",
1919
"typescript": "^4.6.4",
2020
"vite": "^3.2.4"
2121
}

packages/create-vite/template-react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"devDependencies": {
1616
"@types/react": "^18.0.25",
1717
"@types/react-dom": "^18.0.9",
18-
"@vitejs/plugin-react": "^2.2.0",
18+
"@vitejs/plugin-react": "^3.0.0-alpha.0",
1919
"vite": "^3.2.4"
2020
}
2121
}

packages/create-vite/template-vue-ts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"vue": "^3.2.45"
1313
},
1414
"devDependencies": {
15-
"@vitejs/plugin-vue": "^3.2.0",
15+
"@vitejs/plugin-vue": "^4.0.0-alpha.0",
1616
"typescript": "^4.6.4",
1717
"vite": "^3.2.4",
1818
"vue-tsc": "^1.0.9"

packages/create-vite/template-vue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"vue": "^3.2.45"
1313
},
1414
"devDependencies": {
15-
"@vitejs/plugin-vue": "^3.2.0",
15+
"@vitejs/plugin-vue": "^4.0.0-alpha.0",
1616
"vite": "^3.2.4"
1717
}
1818
}

0 commit comments

Comments
 (0)