Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge supports ES6, but not object spread operator #173

Closed
keanulee opened this issue Apr 18, 2018 · 5 comments
Closed

Edge supports ES6, but not object spread operator #173

keanulee opened this issue Apr 18, 2018 · 5 comments
Assignees

Comments

@keanulee
Copy link
Contributor

Currently we have the js.compile option which is either true (es5 output) or false (es6 output). While Edge supports es6, it does not support newer syntax such as object spread. We either need to add more granular JS build settings or update browser capabilities for Edge.

@aomarks
Copy link
Member

aomarks commented Apr 19, 2018

Currently, js.compile = false means "do not compile". It does not mean produce es6. Neither async/await nor object-rest-spread are part of es6, they are part of es2017 and es2018 respectively. There's also the exponentiation operator in es2016.

Proposal:

  • Add an es6 option (or maybe es2015 since that's what we call it in browser-capabilities) to compile, which will transpile to es6 (meaning just async/await, object-rest-spread, exponentiation, and whatever lands in Babel from es2018 onwards down the road).

  • We can either leave false as-is (no compilation), or interpret it as an alias for es6. If we did that, as time goes on, we would presumably want to bump the meaning of false to capture the "minimally compiled for the main evergreen browsers" setting. We could also deprecate true|false altogether, and add an explicit none value so that this is not ambiguous.

The other thing to consider here is moving to babel-preset-env. If we integrated this, you would configure very specific browser requirements (e.g."last 2 versions, ie 10") and we would then transpile to a build with the lowest common denominator of features needed for those browsers. Probably not something I would want to do in the next few weeks timeframe, though.

@aomarks
Copy link
Member

aomarks commented Apr 19, 2018

cc @frankiefu

@TimvdLippe
Copy link
Contributor

TimvdLippe commented Apr 19, 2018 via email

@keanulee
Copy link
Contributor Author

Adding js.compile = 'es2015' (to align with brower-capabilities) SGTM, with js.compile = true being the same as today (optionally add 'es5' alias for the same thing). I think js.compile = false (or undefined) should remain as "do nothing" so its meaning doesn't constantly update.

babel-preset-env would be nice to have in the future, but probably too much for now.

@keanulee
Copy link
Contributor Author

For reference, desktop Safari 11.0.3 (previous stable version) also doesn't support object spread. Like Edge, it will getting the es6-bundled build (not esm-bundled since it doesn't have import.meta), so that build should definitely have object spread transformed.

eugenepeh pushed a commit to reposense/RepoSense that referenced this issue Jul 30, 2018
Microsoft Edges does not support the full set of features available in
the ES6 specification, amongst which, includes the object spread
operator. [1]

Let's remove the usage of the object spread operator so allow the
dashboard to be run from edge browser.

[1] Discussion on Edge's support for object spread operator
Polymer/tools#173
yamidark pushed a commit to yamidark/RepoSense that referenced this issue Aug 15, 2018
Microsoft Edges does not support the full set of features available in
the ES6 specification, amongst which, includes the object spread
operator. [1]

Let's remove the usage of the object spread operator so allow the
dashboard to be run from edge browser.

[1] Discussion on Edge's support for object spread operator
Polymer/tools#173
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants