servo / servo

Servo, the embeddable, independent, memory-safe, modular, parallel web rendering engine
https://servo.org
Mozilla Public License 2.0
27.9k stars 2.98k forks source link

Put webxr behind a feature #33464

Open mcclure opened 5 days ago

mcclure commented 5 days ago

In order to create a servo frontend, it is necessary to create an EmbedderMethods object. To do this, you must implement a register_webxr() function which takes a webxr::MainThreadRegistry object.

https://github.com/servo/servo/blob/9f2306f76095cf81d299d0c977490803f5703c75/components/compositing/windowing.rs#L220

This requires including an entire other repo

webxr = { git = "https://github.com/servo/webxr" }

I am writing a servo frontend which cannot, even in principle, support webxr. My register_webxr function will always be blank, but I still must include the webxr crate just so I can implement the callback in which I do nothing.

I suggest that webxr be made a default-enabled cargo "feature", and the register_webxr function elided when this feature is not enabled.

jschwe commented 2 days ago

I opened zulip thread about this a while back, and there wasn't really any opposition, so probably all it needs is for someone to actually make a PR