Doc updates

This commit is contained in:
Jarred Sumner
2025-10-09 23:37:10 -07:00
parent 98d1a9d110
commit de366cfe4b
2 changed files with 7 additions and 5 deletions

View File

@@ -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<MyData>({...})`. 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<MyData>({...})`. 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`.

View File

@@ -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