Search code examples
polymerweb-component

Polymer 3.0 Polyfils for firefox


I am using firefox 52.3.0 and planning to develop using web components(Polymer 3.0). I am looking for polymer 3.0 polyfil that works in firefox.

I tried webcomponents-lite.js (worked partially - did not support es5 polymer)
I tried webcomponents-bundle.js (ddnt workd)
I even added the es5-adapter.js from @webcomponents repositories, they just didnt work for firefox. It worked in Opera and Chrome(which didnt need the polyfill) but never on firefox.

I know youtube is built entirely on polymer and I can access it (even inspect the elements) so well within my mozila firefox, which tells me there is a polyfil that works. I am jut not able to find it.

PS: I would love to be able to use these polymerElements with react-js, I know its possible, but I dont know how yet. can someone please tell me how?


Solution

  • Okay, that sounds odd. And Opera does not need any polyfill because they have all the standards already shipped natively.

    One thing you can try is that make an ES6 web component, and get ES5 web components from Polymer bundling. Check out the official docs: https://www.polymer-project.org/3.0/toolbox/build-for-production#compile

    Polymer 3.x and the Polymer Elements are written in ES6 (also known as ES2015). To allow older browsers to render your apps, compile your code to ES5.

    When you compile your code to ES5, the Polymer build tools will inject the custom-elements-es5-adapter.js polyfill into your entrypoint so that ES6-capable browsers can still render your ES5 code.