aframe icon indicating copy to clipboard operation
aframe copied to clipboard

Remove WebVR support and polyfill

Open mrxz opened this issue 1 year ago • 12 comments

Description: This PR removes WebVR support and WebVR polyfill (#5447), leaving only the WebXR code paths. This allows quite a lot of code to be removed and simplified. Especially the various device-controls components. While making the adjustments to the controllers and their unit tests it became painfully clear that there are many inconsistencies in the way controllers are handled. Many of them also exhibit changed behaviour compared to WebVR (e.g. naming of buttons changed), which showed as regressions in the unit tests.

Marked as a draft as this PR will require extensive reviewing/testing. Seeing the poor state of the controller components and their associated tests, I'll probably create separate PRs that focus on moving the unit tests over to WebXR, followed by simplifying/fixing the controller components, which will leave this PR purely with the WebVR removal.

Changes proposed:

  • Remove WebVR polyfill
  • Remove WebVR code paths/support
  • Update all controls components to only support/use WebXR
  • Changed unit test to test WebXR behaviour, while removing ones the only applied to WebVR

mrxz avatar Feb 08 '24 14:02 mrxz

Not sure if ready to remove WebVR yet because of Firefox.

dmarcos avatar Feb 08 '24 23:02 dmarcos

firefox reality is now https://www.wolvic.com/en/ and they support webxr

arpu avatar Feb 09 '24 00:02 arpu

firefox reality is now https://www.wolvic.com/en/ and they support webxr

Meant Firefox desktop

dmarcos avatar Feb 09 '24 01:02 dmarcos

Meant Firefox desktop

@dmarcos Firefox desktop has WebVR disabled by default since 98 (link). It can be enabled by setting dom.vr.enabled and one of dom.vr.openvr/osvr.enabled manually. Though, personally whenever I do use Firefox for this I enable the (albeit somewhat incomplete) WebXR implementation (dom.vr.webxr) instead.

mrxz avatar Feb 09 '24 09:02 mrxz

This needs rebase. Also cardboard support is still around albeit disabled by default. Heard of some people still using it

dmarcos avatar Feb 22 '24 18:02 dmarcos

This needs rebase

dmarcos avatar Feb 23 '24 21:02 dmarcos

@dmarcos Rebased.

Also cardboard support is still around albeit disabled by default. Heard of some people still using it

One option for cardboard users could be to use the webxr-polyfill, which uses the same underlying cardboard-vr library as the webvr-polyfill currently does. Should just be a matter of including and initializing it before A-Frame. Instructions for it could be included in the release notes and/or noted somewhere in the documentation.

In any case, cardboard doesn't need WebVR controller support, so those changes can be done regardless.

mrxz avatar Feb 24 '24 15:02 mrxz

Let me know if you want me to split off a PR that focusses on removing the WebVR controller logic.

mrxz avatar Feb 27 '24 12:02 mrxz

as reference Babylon removed it with 7.0.0 https://github.com/BabylonJS/Babylon.js/releases/tag/7.0.0 Remove deprecated WebVR - [Breaking Change]

arpu avatar Mar 28 '24 12:03 arpu

Can I bump this PR? I believe I am currently experiencing issues where my Firefox (beta) for Android mobile is breaking because of the PolyFill.

Failed to recalculate device parameters. webvr-polyfill.js:1945:12
    Aframe 7
        recalculateDeviceParams_
        ge
        Xe
        getPolyfillDisplays
        getVRDisplays
        c
        5579
    Webpack 5
        n
        <anonymous>
        <anonymous>
        <anonymous>
        <anonymous>

danineuss avatar Jun 13 '24 12:06 danineuss

@danineuss what A-Frame version?

dmarcos avatar Jun 13 '24 13:06 dmarcos

Version 1.6.0 does still use the polyfills (or at least that is what the log says). But I believe I could fix the issue in the meantime. Thank you so much for your quick reply and continued effort in this wonderful framework 🙏🏽

On June 13, 2024, radioman85 @.***> wrote:

@danineuss https://github.com/danineuss what A-Frame version?

— Reply to this email directly, view it on GitHub https://github.com/aframevr/aframe/pull/5451#issuecomment-2165605727, or unsubscribe <https://github.com/notifications/unsubscribe- auth/ADUA74YHTHYG7Q3LMROLPRTZHGJ43AVCNFSM6AAAAABC7Z54JGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRVGYYDKNZSG4>. You are receiving this because you were mentioned.Message ID: @.***>

danineuss avatar Jun 13 '24 16:06 danineuss