Atualizar ws de 7.x para 8.x
Comparação da API pública de ws 7.5.13 e 8.23.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 removidos | 0 |
|---|---|
| Exports removidos | 1 |
| Assinaturas alteradas | 2 |
| Membros de classes ou interfaces removidos | 0 |
| Membros de classes ou interfaces alterados | 13 |
| Novas descontinuações | 0 |
| Mudanças de requisitos (engines, dependências peer) | 3 |
| Novos exports | 6 |
Exports removidos
| import | export | kind | Antes |
|---|---|---|---|
ws | OpenEvent | interface | interface |
Assinaturas alteradas
| export | Antes | Depois |
|---|---|---|
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
| member | Antes | Depois |
|---|---|---|
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 |
Novas descontinuações
Nenhuma detectada.
Mudanças de requisitos (engines, dependências peer)
| Antes | Depois | |
|---|---|---|
engines.node | >=8.3.0 | — |
peerDependencies.bufferutil | ^4.0.1 | — |
peerDependencies.utf-8-validate | ^5.0.2 | — |
Novos exports (6)
| import | export | kind |
|---|---|---|
ws | Event | interface |
ws | RawData | type |
ws | WebSocket | interface |
ws | WebSocketServer | interface |
ws | WebSocketEventMap | interface |
ws | FinishRequestCallback | type |
Dê estes dados ao seu agente de IA
Vigia é um servidor MCP gratuito: seu agente de programação verifica versões, mudanças incompatíveis e vulnerabilidades antes de escrever código. Sem cadastro, sem chave de API.
claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp
Adicionar ao CursorAdicionar ao VS Code★ Estrela no GitHub
Qualquer outro cliente MCP
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }Skill para agentes (SKILL.md): diz ao agente quando usar o Vigia · GitHub Action para pull requests
Perguntas frequentes
Quais são as mudanças incompatíveis ao atualizar ws de 7 para 8?
Entre ws 7.5.13 e 8.23.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.23.0.
Para agentes
GET https://vigia.coredls.cloud/v1/packages/npm/ws/upgrade?from=7.5.13&to=8.23.0