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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

MOZGIII
Copy link
Owner

@MOZGIII MOZGIII commented Apr 11, 2024

Blocked by: rustwasm/wasm-bindgen#3919


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

Currently requires a custom wasm_bindgen with rustwasm/wasm-bindgen#3919 applied.


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.

@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
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.

None yet

1 participant