You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All other broken browsers: es6-shim doesn't polyfill Symbol and we have a few occurence of Symbol.iterator in the framework.
Internally, es6-shim uses a string if it doesn't exist, but doesn't expose it.
Issue opened for that: Expose Symbol.iterator paulmillr/es6-shim#360
Yes, Symbol can't actually be emulated on older browsers, so it is not implemented by the shim. There's an es6-sham class that might be appropriate, though, but caveat user.
Out of curiosity -- why are you moving to es6-shim? What did you use before, and why did you switch? (I ask as a contributor to both es6-shim and core-js.)
Sorry for the pain @Mlaval, I wasn't aware of the other browser runs (hard to keep track of things outside whatever travis runs). Given that Symbol.iterator is claimed to be a infeasible runtime shim, I wonder how did traceur make it work. If they did some compile time tricks, we can talk to TS folks about replicating them (depending on complexity). The other option is see if we can remove Symbol.iterate, or gracefully degrade for older browsers, i.e. Query is not iterable.
@cscott We used traceur-runtime before as we were doing traceur transpilation. I am not aware of the pros and cons of es6-shim vs core-js (noone else on the team had opinions about them either) so I just picked one. I would love to hear your take on it. Note that the framework doesn't mandate the use either shim (or any shim), we just need to pick one for our examples and unit tests.
If you were using traceur before, you should use core-js now.
On Sep 16, 2015 6:56 PM, "Rado Kirov" [email protected] wrote:
Sorry for the pain @Mlavalhttps://github.com/mlaval, I wasn't aware of
the other browser runs (hard to keep track of things outside whatever
travis runs). Given that Symbol.iterator is claimed to be a infeasible
runtime shim, I wonder how did traceur make it work. If they did some
compile time tricks, we can talk to TS folks about replicating them
(depending on complexity). The other option is see if we can remove
Symbol.iterate, or gracefully degrade for older browsers, i.e. Query is
not iterable.
@cscotthttps://github.com/cscott We used traceur-runtime before as we
were doing traceur transpilation. I am not aware of the pros and cons of
es6-shim vs core-js (noone else on the team had opinions about them
either) so I just picked one. I would love to hear your take on it. Note
that the framework doesn't mandate the use either shim (or any shim), we
just need to pick one for our examples and unit tests.
—
Reply to this email directly or view it on GitHub #4216 (comment).
Elaborating slightly: core-js was originally written for Babel, so it fits in better as a complete es6 runtime. See google/traceur-compiler#1976 for example: traceur itself might be using core-js under the hood before long.
es6-shim's goals are deliberately more modest: not to implement all of ES6, just the "es5 compatible subset". Basically the low-hanging fruit from the es6 spec, and deliberately skipping all the bits which require runtime support, or which can't be perfectly implemented on an es5 runtime (like Symbol). This might be a good thing if you were starting from scratch---it ensures perfect browser compatibility with no hidden gotchas---but you've already got dependencies on an es6 runtime, like Symbol, so it might be more trouble than it's worth to take them out.
If you wanted to scrub the es6isms from your code, es6-shim will help you keep it that way. If you want things to "just work", core-js will get you there.
One other nice feature of core-js is its modularity: it is easy to use particular es6 features without polluting the global environment. For library code, this can be a big win.
Core-js also seems to be slightly faster. es6-shim might have a slightly more complete test suite.
Activity
cscott commentedon Sep 16, 2015
Yes,
Symbolcan't actually be emulated on older browsers, so it is not implemented by the shim. There's anes6-shamclass that might be appropriate, though, but caveat user.cscott commentedon Sep 16, 2015
Out of curiosity -- why are you moving to
es6-shim? What did you use before, and why did you switch? (I ask as a contributor to bothes6-shimandcore-js.)marclaval commentedon Sep 16, 2015
We used to use Traceur, so the shims were provided by the runtime.
@rkirov did the switch in #4148, I guess he can satisfy your curiosity
rkirov commentedon Sep 16, 2015
Sorry for the pain @Mlaval, I wasn't aware of the other browser runs (hard to keep track of things outside whatever travis runs). Given that
Symbol.iteratoris claimed to be a infeasible runtime shim, I wonder how did traceur make it work. If they did some compile time tricks, we can talk to TS folks about replicating them (depending on complexity). The other option is see if we can remove Symbol.iterate, or gracefully degrade for older browsers, i.e.Queryis not iterable.@cscott We used
traceur-runtimebefore as we were doing traceur transpilation. I am not aware of the pros and cons ofes6-shimvscore-js(noone else on the team had opinions about them either) so I just picked one. I would love to hear your take on it. Note that the framework doesn't mandate the use either shim (or any shim), we just need to pick one for our examples and unit tests.cscott commentedon Sep 17, 2015
If you were using traceur before, you should use core-js now.
On Sep 16, 2015 6:56 PM, "Rado Kirov" [email protected] wrote:
cscott commentedon Sep 17, 2015
Elaborating slightly: core-js was originally written for Babel, so it fits in better as a complete es6 runtime. See google/traceur-compiler#1976 for example: traceur itself might be using core-js under the hood before long.
es6-shim's goals are deliberately more modest: not to implement all of ES6, just the "es5 compatible subset". Basically the low-hanging fruit from the es6 spec, and deliberately skipping all the bits which require runtime support, or which can't be perfectly implemented on an es5 runtime (like Symbol). This might be a good thing if you were starting from scratch---it ensures perfect browser compatibility with no hidden gotchas---but you've already got dependencies on an es6 runtime, like Symbol, so it might be more trouble than it's worth to take them out.
If you wanted to scrub the es6isms from your code, es6-shim will help you keep it that way. If you want things to "just work", core-js will get you there.
One other nice feature of core-js is its modularity: it is easy to use particular es6 features without polluting the global environment. For library code, this can be a big win.
Core-js also seems to be slightly faster. es6-shim might have a slightly more complete test suite.
zloirock commentedon Sep 17, 2015
If you choose to use
core-jsand if you need any help - welcome :) I'm interesting as minimum because I useangularwithcore-jsin some projects.fix(facade): workaround for lack of Symbol.iterator in es6-shim
fix(facade): workaround for lack of Symbol.iterator in es6-shim
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.