Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v6 - Environment API #16471

Draft
wants to merge 58 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
b41895c
docs: environment API migration guide stub
patak-dev Apr 19, 2024
f684d4c
feat: environment api (#16129)
patak-dev Apr 19, 2024
777967d
docs: Environment API (#16089)
patak-dev Apr 19, 2024
ad2b0bf
chore: remove configureServer from more plugins
patak-dev Apr 19, 2024
5f6b62f
chore: rename plugin.split to plugin.create
patak-dev Apr 19, 2024
431cd4b
fix: export missing types
patak-dev Apr 19, 2024
635aad5
release: v6.0.0-alpha.3
patak-dev Apr 20, 2024
d7c6fc4
docs: Environment(name, config) update
patak-dev Apr 20, 2024
1904acd
docs: remove alternatives section from the docs, better to keep that …
patak-dev Apr 20, 2024
d4b155c
docs: update to latest implementation
patak-dev Apr 20, 2024
5c5efe4
fix(v6): fix `ssrEmitAssets` compat (#16480)
hi-ogawa Apr 21, 2024
2a3bcb3
chore: merge main
patak-dev Apr 22, 2024
29dd26e
refactor: build --app
patak-dev Apr 22, 2024
33ef0fb
fix: disable hmr for ssrLoadModule
sheremet-va Apr 22, 2024
bf65476
chore: remove the deprecation notice from ssrLoadModule for now
sheremet-va Apr 22, 2024
9d6a152
refactor: remove server from createServerModuleRunner
sheremet-va Apr 22, 2024
7099e12
docs: create plugin hook
patak-dev Apr 24, 2024
4cf322d
fix(cli): ->
patak-dev Apr 26, 2024
4dc2a75
refactor: rename createViteBuilder to createBuilder, align with creat…
patak-dev Apr 26, 2024
41a95ae
chore: lint
patak-dev Apr 26, 2024
8843221
feat: use environment.logger in buildEnvironment
patak-dev Apr 26, 2024
62921e6
refactor: align createBuilder params with createServer
patak-dev Apr 26, 2024
294a84e
fix: backcompat merging
patak-dev Apr 26, 2024
2866d4f
feat: opt-in shared plugins during build
patak-dev Apr 26, 2024
a63190c
fix: sharedPlugins
patak-dev Apr 26, 2024
1925eeb
feat: builder.entireApp, remove --environment
patak-dev Apr 26, 2024
72150d6
fix: rework backcompat patching of environment config
patak-dev Apr 26, 2024
064f747
chore: merge main
patak-dev Apr 26, 2024
e6fa9d9
release: v6.0.0-alpha.4
patak-dev Apr 26, 2024
a44810a
fix: use environment.plugins during build, support create hook
patak-dev Apr 26, 2024
a8adcac
release: v6.0.0-alpha.5
patak-dev Apr 26, 2024
00079da
fix: custom environment preload injection (#16541)
hi-ogawa Apr 28, 2024
e8473a6
release: v6.0.0-alpha.6
patak-dev Apr 28, 2024
a6fc1dd
feat: this.environment in renderChunk and generateBundle
patak-dev Apr 29, 2024
8231283
feat: remove config.build from dynamicImportVars plugin
patak-dev Apr 29, 2024
bda0dc5
feat: this.environment in buildStart, rework more internal plugins
patak-dev Apr 29, 2024
05943cf
release: v6.0.0-alpha.7
patak-dev Apr 29, 2024
7566aae
feat: define and html plugins
patak-dev Apr 29, 2024
30b2da7
docs: environment.config -> environment.options
patak-dev Apr 29, 2024
527621e
refactor: environment hooks guard
patak-dev Apr 29, 2024
12d467f
fix: keep plugins with create hook
patak-dev Apr 30, 2024
1d9caef
release: v6.0.0-alpha.8
patak-dev Apr 30, 2024
f6dce10
chore: update
patak-dev May 1, 2024
1bcb67d
refactor: move reload on tsconfig change to the server
patak-dev May 1, 2024
6b74221
refactor: bounded plugins factory instead of create hook
patak-dev May 1, 2024
b8ef8ff
fix: module-runner bundle issue with chokidar dep
patak-dev May 1, 2024
d54a88e
chore: merge main
patak-dev May 1, 2024
a09353e
chore: fix lock
patak-dev May 1, 2024
848af54
fix: lint
patak-dev May 1, 2024
2e6abb3
release: v6.0.0-alpha.9
patak-dev May 1, 2024
d213865
feat: sharedDuringBuild for bounded plugins
patak-dev May 2, 2024
57871a4
release: v6.0.0-alpha.10
patak-dev May 2, 2024
35d2d87
docs: shared during build plugins
patak-dev May 2, 2024
1ec07a4
refactor: BoundedPlugin -> IsolatedPlugin
patak-dev May 2, 2024
cf9a79c
chore: merge main
patak-dev May 2, 2024
372a3ad
chore: merge main
patak-dev May 4, 2024
8851d9d
release: v6.0.0-alpha.11
patak-dev May 4, 2024
ffb4aa7
docs: add a note about the "run" method
sheremet-va May 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/.vitepress/config.ts
Expand Up @@ -281,8 +281,8 @@ export default defineConfig({
link: '/guide/api-javascript',
},
{
text: 'Vite Runtime API',
link: '/guide/api-vite-runtime',
text: 'Vite Environment API',
link: '/guide/api-vite-environment',
},
{
text: 'Config Reference',
Expand Down
2 changes: 0 additions & 2 deletions docs/blog/announcing-vite5-1.md
Expand Up @@ -56,8 +56,6 @@ The new API brings many benefits:

The initial idea [was proposed by Pooya Parsa](https://github.com/nuxt/vite/pull/201) and implemented by [Anthony Fu](https://github.com/antfu) as the [vite-node](https://github.com/vitest-dev/vitest/tree/main/packages/vite-node#readme) package to [power Nuxt 3 Dev SSR](https://antfu.me/posts/dev-ssr-on-nuxt) and later also used as the base for [Vitest](https://vitest.dev). So the general idea of vite-node has been battle-tested for quite some time now. This is a new iteration of the API by [Vladimir Sheremet](https://github.com/sheremet-va), who had already re-implemented vite-node in Vitest and took the learnings to make the API even more powerful and flexible when adding it to Vite Core. The PR was one year in the makings, you can see the evolution and discussions with ecosystem maintainers [here](https://github.com/vitejs/vite/issues/12165).

Read more in the [Vite Runtime API guide](/guide/api-vite-runtime) and [give us feedback](https://github.com/vitejs/vite/discussions/15774).

## Features

### Improved support for `.css?url`
Expand Down
8 changes: 8 additions & 0 deletions docs/config/build-options.md
Expand Up @@ -192,10 +192,18 @@ When set to `true`, the build will also generate an SSR manifest for determining

Produce SSR-oriented build. The value can be a string to directly specify the SSR entry, or `true`, which requires specifying the SSR entry via `rollupOptions.input`.

## build.emitAssets

- **Type:** `boolean`
- **Default:** `false`

During non-client builds, static assets aren't emitted as it is assumed they would be emitted as part of the client build. This option allows frameworks to force emitting them in other environments build. It is responsibility of the framework to merge the assets with a post build step.

## build.ssrEmitAssets

- **Type:** `boolean`
- **Default:** `false`
- **Deprecated:** use `build.emitAssets`

During the SSR build, static assets aren't emitted as it is assumed they would be emitted as part of the client build. This option allows frameworks to force emitting them in both the client and SSR build. It is responsibility of the framework to merge the assets with a post build step.

Expand Down
1 change: 1 addition & 0 deletions docs/guide/api-javascript.md
Expand Up @@ -135,6 +135,7 @@ interface ViteDevServer {
/**
* Programmatically resolve, load and transform a URL and get the result
* without going through the http request pipeline.
* @deprecated use environment.transformRequest
*/
transformRequest(
url: string,
Expand Down
924 changes: 924 additions & 0 deletions docs/guide/api-vite-environment.md

Large diffs are not rendered by default.

236 changes: 0 additions & 236 deletions docs/guide/api-vite-runtime.md

This file was deleted.