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

Array.apply not support ie8 in TextBlock even if I'm add the polyfill #62

Closed
guxingke201 opened this issue Dec 15, 2017 · 10 comments
Closed
Labels

Comments

@guxingke201
Copy link

image
could you change it to Array.from?

@FrancescoCioria
Copy link
Contributor

ie8? seriously? not even Microsoft supports ie8 anymore 😝

Anyway, to answer to your two questions:

  1. I'm sorry, but I don't think we should change the code to support a 10years old browser that is no longer officially supported by anyone. If you really need to support IE8, I suggest you polyfill Array.apply directly on your project
  2. Array.from is muuuch more recent than Array.apply and is not even supported by IE11 => so I guess you're already using polyfills? In this case, adding the polyfill for Array.apply should not be a problem then :)

@guxingke201
Copy link
Author

I'm already try to use es3ify-loader and babel-polyfill to polyfill Array.apply,but failed. fortunately the Array.from success

@guxingke201 guxingke201 changed the title Array.apply not support ie8 in TextBlock Array.apply not support ie8 in TextBlock even if I'm add the polyfill Dec 15, 2017
@FrancescoCioria
Copy link
Contributor

FrancescoCioria commented Dec 15, 2017

Ok, Array.apply is actually supported by IE8, but for some reason in IE8 it has a different API...

We could take advantage of ES6 by doing it as [...Array(5)] and let babel do their job

EDIT: babel uses Array.from so, no, I'm not gonna do it. I'll try another solution

@FrancescoCioria
Copy link
Contributor

published a fix in 1.0.10

@guxingke201
Copy link
Author

guxingke201 commented Dec 18, 2017

I'm sorry to say that your another solution failed,because the range.map failed to traverse in ie8

@guxingke201
Copy link
Author

guxingke201 commented Dec 18, 2017

In addition if we don't use babel ,the problem will not just Array.apply

@guxingke201
Copy link
Author

if you don't want Array.from, you could replace range.map by for

@FrancescoCioria
Copy link
Contributor

FrancescoCioria commented Dec 18, 2017

That's weird, I tested it on IE8 and it looked to me that it correctly initialized an array without errors.
What error are you getting? Can you write it here?

@guxingke201
Copy link
Author

guxingke201 commented Dec 19, 2017

There is no exception,just the range.map failed to loop in ie8, and I don't know why

@FrancescoCioria
Copy link
Contributor

FrancescoCioria commented Dec 19, 2017

@guxingke201 I'm sorry, but if that didn't work I'm out of options: I'm not going to write bad code to support IE8.

I'm very pleased that you appreciate react-placeholder and wish to use it in your app, but I can't refactor code from ES6 to ES3 to support a browser that is 9 yo and no longer supported neither by Microsoft nor by React. I hope you will understand.

PS: to be honest, react-placeholder never even supported IE < 11 as it deeply uses flexbox for its layout :)

PPS: you should still be able to pass a custom placeholder, compatible with IE8, as children. You can look at this example for more information.

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

No branches or pull requests

3 participants