Closed andreasgangso closed 2 years ago
Is babel really needed? All the latest browsers supports class extends.
@jthomerson Can this be merged if the conflicts are solved?
@yokuze whether we need Babel or not is a question for you.
Even if babel doesn't add much value in this specific case, it makes development easier when you can use new features without having to think too much about browser support
Thank you for the contribution @andreasgan. Closing this since https://github.com/silvermine/videojs-chromecast/pull/98/ is basically identical and was more recently active.
FWIW, I agree that Babel is necessary. While the ES6 class
keyword has good browser support, ES2022 static
properties and methods (which this PR uses) are not supported in iOS < 14.5, which includes versions of iOS that we target: https://caniuse.com/?search=static%20class
Without Babel, it's easy to let new syntax and built-in methods slip in without knowing that they are incompatible with targeted environments. Babel's transpilation and automatic polyfilling reduces the overhead for contributors and maintainers who would otherwise have to consult the browser support matrix for each non-ES6 syntax and built-in method that they intend to use.
Adds babel and uses es6 classes instead of "class.extend"