Memperbarui ws dari 7.x ke 8.x
Perbandingan API publik ws 7.5.13 dan 8.23.0, dihitung otomatis dari tipe TypeScript-nya. Tanda tangan yang berubah adalah kemungkinan perubahan tidak kompatibel, bukan kepastian.
Ringkasan
| Jalur impor yang dihapus | 0 |
|---|---|
| Ekspor yang dihapus | 1 |
| Tanda tangan yang berubah | 2 |
| Anggota kelas atau antarmuka yang dihapus | 0 |
| Anggota kelas atau antarmuka yang berubah | 13 |
| Baru ditandai usang | 0 |
| Perubahan persyaratan (engines, dependensi peer) | 3 |
| Ekspor baru | 6 |
Ekspor yang dihapus
| import | export | kind | Sebelum |
|---|---|---|---|
ws | OpenEvent | interface | interface |
Tanda tangan yang berubah
| export | Sebelum | Sesudah |
|---|---|---|
ws · VerifyClientCallbackSync | (info: { origin: string; secure: boolean; req: IncomingMessage; }) => boolean | (info: { origin: string; secure: boolean; req: Request; }) => boolean |
ws · VerifyClientCallbackAsync | (info: { origin: string; secure: boolean; req: IncomingMessage; }, callback: (res: boolean, code?: number | undefined, message?: string | undefined, headers?: any) => void) => void | (info: { origin: string; secure: boolean; req: Request; }, callback: (res: boolean, code?: number | undefined, message?: string | undefined, headers?: any) => void) => void |
Anggota kelas atau antarmuka yang dihapus
Tidak ada yang terdeteksi.
Anggota kelas atau antarmuka yang berubah
| member | Sebelum | Sesudah |
|---|---|---|
Server.on | (event: "connection", cb: (this: Server, socket: WebSocket, request: IncomingMessage) => void): Server | (event: "error", cb: (this: Server, error: Error) => void): Server | (event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): Server | (event: "close" | "liste… | (event: "connection", cb: (this: Server<T, any>, websocket: InstanceType<T>, request: InstanceType<U>) => void): Server<T, U> | (event: "error", cb: (this: Server<T, any>, error: Error) => void): Server<T, U> | (event: "headers", cb: (this: Server<T, any>, headers: string[], request: InstanceType<U>… |
Server.off | (event: "connection", cb: (this: Server, socket: WebSocket, request: IncomingMessage) => void): Server | (event: "error", cb: (this: Server, error: Error) => void): Server | (event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): Server | (event: "close" | "liste… | (event: "connection", cb: (this: Server<T, any>, socket: InstanceType<T>, request: InstanceType<U>) => void): Server<T, U> | (event: "error", cb: (this: Server<T, any>, error: Error) => void): Server<T, U> | (event: "headers", cb: (this: Server<T, any>, headers: string[], request: InstanceType<U>) =… |
Server.once | (event: "connection", cb: (this: Server, socket: WebSocket, request: IncomingMessage) => void): Server | (event: "error", cb: (this: Server, error: Error) => void): Server | (event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): Server | (event: "close" | "liste… | (event: "connection", cb: (this: Server<T, any>, websocket: InstanceType<T>, request: InstanceType<U>) => void): Server<T, U> | (event: "error", cb: (this: Server<T, any>, error: Error) => void): Server<T, U> | (event: "headers", cb: (this: Server<T, any>, headers: string[], request: InstanceType<U>… |
Server.address | (): string | AddressInfo | (): string | AddressInfo | null |
Server.clients | Set<WebSocket> | Set<InstanceType<T>> |
Server.options | ServerOptions | ServerOptions<T, U> |
Server.addListener | (event: "connection", cb: (client: WebSocket, request: IncomingMessage) => void): Server | (event: "error", cb: (err: Error) => void): Server | (event: "headers", cb: (headers: string[], request: IncomingMessage) => void): Server | (event: "close" | "listening", cb: () => void): Server | (event: str… | (event: "connection", cb: (websocket: InstanceType<T>, request: InstanceType<U>) => void): Server<T, U> | (event: "error", cb: (error: Error) => void): Server<T, U> | (event: "headers", cb: (headers: string[], request: InstanceType<U>) => void): Server<T, U> | (event: "close" | "listening", cb: () =… |
Server.constructor | (options?: ServerOptions | undefined, callback?: (() => void) | undefined): Server | <T extends typeof WebSocket.WebSocket = typeof WebSocket, U extends typeof IncomingMessage = any>(options?: ServerOptions<T, U> | undefined, callback?: (() => void) | undefined): Server<T, U> |
Server.shouldHandle | (request: IncomingMessage): boolean | Promise<boolean> | (request: InstanceType<U>): boolean | Promise<boolean> |
Server.handleUpgrade | (request: IncomingMessage, socket: Socket, upgradeHead: Buffer, callback: (client: WebSocket, request: IncomingMessage) => void): void | (request: InstanceType<U>, socket: Duplex, upgradeHead: Buffer, callback: (client: InstanceType<T>, request: InstanceType<U>) => void): void |
Server.removeListener | (event: "connection", cb: (client: WebSocket) => void): Server | (event: "error", cb: (err: Error) => void): Server | (event: "headers", cb: (headers: string[], request: IncomingMessage) => void): Server | (event: "close" | "listening", cb: () => void): Server | (event: string | symbol, listener: (.… | (event: "connection", cb: (websocket: InstanceType<T>, request: InstanceType<U>) => void): Server<T, U> | (event: "error", cb: (error: Error) => void): Server<T, U> | (event: "headers", cb: (headers: string[], request: InstanceType<U>) => void): Server<T, U> | (event: "close" | "listening", cb: () =… |
ServerOptions.verifyClient | VerifyClientCallbackSync | VerifyClientCallbackAsync | undefined | VerifyClientCallbackAsync<InstanceType<V>> | VerifyClientCallbackSync<InstanceType<V>> | undefined |
ServerOptions.handleProtocols | any | ((protocols: Set<string>, request: InstanceType<V>) => string | false) | undefined |
Baru ditandai usang
Tidak ada yang terdeteksi.
Perubahan persyaratan (engines, dependensi peer)
| Sebelum | Sesudah | |
|---|---|---|
engines.node | >=8.3.0 | — |
peerDependencies.bufferutil | ^4.0.1 | — |
peerDependencies.utf-8-validate | ^5.0.2 | — |
Ekspor baru (6)
| import | export | kind |
|---|---|---|
ws | Event | interface |
ws | RawData | type |
ws | WebSocket | interface |
ws | WebSocketServer | interface |
ws | WebSocketEventMap | interface |
ws | FinishRequestCallback | type |
Berikan fakta ini ke agen AI Anda
Vigia adalah server MCP gratis: agen coding Anda memeriksa versi, perubahan yang merusak kompatibilitas, dan kerentanan sebelum menulis kode. Tanpa pendaftaran, tanpa kunci API.
claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp
Tambahkan ke CursorTambahkan ke VS Code★ Bintang di GitHub
Klien MCP lainnya
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }Skill agen (SKILL.md): memberi tahu agen kapan memakai Vigia · GitHub Action untuk pull request
Pertanyaan umum
Apa saja perubahan tidak kompatibel saat memperbarui ws dari 7 ke 8?
Antara ws 7.5.13 dan 8.23.0, Vigia menemukan 1 ekspor yang dihapus, 2 tanda tangan yang berubah, dan 13 anggota kelas atau antarmuka yang dihapus atau berubah.
Apa yang ditandai usang di ws 8?
0 ekspor atau anggota baru ditandai usang di ws 8.23.0.
Untuk agen
GET https://vigia.coredls.cloud/v1/packages/npm/ws/upgrade?from=7.5.13&to=8.23.0