feat(rpc): export RpcClient from main entry point (#374)

This commit is contained in:
YHH
2025-12-28 14:09:16 +08:00
committed by GitHub
parent 1316d7de49
commit a000cc07d7
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
---
"@esengine/rpc": patch
---
feat: export RpcClient and connect from main entry point
Re-export `RpcClient`, `connect`, and related types from the main entry point for better compatibility with bundlers (Cocos Creator, Vite, etc.) that may have issues with subpath exports.
```typescript
// Now works in all environments:
import { rpc, RpcClient, connect } from '@esengine/rpc';
// Subpath import still supported:
import { RpcClient } from '@esengine/rpc/client';
```

View File

@@ -40,3 +40,7 @@
export { rpc } from './define'
export * from './types'
// Re-export client for browser/bundler compatibility
export { RpcClient, connect } from './client/index'
export type { RpcClientOptions, WebSocketAdapter, WebSocketFactory } from './client/index'