From de366cfe4b7bb65d83c2d40d7d946ec9592bc329 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 9 Oct 2025 23:37:10 -0700 Subject: [PATCH] Doc updates --- docs/api/websockets.md | 2 +- docs/install/isolated.md | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/api/websockets.md b/docs/api/websockets.md index 69ffb403bf..d20cbeea84 100644 --- a/docs/api/websockets.md +++ b/docs/api/websockets.md @@ -151,7 +151,7 @@ Bun.serve({ ``` {% callout %} -**Note:** Previously, you could specify the type of `ws.data` using a generic on `Bun.serve`, like `Bun.serve({...})`. This pattern is now deprecated in favor of the `data` property shown above. +**Note:** Previously, you could specify the type of `ws.data` using a type parameter on `Bun.serve`, like `Bun.serve({...})`. This pattern was removed due to [a limitation in TypeScript](https://github.com/microsoft/TypeScript/issues/26242) in favor of the `data` property shown above. {% /callout %} To connect to this server from the browser, create a new `WebSocket`. diff --git a/docs/install/isolated.md b/docs/install/isolated.md index 0cc06c9722..d58be16c35 100644 --- a/docs/install/isolated.md +++ b/docs/install/isolated.md @@ -36,7 +36,10 @@ linker = "isolated" ### Default behavior -By default, Bun uses the **hoisted** installation strategy for all projects. To use isolated installs, you must explicitly specify the `--linker isolated` flag or set it in your configuration file. +- **Workspaces**: Bun uses **isolated** installs by default to prevent hoisting-related bugs +- **Single projects**: Bun uses **hoisted** installs by default + +To override the default, use `--linker hoisted` or `--linker isolated`, or set it in your configuration file. ## How isolated installs work @@ -174,14 +177,13 @@ The main difference is that Bun uses symlinks in `node_modules` while pnpm uses ## When to use isolated installs -**Use isolated installs when:** +**Isolated installs are the default for workspaces.** You may want to explicitly enable them for single projects when: -- Working in monorepos with multiple packages - Strict dependency management is required - Preventing phantom dependencies is important - Building libraries that need deterministic dependencies -**Use hoisted installs when:** +**Switch to hoisted installs (including for workspaces) when:** - Working with legacy code that assumes flat `node_modules` - Compatibility with existing build tools is required