Aktualizacja ws z 7.x do 8.x
Porównanie publicznego API ws 7.5.13 i 8.23.0, obliczone automatycznie na podstawie typów TypeScript. Zmieniona sygnatura to możliwa zmiana niekompatybilna, a nie pewność.
Podsumowanie
| Usunięte ścieżki importu | 0 |
|---|---|
| Usunięte eksporty | 1 |
| Zmienione sygnatury | 2 |
| Usunięte składowe klas lub interfejsów | 0 |
| Zmienione składowe klas lub interfejsów | 13 |
| Nowo wycofane | 0 |
| Zmiany wymagań (engines, zależności peer) | 3 |
| Nowe eksporty | 6 |
Usunięte eksporty
| import | export | kind | Przed |
|---|---|---|---|
ws | OpenEvent | interface | interface |
Zmienione sygnatury
| export | Przed | Po |
|---|---|---|
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 |
Usunięte składowe klas lub interfejsów
Nie wykryto.
Zmienione składowe klas lub interfejsów
| member | Przed | Po |
|---|---|---|
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 |
Nowo wycofane
Nie wykryto.
Zmiany wymagań (engines, zależności peer)
| Przed | Po | |
|---|---|---|
engines.node | >=8.3.0 | — |
peerDependencies.bufferutil | ^4.0.1 | — |
peerDependencies.utf-8-validate | ^5.0.2 | — |
Nowe eksporty (6)
| import | export | kind |
|---|---|---|
ws | Event | interface |
ws | RawData | type |
ws | WebSocket | interface |
ws | WebSocketServer | interface |
ws | WebSocketEventMap | interface |
ws | FinishRequestCallback | type |
Przekaż te dane swojemu agentowi AI
Vigia to darmowy serwer MCP: Twój agent programistyczny sprawdza wersje, zmiany łamiące zgodność i podatności, zanim napisze kod. Bez rejestracji i klucza API.
claude mcp add --transport http vigia https://vigia.coredls.cloud/mcp
Dodaj do CursorDodaj do VS Code★ Gwiazdka na GitHubie
Dowolny inny klient MCP
{ "mcpServers": { "vigia": { "url": "https://vigia.coredls.cloud/mcp" } } }Skill dla agentów (SKILL.md): mówi agentowi, kiedy używać Vigii · GitHub Action dla pull requestów
Najczęściej zadawane pytania
Jakie są zmiany niekompatybilne przy aktualizacji ws z 7 do 8?
Między ws 7.5.13 a 8.23.0 Vigia znalazła 1 usuniętych eksportów, 2 zmienionych sygnatur i 13 usuniętych lub zmienionych składowych klas lub interfejsów.
Co zostało wycofane w ws 8?
0 eksportów lub składowych oznaczono w ws 8.23.0 jako wycofane.
Dla agentów
GET https://vigia.coredls.cloud/v1/packages/npm/ws/upgrade?from=7.5.13&to=8.23.0