From 8b33ca271c7901bf28c000627c638d1640c6277f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Tue, 20 Aug 2024 23:12:29 +0900 Subject: [PATCH] docs: update misc (#17863) --- docs/.vitepress/config.ts | 2 +- docs/changes/hotupdate-hook.md | 2 +- docs/changes/this-environment-in-hooks.md | 4 ++-- docs/guide/api-vite-environment.md | 6 ------ docs/public/_redirects | 3 +++ 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 4fb6f0fcd951df..91760e5d61b6d3 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -262,7 +262,7 @@ export default defineConfig({ link: '/guide/philosophy', }, { - text: 'Migration from v4', + text: 'Migration from v5', link: '/guide/migration', }, { diff --git a/docs/changes/hotupdate-hook.md b/docs/changes/hotupdate-hook.md index 168e09bbcfa26e..df43ecd8d4b015 100644 --- a/docs/changes/hotupdate-hook.md +++ b/docs/changes/hotupdate-hook.md @@ -6,7 +6,7 @@ Give us feedback at [Environment API feedback discussion](https://github.com/vit 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` +Affected scope: `Vite Plugin Authors` ::: 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. diff --git a/docs/changes/this-environment-in-hooks.md b/docs/changes/this-environment-in-hooks.md index b3fee1182ae57a..30f5d485f02971 100644 --- a/docs/changes/this-environment-in-hooks.md +++ b/docs/changes/this-environment-in-hooks.md @@ -27,8 +27,8 @@ export function myPlugin(): Plugin { return { name: 'my-plugin', resolveId(id, importer, options) { - const isSSR = options.ssr // [!CODE --] - const isSSR = this.environment.name !== 'client' // [!CODE ++] + const isSSR = options.ssr // [!code --] + const isSSR = this.environment.name !== 'client' // [!code ++] if (isSSR) { // SSR specific logic diff --git a/docs/guide/api-vite-environment.md b/docs/guide/api-vite-environment.md index 17b3598a0e76ed..f7d33af5775311 100644 --- a/docs/guide/api-vite-environment.md +++ b/docs/guide/api-vite-environment.md @@ -92,12 +92,6 @@ class DevEnvironment { * modules are already processed when they are requested. */ async warmupRequest(url: string): void - - /** - * Fetch information about a module from the module runner without running it. - * Note: This method may not be needed - */ - async fetchModuleInfo(url: string) } ``` diff --git a/docs/public/_redirects b/docs/public/_redirects index 1333c17f342027..561711a9f9bf57 100644 --- a/docs/public/_redirects +++ b/docs/public/_redirects @@ -1,2 +1,5 @@ # temporary, we'll flip this around some day https://vite.dev/* https://vitejs.dev/:splat 302! + +/guide/api-vite-runtime /guide/api-vite-environment 302 +/guide/api-vite-runtime.html /guide/api-vite-environment 302