However, a few days after the first release, I received a chain of email and tickets from the management team, the HR department, and all the people who tried to use it saying it doesn’t work as expected on their computers.

Well, I built and tested the web app on Chrome. They grew up with FireFox and IE. Which they use on a daily basis and were using to navigate the web app I just built and deployed a couple of days prior and boon the web app breakes on their browsers. fun!! right!? nope, it’s not!! This is where polyfill comes in!

Tip: Use Bit (Github) to share your components across projects and teams. Just export components to bit.dev, reuse them across apps and easily sync changes between them. Build faster and keep your UI consistent. Try it out.

Easily share and sync components across apps with bit

Polyfill

A polyfill, or polyfiller, is a piece of code (or plugin) that provides the technology that you, the developer, expect the browser to provide natively. Flattening the API landscape if you will.

A polyfill is a piece of code (usually JavaScript on the Web) used to provide modern functionality on older browsers that do not natively support it.

For example, a polyfill could be used to mimic the functionality of an HTML Canvas element on Microsoft Internet Explorer 7 using a Silverlight plugin, or mimic support for CSS rem units, or text-shadow , or whatever you want. The reason why polyfills are not used exclusively is for better functionality and better performance. Native implementations of APIs can do more and are faster than polyfills.

Other times, polyfills are used to address issues where browsers implement the same features in different ways. The polyfill uses non-standard features in a certain browser to give JavaScript a standards-complaint way to access the feature. Although this reason for polyfilling is very rare today, it was especially prevalent back in the days of IE6, Netscape, and NNav where each browser implemented Javascript very differently.