wasm-bindgen icon indicating copy to clipboard operation
wasm-bindgen copied to clipboard

Generate getters for all WebIDL dictionary types and deprecate builder-pattern style setters

Open daxpedda opened this issue 1 year ago • 1 comments

This introduces getters for all WebIDL dictionary types with the signature get_field(&self) -> Option<Type>. This is unconventional for Rust as usually getters are called just field() and setters are called set_field(), unfortunately we can only do this in the future with a breaking change.

I also went ahead and deprecated the builder-pattern style setters in favor of exposing our currently already generated setters.

Replaces #3933. Fixes #1793.

daxpedda avatar Jun 19 '24 16:06 daxpedda

I forgot to do this earlier, but cc @pablosichert @MOZGIII since you seem to be invested in this.

Liamolucko avatar Jun 25 '24 23:06 Liamolucko

Sorry for being late, but this looks great!

MOZGIII avatar Jul 28 '24 21:07 MOZGIII

When will this be released?

MOZGIII avatar Jul 28 '24 21:07 MOZGIII

Agree, thanks a lot @daxpedda for getting this over the finish line.

I think you struck a good balance of at least deprecating the non-set_* methods so that they can eventually be phased out and make space for the getters.

pablosichert avatar Jul 28 '24 21:07 pablosichert

When will this be released?

I'm going through my wasm-bindgen backlog right now, with luck today, otherwise tomorrow (TM).

daxpedda avatar Jul 28 '24 21:07 daxpedda