Closed msuperina closed 8 years ago
The reason for this pull request is because we are using this library with Typescript. When using in Internet Explorer, even with Symbol polyfills, runtime errors occur when trying to evaluate System.iterator that is generated with random method names. This fix solves the problem and removes dependency on Symbol usage. I wish there were tests to prove nothing is broken.
I'm sorry but that's really not the way to fix your issue. The src are in standard ES6, if there is any issue with the dist files, the fix should be around the babel project or an update of babel version here and a rebuild or maybe a transcript from ES6 to TypeScript.
Hi thanks for your answer. I was expecting this outcome. Please just keep in mind that by using es6 syntax no matter what you force final users to download polyfills that at the end consume a lot of bandwith.
On Tue, Nov 15, 2016 at 3:11 PM, Jérôme Steunou notifications@github.com wrote:
I'm sorry but that's really not the way to fix your issue. The src are in standard ES6, if there is any issue with the dist files, the fix should be around the babel project or an update of babel version here and a rebuild or maybe a transcript from ES6 to TypeScript.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JSteunou/webstomp-client/pull/29#issuecomment-260667254, or mute the thread https://github.com/notifications/unsubscribe-auth/ARdIgwPNVjcxfrcTR-ei6kyRYx3y_o_vks5q-cu6gaJpZM4KvsNH .
You are not forced to use the ES6 files on the client side. dist files are compatible with most of people browsers and by adding babel-polyfill for others it works. It is quite a small price to be ready for using ES6 and more.
In my apps I just add this webpack style loc
// Check on polyfill
function checkES2015(callback) {
if ('Symbol' in window) {
callback();
} else {
require.ensure(['babel-polyfill'], function(require) {
require('babel-polyfill');
callback();
}, 'babel-polyfill');
}
}
So polyfills are built a part and only load on old browsers.
…g syntaxes to prevent using Symbol in final build