GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: implement WebSocketStream by KhafraDev · Pull Request #3560 · nodejs/undici Conversation
|
|
@nodejs/undici This passes the same subset of WebSocketStream tests that Deno passes. It's missing types and docs now. Looking for code reviews before doing the trivial stuff. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| try { | ||
| string = webidl.converters.USVString(chunk) | ||
| } catch (e) { | ||
| return Promise.reject(e) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
couldnt we reuse the already created deferred promise?
return promise.reject(e)
?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I wanted to test the WebSocketError thing i mentioned above and found this. const { WebSocketError } = require('./lib/web/websocket/stream/websocketerror'); console.log(Object.keys(new WebSocketError('asd'))); It is not possible to instantiate WebSocketError by requiring the file alone. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
A limitation of cjs - there isn't much we can do about shared webidl declarations. If we moved them to webidl.js, we'd have circular imports, if we move them to another file, we have to import another file. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return | ||
| } | ||
| } else if (type === opcodes.BINARY) { | ||
| chunk = new Uint8Array(data.buffer, data.byteOffset, data.byteLength) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
| chunk = new Uint8Array(data.buffer, data.byteOffset, data.byteLength) | |
| chunk = data.byteLength === data.buffer.byteLength ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength) : new Uint8Array(data) |
Copy buffer if needed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
please approve so I can land... nits can wait, this is experimental I want to make websocket PRs but I don't want to manage multiple branches at once. ty |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.