diff --git a/docs/guide/api-environment-runtimes.md b/docs/guide/api-environment-runtimes.md index 9fa18ada5c589e..b887b1ad0df933 100644 --- a/docs/guide/api-environment-runtimes.md +++ b/docs/guide/api-environment-runtimes.md @@ -80,7 +80,7 @@ A Vite dev server exposes two environments by default: a `client` environment an The transformed source code is called a module, and the relationships between the modules processed in each environment are kept in a module graph. The transformed code for these modules is sent to the runtimes associated with each environment to be executed. When a module is evaluated in the runtime, its imported modules will be requested triggering the processing of a section of the module graph. -A Vite Module Runner allows running any code by processing it with Vite plugins first. It is different from `server.ssrLoadModule` because the runner implementation is decoupled from the server. This allows library and framework authors to implement their layer of communication between the Vite server and the runner. The browser communicates with its corresponding environment using the server Web Socket and through HTTP requests. The Node Module runner can directly do function calls to process modules as it is running in the same process. Other environments could run modules connecting to a JS runtime like workerd, or a Worker Thread as Vitest does. +A Vite Module Runner allows running any code by processing it with Vite plugins first. It is different from `server.ssrLoadModule` because the runner implementation is decoupled from the server. This allows library and framework authors to implement their layer of communication between the Vite server and the runner. The browser communicates with its corresponding environment using the server WebSocket and through HTTP requests. The Node Module runner can directly do function calls to process modules as it is running in the same process. Other environments could run modules connecting to a JS runtime like workerd, or a Worker Thread as Vitest does. One of the goals of this feature is to provide a customizable API to process and run code. Users can create new environment factories using the exposed primitives. diff --git a/docs/guide/api-javascript.md b/docs/guide/api-javascript.md index a933cd6eb7bb0f..3816a30727c4cb 100644 --- a/docs/guide/api-javascript.md +++ b/docs/guide/api-javascript.md @@ -114,7 +114,7 @@ interface ViteDevServer { */ watcher: FSWatcher /** - * Web socket server with `send(payload)` method. + * WebSocket server with `send(payload)` method. */ ws: WebSocketServer /** diff --git a/docs/guide/api-plugin.md b/docs/guide/api-plugin.md index 82e81567921a8f..a35fc0d21b0ba8 100644 --- a/docs/guide/api-plugin.md +++ b/docs/guide/api-plugin.md @@ -286,7 +286,7 @@ Vite plugins can also provide hooks that serve Vite-specific purposes. These hoo **Storing Server Access** - In some cases, other plugin hooks may need access to the dev server instance (e.g. accessing the web socket server, the file system watcher, or the module graph). This hook can also be used to store the server instance for access in other hooks: + In some cases, other plugin hooks may need access to the dev server instance (e.g. accessing the WebSocket server, the file system watcher, or the module graph). This hook can also be used to store the server instance for access in other hooks: ```js const myPlugin = () => { diff --git a/packages/vite/src/node/server/index.ts b/packages/vite/src/node/server/index.ts index 78adcdee296dfe..7d250a68a8ff41 100644 --- a/packages/vite/src/node/server/index.ts +++ b/packages/vite/src/node/server/index.ts @@ -275,7 +275,7 @@ export interface ViteDevServer { */ watcher: FSWatcher /** - * web socket server with `send(payload)` method + * WebSocket server with `send(payload)` method */ ws: WebSocketServer /**