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

web-sys: Added Streams API #3065

Merged
merged 11 commits into from Sep 6, 2022
Merged

web-sys: Added Streams API #3065

merged 11 commits into from Sep 6, 2022

Conversation

rozbb
Copy link
Contributor

@rozbb rozbb commented Sep 3, 2022

Builds on revert #3064. This adds the Streams API again, but without the API-breaking [Throws] attributes

@rozbb
Copy link
Contributor Author

rozbb commented Sep 3, 2022

Note that the current diff view is wrt main as opposed to #3064

@rozbb
Copy link
Contributor Author

rozbb commented Sep 4, 2022

Also, it'd be nice if someone could cut a new web-sys version some time soon :)
For a Yew website, the build process when switching to HEAD requires adding 4 patch lines and reinstalling wasm-bindgen-cli to match the new verison.

@rozbb
Copy link
Contributor Author

rozbb commented Sep 5, 2022

Thanks for being so thorough! I've gone through and removed all the unnecessary [Throws]. Just wanted to double check two instances:

  1. The definition of WriteableStream.abort (and other aborts) is
If ! IsWritableStreamLocked(this) is true, return a promise rejected with a TypeError exception.

Does this count as a Throw? I don't think it does.

  1. The member readonly attribute Function size is defined as
Return this's relevant global object's count queuing strategy size function.

This is also not a throwing function, right?

@Liamolucko
Copy link
Collaborator

1. The definition of `WriteableStream.abort` (and other `abort`s) is
If ! IsWritableStreamLocked(this) is true, return a promise rejected with a TypeError exception.

Does this count as a Throw? I don't think it does.

No, it doesn't, since marking it [Throws] would be interpreted as a synchronous error.

2. The member `readonly attribute Function size` is defined as
Return this's relevant global object's count queuing strategy size function.

This is also not a throwing function, right?

Yes. The returned function could throw, but getting it can't.

Copy link
Collaborator

@Liamolucko Liamolucko left a comment

Choose a reason for hiding this comment

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

I've just noticed one more thing that I don't think can throw, but after that I think this should be good to merge.

I didn't go through all of them, I just glanced at the ones which weren't duplicated across types (so i.e. not close, enqueue etc.)

crates/web-sys/webidls/enabled/Streams.webidl Outdated Show resolved Hide resolved
@rozbb
Copy link
Contributor Author

rozbb commented Sep 5, 2022

Thanks again, good catch. Should be fixed now.

Copy link
Collaborator

@Liamolucko Liamolucko left a comment

Choose a reason for hiding this comment

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

Thanks for all your work on this! And sorry about the whole fuss with having to revert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants