lbryio / lbry-desktop

A browser and wallet for LBRY, the decentralized, user-controlled content marketplace.
https://lbry.tech
MIT License
3.56k stars 413 forks source link

lazy loading causes error on browsers that don't support polyfill #6002

Closed tzarebczan closed 2 years ago

tzarebczan commented 3 years ago

This happens on older browsers with our lazy loading (https://github.com/lbryio/lbry-desktop/pull/5840) that don't have polyfill support. image

Revert for now? Support fall back if errors?

DispatchCommit commented 3 years ago

Just polyfill more if it's a common issue?

https://cdn.polyfill.io/v3/

<script src="https://polyfill.io/v3/polyfill.min.js?features=IntersectionObserver"></script>

Intersection observer was added in Safari 12.1+, the above polyfill adds support to Safari 6+, which was released in 2012. There's probably a cleaner way with webpack / babel too.

kauffj commented 3 years ago

if this is only broken in 8 year old browsers I think we can do nothing

DispatchCommit commented 3 years ago

I think I saw that safari 12.1 which is the first version of safari that supports intersectionobserver was released in 2018, making it a 3-4 year old browser issue. It's a fractional percentage of all browser usage so we don't need to worry too much about it, but the polyfill I mentioned would support back up to 8 year old browsers.

I think installing chrome/chromium-based browser on an older device would also solve this issue though.

tzarebczan commented 3 years ago

It's also affecting newer mobile users, and @infinite-persistence thinks it could be causing the memory issues Safari users are seeing.

Maybe he can try and test this, or we can disable on certain devices/browsers?