Closed bebraw closed 3 years ago
I will consider supporting Deno 1.4. But I think deno-websocket is losing its existence value due to WebSocket API. https://deno.land/posts/v1.4#websocket-api
Do you need this library?
If I'm interpreting right, that's only the client portion. Please correct me if I'm wrong. 😄
I see! It may be exactly what you say. I will check in detail later.
Cool, it looks like the fix is simple. To be future-compatible, all we have to do is to change the export.
Released v0.0.4. Please confirm it. Then I will update std lib later.
It looks like the current fix fails with
TS1362 [ERROR]: 'WebSocketServer' cannot be used as a value because it was exported using 'export type'.
const wss = new WebSocketServer(8080);
In my local branch, changing deps.ts to
export { EventEmitter } from "https://deno.land/std@0.65.0/node/events.ts";
export { Server, serve } from "https://deno.land/std@0.65.0/http/server.ts";
export {
acceptWebSocket,
isWebSocketCloseEvent,
isWebSocketPingEvent,
isWebSocketPongEvent,
connectWebSocket,
} from "https://deno.land/std@0.65.0/ws/mod.ts";
export type {
WebSocket,
} from "https://deno.land/std@0.65.0/ws/mod.ts";
was enough given WebSocket
is the only type we expose as far as I understand.
I made a mistake. I have fixed it. And I have released v0.0.5.
Great, looks like that one works well. Thanks for the fix. 👍
It looks like Deno 1.4 is stricter with typing.
The fix is to change
WebSocket
to be exported as a type at https://github.com/ryo-ma/deno-websocket/blob/master/deps.ts .More specifically, it looks like the issue originates from https://deno.land/posts/v1.4#stricter-type-checks-in-code--unstablecode (
--unstable
flag).