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

State of polyfills and browser support #5447

Open
mrxz opened this issue Feb 6, 2024 · 0 comments
Open

State of polyfills and browser support #5447

mrxz opened this issue Feb 6, 2024 · 0 comments

Comments

@mrxz
Copy link
Contributor

mrxz commented Feb 6, 2024

Description:
There are several polyfills present in A-Frame, many of which are already quite dated. Several of them can probably be removed, but it mostly depends on the relevancy of the (old) browsers/devices that are still intended to be supported. AFAIK there is no set browserlist, but that might be a good idea going forwards.

Here's an overview of the polyfills:

Polyfill API(s) Caniuse % Notes
@ungap/custom-elements Custom Elements 78.83% + 18.5% = 97.33% only for IE (Safari doesn't support customized built-in elements, but A-Frame does not require this)
custom-event-polyfill CustomEvent 98.05% + 0.49% = 98.54% only for IE 9+
object-assign Object.assign 96.61% ponyfill, only for IE
present Performance.now 97.22% ⚠️ Also polyfilled by rStats.js
promise-polyfill Promise 97.89% only for IE
webvr-polyfill WebVR 2.92% + 2.49% = 5.41% contrary to what caniuse reports, FF has it disabled by default and requires specific flag to enable

Three.js has already dropped support for IE 11, so simply following suit, virtually all above mentioned polyfills can be removed as well. If a user does want to go through the pain of targetting IE 11, they can always load the needed polyfills themselves.

As for WebVR (polyfill), it would be nice to be able to get rid of it. There's quite a bit of duplicate code logic/paths due to supporting both WebVR and WebXR. I wouldn't be surprised if WebVR support is (subtly) broken in places.

Thoughts?

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

No branches or pull requests

1 participant