Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Buffers to DIVERGENCES.md #13

Merged
merged 1 commit into from
Dec 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion DIVERGENCES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ For interfaces to be considered analogous, there should be some evidence that de
- **Node.js API**: [Node Streams](https://nodejs.org/api/stream.html)
- **Mitigation strategies**: [whatwg-stream](https://github.com/nodejs/whatwg-stream) effort to implement WHATWG Streams as a Node.js module; [`readable-stream`](https://www.npmjs.com/package/readable-stream) provides Node streams for the Web

## Buffers

- **Purpose**: Interaction with octet streams
- **Web API**: [ArrayBuffer API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)
Copy link

@joyeecheung joyeecheung Dec 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe equivalent of Node.js Buffer is Uint8Array, or DataView, or at least ArrayBufferView? (It's like a union of Uint8Array and DataView at this point).

- **Node.js API** [Buffer API](https://nodejs.org/api/buffer.html)
- **Mitigation strategies**: Newer versions of Node.js have [Buffer.from(arrayBuffer)](https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length) method and the `Buffer` is an instance of a [TypedArray](https://nodejs.org/api/buffer.html#buffer_buffers_and_typedarray) with a few caveats.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buffer is specifically, Uint8Array (otherwise this is inconsistent with octet streams mentioned above, although I am not sure if it's accurate to say that Buffers are intended for streams). There is also ongoing effort to support DataView in APIs that accept Buffer.


## HTTP access

- **Purpose**: Open, read and write to an HTTP, HTTPS, HTTP2 connection
Expand All @@ -41,7 +48,7 @@ For interfaces to be considered analogous, there should be some evidence that de

## Cancel[l]ation

- **Purpose**: Provide APIs which cancel asynchronous processes, asynchronous requests, promises, etc.
- **Purpose**: Provide APIs which
- **Web API**: [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)
- **Node API**: ??
- **Mitigation strategies**: ??