rustwasm / wasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript
https://rustwasm.github.io/docs/wasm-bindgen/
Apache License 2.0
7.43k stars 1.02k forks source link

Stabilize Web Animations API functions #3988

Open luxalpa opened 2 weeks ago

luxalpa commented 2 weeks ago

Motivation

I am not entirely sure what the process is for removing cfg(web_sys_unstable_apis) or how the WebIDL works, but according to MDN, parts of the Web Animations API such as animate are in Baseline since 1.5 years ago and not experimental.

Proposed Solution

Remove #[cfg(web_sys_unstable_apis)] from the supposedly stable Web Animations API functions such as animate and KeyframeOptions

Alternatives

I am currently using these functions with the unstable flag, but the flag itself is a big hassle to deal with, resulting in bugs from rust-analyzer on VSCode, RustRover and Cranelift. While this is more of a problem of those respective tools, I'd like to avoid having to deal with those issues if I can.

Additional Context

I'm using these for building a crate for Animation components for the Leptos web framework.

daxpedda commented 1 week ago

I don't think we can really stabilize this, the spec still has a lot of movement.

There might some more baseline spec out there I'm not aware of that is more stable. Alternatively we could explore stabilizing only certain parts we can be quite sure won't change.

I'm happy to review a PR doing that and outlining why some APIs are unlikely to change.

I am not entirely sure what the process is for removing cfg(web_sys_unstable_apis)

Moving the relevant file to the enabled folder and regenerating the APIs.

I am currently using these functions with the unstable flag, but the flag itself is a big hassle to deal with, resulting in bugs from rust-analyzer on VSCode, RustRover and Cranelift.

I'm not familiar with RustRover, but Rust Analyzer should be easy to solve. You could either use .cargo/config.tomls build.rustflags or tell Rust Analyzer to add the flag in its configuration.