Closed Ethan-Arrowood closed 10 months ago
IMO it should be a Socket
global and Socket.connect()
returns an instance of Socket
.
Ahh, I seem to have missed that in the spec, I will fix it.
The connect
method isn't global anymore, in Cloudflare's case it is part of the cloudflare:socket
module. I'll have the spec describe it as being part of the sockets
module, but we can bikeshed on the name if this clashes with anything or there is a better name for it.
The spec dictates that the
connect
method should be globally available. I think this may inhibit adoption; especially in Node.js. It may be worth reconsidering, or at least providing some alternative. Or at the minimum, maybe we bring this up to Node.js and see what their initial thoughts are (happy to start this conversation). In general, globals concern me as we work to become interoperable between Node/Deno/Bun/Workerd/etc.