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

Update WebSocket.binaryType description with the new behavior #1690

Merged
merged 4 commits into from
Aug 13, 2024

Conversation

joanlopez
Copy link
Contributor

What?

It updates the description of WebSocket.binaryType according to the recent changes.

Checklist

  • I have used a meaningful title for the PR.
  • I have described the changes I've made in the "What?" section above.
  • I have performed a self-review of my changes.
  • I have run the npm start command locally and verified that the changes look good.
  • I have made my changes in the docs/sources/next folder of the documentation.
  • I have reflected my changes in the docs/sources/v{most_recent_release} folder of the documentation.
  • I have reflected my changes in the relevant folders of the two previous k6 versions of the documentation (if still applicable to previous versions).
  • I have made my changes in the docs/sources/next folder of the documentation.

Related PR(s)/Issue(s)

@joanlopez joanlopez added the Area:extensions Issues about the extension ecosystem label Aug 12, 2024
@joanlopez joanlopez self-assigned this Aug 12, 2024
Copy link
Collaborator

@heitortsergent heitortsergent left a comment

Choose a reason for hiding this comment

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

Left just a few small comments, overall it looks good! :shipit:

@heitortsergent heitortsergent mentioned this pull request Aug 13, 2024
5 tasks
Co-authored-by: Heitor Tashiro Sergent <[email protected]>
Comment on lines +21 to +25
| Blob.arrayBuffer() | Returns a `Promise` that resolves with the contents of the blob as binary data contained in an `ArrayBuffer`. |
| Blob.bytes() | Returns a `Promise` that resolves with a `Uint8Array` containing the contents of the blob as an array of bytes. |
| Blob.slice() | Returns a new `Blob` object which contains data from a subset of the blob on which it's called. |
| Blob.stream() | Returns a [ReadableStream](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-experimental/streams/readablestream) which upon reading returns the data contained within the `Blob`. |
| Blob.text() | Returns a `Promise` that resolves with a string containing the contents of the blob, interpreted as `UTF-8`. |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you (@mstoykov) think we need specific pages for these methods, as we have for WebSocket methods? 🤔
I'm wondering whether specific examples of each method are really useful. Maybe just slice() which is the only one that can have multiple variants? Or just point to the MDN Web Docs?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that we can do that in a future iteration. Maybe when Blob isn't in this module but globally available.

@joanlopez joanlopez merged commit dde3ddc into main Aug 13, 2024
5 checks passed
@joanlopez joanlopez deleted the ws-binaryType branch August 13, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:extensions Issues about the extension ecosystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants