LeaVerou/bliss

No support for `Array.from` in IE10

thany opened this issue · 3 comments

thany commented

The readme says it supports IE9+, but in IE10 I'm getting two unhandled exceptions where it doesn't know about Array.from. Is it possible to rewrite it to use a substitute, so it works in IE10 again?

Afaik, this:

Array.from(...)

Can be rewritten as:

[].slice.call(...)

And it could be refactored to a dead-simple polyfill:

if (!Array.from) { Array.from = function(list) { return [].slice.call(list); }; }

Or similar. Hope this helps :)

It says it supports IE9+ when using alongside polyfill.io. For more details, look here: http://blissfuljs.com/#browser-support

Using [].slice.call() instead of Array.from() is against our design goals. Instead, we have hand-picked exactly the polyfills Bliss needs, and you can include them conditionally via polyfill.io.

thany commented

Hm. I kind of disagree there. Even for Edge it wants to include a bunch of polyfills! I thought it was going to be IE10 and lower only... So, here's my reasoning:

  1. I feel the design goal should be to at least natively support the non-fossilized browsers without the need for polyfills. And those browsers do include IE11 and Edge. Polyfills should be for obsolete(-ish) browsers.
  2. These polyfills effectively increase the weight of Bliss by that much. Even for browsers that don't need any polyfills, it adds another request (unless we can magically leave the polyfill request out for those browsers).
  3. On top of that, I don't feel right depending on a third party host for supplying essential functionality, for various reasons. And I can't just "save as" their output, because it's different for each browser.

I sincerely hope you will reconsider this.

  1. IE11 is a fossilized browser. It's obsoleted by Edge and will not get any updates.
  2. A design goal of Bliss is to not bloat its core by including polyfill code, as authors can always include the polyfills they want. If you care that much, feel free to only include an Array.from() polyfill manually. It's not exactly a weight increase, since if you use polyfill.io, most browsers will not get the extra weight. We only depend on features that are polyfillable and are already implemented in many browsers, so that it's 100% sure they will eventually be implemented everywhere, so using polyfills is only a transitional step.
  3. Using a third party means that users might already have this cached. If you want to save as, you can use features=blissfuljs|always and save as, but it's wasteful.

We are not going to reconsider this.