Do we want Babel-polyfill?
As I understand it, Babel-polyfill can support promises, plus basically everything in ES6.
https://babeljs.io/docs/usage/polyfill/
The reasons I bring this up:
- With the existing browser options (run it in your own browser as a bookmarklet or use PhantomJS 2.x), if you run an old browser or use PhantomJS, Number.isFinite, among other ES6 features, is not supported. Breaks substitution and coffeescript, at least. This polyfill will fix it. See evidence of Cavil choking when running PhantomJS 2.0 and 2.1.
- We want to use promises, per #264.
- Even with the future run-headless rewrite I'm working on, we can't guarantee that whatever browser the user selects is going to support (all of) ES6. So, going forward, the polyfill may be generally useful.
I believe the polyfill is smart enough to just use the native implementation if there is one, so it should have minimal impact on performance for modern browsers with good ES6 support.
We can simply use babel as a build step, though let's first agree which runtime we want to use in headless mode.
In a related note, run-headless isn't the long term solution. Because I don't actively work on the bot it may practically be what we use for the forseeable future, but the goal is #1.
Using babel as a build step is a decent idea but I don't want to do that on the current master, rather wait for d54aa2d7e80a271e20bb69cfb8b3571de9186158 to be merged into master.
I'll have a look at the browserify branch "soon" (™).