Skip to content
This repository has been archived by the owner on Oct 3, 2018. It is now read-only.

Does not work with IE8 #46

Closed
JustBlackBird opened this issue Sep 16, 2014 · 14 comments
Closed

Does not work with IE8 #46

JustBlackBird opened this issue Sep 16, 2014 · 14 comments

Comments

@JustBlackBird
Copy link

The library is not compatible with IE8. Is there any chance the compatibility will be added?

@hassankhan
Copy link
Contributor

Doubtful, Internet Explorer is this library's weak point.

@JustBlackBird
Copy link
Author

As I can see the problems are in Array.prototype.forEach, Array.prototype.map, Object.keys and Array.prototype.reduce methods. If I replace these methods with non ES5 would you merge the pull request?

@hassankhan
Copy link
Contributor

I think we should ask @suprememoocow, he spent a lot of time rewriting it to make it performant, so I'd hate to lay waste to his work.

@leoasis
Copy link
Contributor

leoasis commented Sep 18, 2014

You can use something like this to make it work https://github.com/es-shims/es5-shim

@hassankhan
Copy link
Contributor

Oooh, that'd actually be quite cool.

@JustBlackBird
Copy link
Author

It seems that es5-shim is the simplest way to go. It is better than update the library.

@hassankhan, may be something about es5-shim and IE compatibility should be noticed in the readme?

@suprememoocow
Copy link
Contributor

Hey folks,

Sorry I've been so quiet. Been really busy. es5-shim is a great idea. If we wanted to reduce the dependencies, it would also be really simple to build our own shims, for example:

function arrayReduce(array, reductionFunction, initialValue) {
  if(Array.prototype.reduce) return array.reduce(reductionFunction, initialValue);

  var t = Object(this), len = t.length >>> 0, k = 0, value = initialValue;
  for (; k < len; k++) {
    value = callback(value, t[k], k, t);
  }
  return value;
}

I guess it depends on how many people require IE8 support - if it's only a few, then perhaps using es5-shim would be the best option.

@hassankhan
Copy link
Contributor

@JustBlackBird Well, we already have a Testling banner that shows support across different browsers. Is that what you meant?

In general, I'm 👍 on this, if it isn't too much work.

@JustBlackBird
Copy link
Author

@hassankhan I mean a hint in the readme with notice about es5-shim. For example it can be something like the following:

Care about old browsers compatibility? Use https://github.com/es-shims/es5-shim

I'm not sure if it's needed but it can save time for developers who care about old browser compatibility.

@leoasis
Copy link
Contributor

leoasis commented Sep 23, 2014

Yeah, the idea is that the shims are used by the developer using this, not a decision to be made inside the library. There may be other libraries which also rely on es5 features that can be shimmed, but you don't want those shims to be duplicated in every lib

@hassankhan
Copy link
Contributor

Hmm ok, but how would we automate testing it if it actually works using the shim i.e. using Testling?

@leoasis
Copy link
Contributor

leoasis commented Sep 23, 2014

Then the shim must exist in the tests, it should be included before the library in the html page, or required before the library if using browserify or similar

@hassankhan
Copy link
Contributor

I'll be honest with you, I'm not sure where to start with respect to making tests work like that. Do you think it would be possible to make a quick proof-of-concept PR just so I can see how it would work? Once we know for sure that it works with the shims, then I'll update the documentation, too, thanks 😄

@hassankhan
Copy link
Contributor

Ah bollocks to it, if someone wants to run it on IE8, they can do it at their own risk. I'll add a disclaimer.

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

No branches or pull requests

4 participants