Skip to content

Commit

Permalink
docs: move stages table into future deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
patak-dev committed Jul 20, 2024
1 parent 024fe62 commit 87bfdec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 37 deletions.
12 changes: 3 additions & 9 deletions docs/changes/vt001.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@
Give us feedback at [Environment API feedback discussion](https://github.com/vitejs/vite/discussions/16358)
:::

::: warning Future Deprecation
The deprecation is planned in the future, where you could start migrating your plugin to use the new API if you move fast. To identify your usage, set `future.deprecationWarnings.pluginHookSsrArgument` to `true` in your vite config.
:::

Before Vite 6, only two environments were available: `client` and `ssr`. A single `options.ssr` plugin hook argument in `resolveId`, `load` and `transform` allowed plugin authors to differentiate between these two environments when processing modules in plugin hooks. In Vite 6, a Vite application can define any number of named environments as needed. We're introducing `this.environment` in the plugin context to interact with the environment of the current module in hooks.

Affect scope: `Vite Plugin Authors`

| Stages | Version |
| ---------------- | ---------------------------------------- |
| First Introduced | `v6.0.0` |
| Deprecation | (planned in `v7.0.0`) |
| Feature Removal | (currently no plan to remove completely) |
::: warning Future Deprecation
`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.deprecationWarnings.pluginHookSsrArgument` to `true` in your vite config.
:::

## Motivation

Expand Down
12 changes: 3 additions & 9 deletions docs/changes/vt002.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@
Give us feedback at [Environment API feedback discussion](https://github.com/vitejs/vite/discussions/16358)
:::

::: warning Future Deprecation
The deprecation is planned for the future. We don't yet recommend moving away from `hotUpdate` until enough users have moved to a version that has the new API. If you want to experiment and give us feedback, you can use the `future.deprecationWarnings.pluginHookHandleHotUpdate` to `true` in your vite config.
:::

We're planing to deprecate the `handleHotUpdate` plugin hook in favor of [`hotUpdate` hook](/guide/api-vite-environment#the-hotupdate-hook) to be [Environment API](/guide/api-vite-environment.md) aware, and handle additional watch events with `create` and `delete`.

Affected: `Vite Plugin Authors`

| Stages | Version |
| ---------------- | ---------------------------------------- |
| First Introduced | `v6.0.0` |
| Deprecation | (planned in `v7.0.0`) |
| Feature Removal | (currently no plan to remove completely) |
::: warning Future Deprecation
`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.deprecationWarnings.pluginHookHandleHotUpdate` to `true` in your vite config.
:::

## Motivation

Expand Down
12 changes: 3 additions & 9 deletions docs/changes/vt003.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,16 @@
Give us feedback at [Environment API feedback discussion](https://github.com/vitejs/vite/discussions/16358)
:::

::: warning Future Deprecation
The deprecation is planned in the future, where you could start migrating your plugin to use the new API if you move fast. To identify your usage, set `future.deprecationWarnings` in your vite config.
:::

Multiple APIs from ViteDevServer related to module graph has replaced with more isolated Environment APIs.

- `server.moduleGraph` -> [`environment.moduleGraph`](/guide/api-vite-environment#separate-module-graphs)
- `server.transformRequest` -> `environment.transformRequest`

Affect scope: `Vite Plugin Authors`

| Stages | Version |
| ---------------- | ---------------------------------------- |
| First Introduced | `v6.0.0` |
| Deprecation | (planned in `v7.0.0`) |
| Feature Removal | (currently no plan to remove completely) |
::: warning Future Deprecation
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 `future.deprecationWarnings` in your vite config.
:::

## Motivation

Expand Down
14 changes: 4 additions & 10 deletions docs/changes/vt004.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@
Give us feedback at [Environment API feedback discussion](https://github.com/vitejs/vite/discussions/16358)
:::

::: tip Future Deprecation
The deprecation is planned in the future, where you could start migrating your plugin to use the new API if you move fast. To identify your usage, set `future.deprecationWarnings.ssrLoadModule` to `true` in your vite config.
:::

`server.ssrLoadModule` has been replaced new [Module Runner](/guide/api-vite-environment#modulerunner).
`server.ssrLoadModule` has been replaced by [Module Runner](/guide/api-vite-environment#modulerunner).

Affect scope: `Vite Plugin Authors`

| Stages | Version |
| ---------------- | ---------------------------------------- |
| First Introduced | `v6.0.0` |
| Deprecation | (planned in `v7.0.0`) |
| Feature Removal | (currently no plan to remove completely) |
::: warning Future Deprecation
`ModuleRunner` was first introduce in `v6.0`. The deprecation of `server.ssrLoadModule` is planned for a future major. To identify your usage, set `future.deprecationWarnings.ssrLoadModule` to `true` in your vite config.
:::

## Motivation

Expand Down

0 comments on commit 87bfdec

Please sign in to comment.