Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can I do if nothing is supported on IE?

I have an arrow function that was working perfectly on Chrome/Firefox but I also need it working on IE11, and I don't know what more to do.

Here you can see that the arrow functions aren't supported on IE11, so I tried to change my code from ES6 to ES5 here because I read that doing this could solve the problems (on the link you can also check my code :) for removing the arrow functions.

Object.entries isn't supported either, and I'm still needing it. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/entries

So I tried to use the polyfill of the link above but it uses Reflect which isn't supported either. https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/Reflect

Any ideas? I'm really lost with IE11 dev. PD: The code is still working on Chrome/Firefox.

like image 808
IXTR Unai Avatar asked Jul 18 '17 09:07

IXTR Unai


People also ask

Can I still use IE after June 2022?

On June 15, 2022, the Internet Explorer 11 desktop application is no longer be supported on certain versions of Windows 10*. Customers are encouraged to move to Microsoft Edge, which provides support for legacy and modern websites and apps.

Will IE work after June 15?

This is a reminder that Microsoft plans to retire and end support for the Internet Explorer 11 (IE11) desktop application on most versions of Windows 10 on June 15, 2022.

What is replacing Internet Explorer?

Support for Internet Explorer 11 has ended on June 15, 2022Microsoft Edge is the faster, more secure browser recommended by Microsoft. With improved security, privacy, speed, and ease of use, Microsoft Edge surpasses the experience you've come to know with Internet Explorer.

Why can't I use Internet Explorer anymore?

If you can't open Internet Explorer, if it freezes, or if it opens briefly and then closes, the problem might be caused by low memory or damaged system files. Try this: Open Internet Explorer and select Tools > Internet options. Select the Advanced tab, and then select Reset.


3 Answers

This is naive implementation of Object.entries.
It works well for all examples in https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/entries

Object.entries = Object.entries || function(obj) {
   return Object.keys(obj).map(function(k) {
       return [k, obj[k]];
   });
};
like image 135
Sagi Avatar answered Oct 20 '22 07:10

Sagi


babel with babel preset env would be the way to go.

This way you could just list the browsers you intend to support and then babel will only transpile (convert pieces of your code to ES5) parts of your code that need to be converted to support all your browsers.

like image 26
Dan Gamble Avatar answered Oct 20 '22 08:10

Dan Gamble


You can use several solution to implement support new ES8+ features in old browsers.

Full-circuit solution can be based on Webpack with babel-transformers and set of polyfills, which also called shims. You can see stereotypical configuration in create-react-app or next.js boilerplate.

More that, if you have no IE11 installation on development machine, you can run E2E/functional tests on SauseLabs, using test suite provider like TestCafe or NightWatch.

like image 1
Vladislav Ihost Avatar answered Oct 20 '22 07:10

Vladislav Ihost