Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Do we want Babel-polyfill? #269

Open
allquixotic opened this issue Jan 25, 2016 · 3 comments
Open

Do we want Babel-polyfill? #269

allquixotic opened this issue Jan 25, 2016 · 3 comments

Comments

@allquixotic
Copy link

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.

@Zirak
Copy link
Owner

Zirak commented Jan 25, 2016

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.

@Zirak
Copy link
Owner

Zirak commented Jan 25, 2016

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 d54aa2d to be merged into master.

@allquixotic
Copy link
Author

I'll have a look at the browserify branch "soon" (™).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants