Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMake it possible to feature-gate some web apis #20475
Open
Comments
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently the webidl bindings are generated from
component/dom/build.rswhich in turn invokescmakeoncomponents/script/CMakeLists.txt: this creates the list of all webidl interfaces as dependencies and then run a python script to finally generate the Rust bindings!This setup makes it difficult to cleanly disable apis that we may not want in some situations, like custom embeddings or when porting to new platforms where there is eg. not yet a Bluetooth backend, or no VR support.
Instead, we should get rid of the whole
cmakepart, and implement the same features incomponent/dom/build.rs. The dependencies are simple enough that we don't really need a fully featured dependency resolver although something like https://docs.rs/solvent/0.8.1/solvent/ could be useful.Once this first step is done and we are at parity with the current build system, we'll add a way to filter out webidls based on features. We could use a configuration file, with a syntax like:
Getting disabled features to build and work properly will also include some refactoring of the relevant integration.
cc @mamins1376 and @jdm