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

Hand-crafted WebTransport Web API bindings #129

Merged
merged 12 commits into from
Sep 13, 2024
Merged

Conversation

MOZGIII
Copy link
Owner

@MOZGIII MOZGIII commented Apr 11, 2024

This is a replacement for the web-sys crate (and #117), hard-written instead of being code-generated to overcome the current shortcomings of the wasm_bindgen_webidl codegen and its choices.
See more on that: rustwasm/wasm-bindgen#3921


The rationale for the hard-written bindings are greater for the development experience, since you get the code that doesn't have JsValues as return types - but a much saner types without a need for manual conversion (this is actually something that we had bugs with before), but also performance gains, since we can add final clause to the wasm_bindgen macro invocation for more efficient bindings at the hot I/O paths.

The hand crafted bindings turned out to be much more comprehensive and useful than the generated ones - because the generated bindings just lack some huge parts of the API surface, and other part of the API are simply generated wrong and/or unusable due to invalid assumptions of the code generator. Needless to say, the generated code is just not ergonomic without a real reason for it - must be a shortcoming of the generator, and most likely fixable - see rustwasm/wasm-bindgen#3921.


To do:

  • cleanup unused/empty crates used at the early prototyping stage
  • adjust the crates naming will do this after we ship a release; so in another PR
  • backward compat with web-sys?

@MOZGIII MOZGIII changed the title Create the initial crate structure Dedicated Web API crate Apr 12, 2024
@MOZGIII MOZGIII changed the title Dedicated Web API crate Hand-crafted WebTransport Web API bindings Apr 12, 2024
@MOZGIII MOZGIII force-pushed the web-high-level-crate branch 5 times, most recently from 2154a5e to 892748e Compare April 12, 2024 23:45
@MOZGIII
Copy link
Owner Author

MOZGIII commented Jul 28, 2024

rustwasm/wasm-bindgen#3919 has been merged, we can finally proceed

@MOZGIII
Copy link
Owner Author

MOZGIII commented Aug 6, 2024

Now this is blocked by wasm-bindgen release: rustwasm/wasm-bindgen#3993 (comment)

@MOZGIII
Copy link
Owner Author

MOZGIII commented Aug 17, 2024

Finally this is fully unblocked!

@MOZGIII MOZGIII marked this pull request as ready for review August 27, 2024 22:54
@MOZGIII MOZGIII merged commit 1015b9c into master Sep 13, 2024
21 checks passed
@MOZGIII MOZGIII deleted the web-high-level-crate branch September 13, 2024 20:40
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.

1 participant