Vigia

Memperbarui ws dari 7.x ke 8.x

Perbandingan API publik ws 7.5.13 dan 8.22.0, dihitung otomatis dari tipe TypeScript-nya. Tanda tangan yang berubah adalah kemungkinan perubahan tidak kompatibel, bukan kepastian.

Ringkasan

Jalur impor yang dihapus0
Ekspor yang dihapus1
Tanda tangan yang berubah2
Anggota kelas atau antarmuka yang dihapus0
Anggota kelas atau antarmuka yang berubah13
Baru ditandai usang0
Perubahan persyaratan (engines, dependensi peer)2
Ekspor baru6

Ekspor yang dihapus

importexportkindSebelum
wsOpenEventinterfaceinterface

Tanda tangan yang berubah

exportSebelumSesudah
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

memberSebelumSesudah
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.clientsSet<WebSocket>Set<InstanceType<T>>
Server.optionsServerOptionsServerOptions<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.verifyClientVerifyClientCallbackSync | VerifyClientCallbackAsync | undefinedVerifyClientCallbackAsync<InstanceType<V>> | VerifyClientCallbackSync<InstanceType<V>> | undefined
ServerOptions.handleProtocolsany((protocols: Set<string>, request: InstanceType<V>) => string | false) | undefined

Baru ditandai usang

Tidak ada yang terdeteksi.

Perubahan persyaratan (engines, dependensi peer)

SebelumSesudah
engines.node>=8.3.0>=10.0.0
peerDependencies.utf-8-validate^5.0.2>=5.0.2
Ekspor baru (6)
importexportkind
wsEventinterface
wsRawDatatype
wsWebSocketinterface
wsWebSocketServerinterface
wsWebSocketEventMapinterface
wsFinishRequestCallbacktype

Pertanyaan umum

Apa saja perubahan tidak kompatibel saat memperbarui ws dari 7 ke 8?

Antara ws 7.5.13 dan 8.22.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.22.0.

Untuk agen

GET https://vigia.coredls.cloud/v1/packages/npm/ws/upgrade?from=7.5.13&to=8.22.0