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 and stablize the Clipboard API #3992

Merged
merged 3 commits into from
Jul 9, 2024
Merged

Conversation

evilpie
Copy link
Contributor

@evilpie evilpie commented Jun 18, 2024

Fixes #3991.

Promise<undefined> writeText(DOMString data);
};

dictionary ClipboardUnsanitizedFormats {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure if I should remove this, because it's Chrome-only.

Copy link
Collaborator

@daxpedda daxpedda Jun 24, 2024

Choose a reason for hiding this comment

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

We generally tend to follow the spec regardless of browser support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a bit of a special case, because this API was merged without consensus, but I don't want to relitigate this here 🫠

Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets leave this part as unstable for sure then.

@evilpie evilpie marked this pull request as draft June 18, 2024 18:58
@evilpie evilpie marked this pull request as ready for review June 18, 2024 19:09
Copy link
Collaborator

@daxpedda daxpedda left a comment

Choose a reason for hiding this comment

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

I don't believe we can stabilize this just yet. Not only is the spec still in draft, but the repo seems quite active as well. I couldn't find any usage data as well.

Do you have any more hints to this API not changing anymore? Preferably usage data, which usually prevents any breaking changes to the API.

@daxpedda daxpedda added the waiting for author Waiting for author to respond label Jun 24, 2024
@evilpie
Copy link
Contributor Author

evilpie commented Jun 29, 2024

The base API for this is shipping in all three major engines, so I don't see how the current API could change.

@daxpedda
Copy link
Collaborator

The base API for this is shipping in all three major engines, so I don't see how the current API could change.

Unfortunately this happens regularly and then we end up stuck with outdated APIs that we can't really fix without a breaking change.

Though I agree that the base API is unlikely to change any further, so what we can do is stabilize parts of it we are more certain then not aren't going to change.

Let me know if you need any help with that!

@evilpie
Copy link
Contributor Author

evilpie commented Jun 30, 2024

I've removed (commented out) everything that isn't supported by Chrome, Firefox and Safari currently.

# [wasm_bindgen (static_method_of = ClipboardItem , js_class = "ClipboardItem" , js_name = supports)]
#[doc = "The `supports()` method."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/supports)"]
Copy link

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

The link is generated, so that would have to be fixed in the generator.
It would be interesting to see if that is an exception for this specific static method or if this actually fixes a bug in the generator.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Addressed in #4010.

@daxpedda daxpedda merged commit d798015 into rustwasm:main Jul 9, 2024
25 checks passed
kegsay pushed a commit to kegsay/wasm-bindgen that referenced this pull request Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for author Waiting for author to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stabilize the Clipboard API
3 participants