Shaka-player: ECMAScript 6?

Created on 28 Nov 2017  路  6Comments  路  Source: google/shaka-player

What do you guys think of refactoring the code from ES5 to ES6?

archived code health

Most helpful comment

We could move to ES6 without dropping IE11 support, by changing the way we develop. Uncompiled mode is the issue. In uncompiled mode, ES6 code won't run on IE11. If we are compiling ES6 down to ES5, we can still develop in ES6 and run compiled ES5 on IE11.

All 6 comments

At the moment we still support IE 11, and IE 11 does not support ES6 and (presumably) never will.

Maybe at some point in the future we will stop supporting IE 11 and upgrade everything to ES6. Perhaps if, once the Shaka Player survey has ended, we find that not many people care about IE 11 support? I can't make any promises, of course.

We could move to ES6 without dropping IE11 support, by changing the way we develop. Uncompiled mode is the issue. In uncompiled mode, ES6 code won't run on IE11. If we are compiling ES6 down to ES5, we can still develop in ES6 and run compiled ES5 on IE11.

This will be a long transition. In particular, replacing the linter will be a giant pain.

Checklist for ES6 conversion:

  • [x] Use Babel to serve ES5 in unit tests, so we can still test uncompiled code on IE11
  • [x] Disallow uncompiled build in the demo app on IE11
  • [x] Allow ES6 input in the compiler settings
  • [x] Replace the long-deprecated gjslint with modern JS linters that understand ES6

    • [ ] Refine linter settings and convert code to pass

    • [ ] Reimplement property doc enforcement for typedefs (in jsdoc fork? as eslint plugin?)

  • [ ] Start converting library code to ES6 syntax
  • [ ] Polyfill some ES6 methods and lift some of the bans in build/conformance.textproto

ES6 work and linter changes cherry-picked to v2.3.1 to make it easier to cherry-pick bug fixes from after these ES6 changes.

Until https://github.com/google/closure-compiler/issues/893 is resolved, we can't use ES6 syntax in our externs.

ES6 is now possible in externs! If it doesn't work right away, we may need a compiler update.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

interpegasus picture interpegasus  路  3Comments

gabor picture gabor  路  3Comments

EstebanBP picture EstebanBP  路  4Comments

alexandercerutti picture alexandercerutti  路  5Comments

diogoazevedos picture diogoazevedos  路  4Comments