Vigia

Atualizar ws de 7.x para 8.x

Comparação da API pública de ws 7.5.13 e 8.22.0, calculada automaticamente a partir dos tipos TypeScript. Uma assinatura alterada é uma possível mudança incompatível, não uma certeza.

Resumo

Caminhos de importação removidos0
Exports removidos1
Assinaturas alteradas2
Membros de classes ou interfaces removidos0
Membros de classes ou interfaces alterados13
Novas descontinuações0
Mudanças de requisitos (engines, dependências peer)2
Novos exports6

Exports removidos

importexportkindAntes
wsOpenEventinterfaceinterface

Assinaturas alteradas

exportAntesDepois
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

Membros de classes ou interfaces removidos

Nenhuma detectada.

Membros de classes ou interfaces alterados

memberAntesDepois
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

Novas descontinuações

Nenhuma detectada.

Mudanças de requisitos (engines, dependências peer)

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

Perguntas frequentes

Quais são as mudanças incompatíveis ao atualizar ws de 7 para 8?

Entre ws 7.5.13 e 8.22.0, o Vigia encontrou 1 exports removidos, 2 assinaturas alteradas e 13 membros de classes ou interfaces removidos ou alterados.

O que foi descontinuado em ws 8?

0 exports ou membros foram marcados como descontinuados em ws 8.22.0.

Para agentes

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