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

Make return types of SubtleCrypto methods more specific #388

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

twiss
Copy link
Member

@twiss twiss commented Dec 19, 2024

Also, reformat the WebIDL.

Resolves #293.


Preview | Diff

@twiss twiss requested review from annevk and saschanaz December 19, 2024 13:24
Copy link
Member

@saschanaz saschanaz left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

Is there a reason to keep the methods multiline? Pretty much every other specification I know keeps these on a single line.

I did not check all methods in detail, but those I did check seemed to line up type-wise with how we resolve the promises in WebKit. Our IDL uses any however and I'm not sure we'd get benefit from types, but still seems like an improvement.

@twiss
Copy link
Member Author

twiss commented Dec 19, 2024

Mainly just readability I'd say; the declarations end up being really long when put on a single line, and will become even more so if we add #73 (comment), where a single parameter might be a BufferSource or an iterable or async iterable of BufferSources.

@annevk
Copy link
Member

annevk commented Dec 19, 2024

Hmm, but do we want to build on the current API shape? Filed #389 on that.

@twiss
Copy link
Member Author

twiss commented Dec 19, 2024

I'll make a PR to find out whether folks are happy with that, if that doesn't end up happening we can always reconsider here :)

@twiss twiss merged commit 0ac8c1b into main Dec 19, 2024
2 checks passed
@twiss twiss deleted the specific-return-types branch December 19, 2024 16:30
github-actions bot added a commit that referenced this pull request Dec 19, 2024
SHA: 0ac8c1b
Reason: push, by twiss

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Define return types of SubtleCrypto methods with more specific types
3 participants