Skip to content

Commit 386e86f

Browse files
committed
fix!(core): typo boardcast
1 parent 484d2ef commit 386e86f

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

docs/kit/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ declare module '@vitejs/devtools-kit' {
374374

375375
### Call Client Functions from Server
376376

377-
To call client-side functions from the server, use `ctx.rpc.boardcast()` (note: the method name is `boardcast`, which broadcasts to all connected clients):
377+
To call client-side functions from the server, use `ctx.rpc.broadcast()` (note: the method name is `broadcast`, which broadcasts to all connected clients):
378378

379379
```ts {6-10}
380380
export default function myPlugin(): Plugin {
@@ -383,7 +383,7 @@ export default function myPlugin(): Plugin {
383383
devtools: {
384384
setup(ctx) {
385385
// Broadcast to all connected clients
386-
ctx.rpc.boardcast('my-plugin:client-update', {
386+
ctx.rpc.broadcast('my-plugin:client-update', {
387387
message: 'Hello from server!'
388388
})
389389
},
@@ -392,7 +392,7 @@ export default function myPlugin(): Plugin {
392392
}
393393
```
394394

395-
The `boardcast` method returns a promise that resolves to an array of results from all clients (some may be `undefined` if the client doesn't implement the function).
395+
The `broadcast` method returns a promise that resolves to an array of results from all clients (some may be `undefined` if the client doesn't implement the function).
396396

397397
**Example: Broadcasting dock updates**
398398

@@ -401,7 +401,7 @@ Here's a real-world example of how the built-in docks system broadcasts updates:
401401
```ts
402402
// When a dock entry is updated, broadcast to all clients
403403
docksHost.events.on('dock:entry:updated', () => {
404-
rpcHost.boardcast('vite:internal:docks:updated')
404+
rpcHost.broadcast('vite:internal:docks:updated')
405405
})
406406
```
407407

packages/core/src/node/__tests__/registration-safety.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('registration Safety Integration Tests', () => {
2121
command: 'build',
2222
plugins: [],
2323
} as unknown as ResolvedConfig)
24-
ctx.rpc.boardcast = vi.fn()
24+
ctx.rpc.broadcast = vi.fn()
2525
return ctx
2626
}
2727

packages/core/src/node/context.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ export async function createDevToolsContext(
4646

4747
// Register hosts side effects
4848
docksHost.events.on('dock:entry:updated', debounce(() => {
49-
rpcHost.boardcast('vite:internal:docks:updated')
49+
rpcHost.broadcast('vite:internal:docks:updated')
5050
}, 10))
5151
terminalsHost.events.on('terminal:session:updated', debounce(() => {
52-
rpcHost.boardcast('vite:internal:terminals:updated')
52+
rpcHost.broadcast('vite:internal:terminals:updated')
5353
// New terminals might affect the visibility of the terminals dock entry, we trigger it here as well
54-
rpcHost.boardcast('vite:internal:docks:updated')
54+
rpcHost.broadcast('vite:internal:docks:updated')
5555
}, 10))
5656
terminalsHost.events.on('terminal:session:stream-chunk', (data) => {
57-
rpcHost.boardcast('vite:internal:terminals:stream-chunk', data)
57+
rpcHost.broadcast('vite:internal:terminals:stream-chunk', data)
5858
})
5959

6060
// Register plugins

packages/core/src/node/host-functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class RpcFunctionsHost extends RpcFunctionsCollectorBase<DevToolsRpcServe
1414
super(context)
1515
}
1616

17-
boardcast<
17+
broadcast<
1818
T extends keyof DevToolsRpcClientFunctions,
1919
Args extends Parameters<DevToolsRpcClientFunctions[T]>,
2020
>(

packages/kit/src/types/rpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type RpcFunctionsHost = RpcFunctionsCollectorBase<DevToolsRpcServerFuncti
1818
/**
1919
* Broadcast a message to all connected clients
2020
*/
21-
boardcast: <
21+
broadcast: <
2222
T extends keyof DevToolsRpcClientFunctions,
2323
Args extends Parameters<DevToolsRpcClientFunctions[T]>,
2424
>(

0 commit comments

Comments
 (0)