How to get ES5 Polymer 2.0 elements working with v1 specification?

I have successfully created a number of Polymer 2.0 elements and they work great in browsers that support ES6.

When I try to transfer them to ES5, the browser gives a bunch of errors, for example:

Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.

After some research, it looks like you need a built-in plugin that comes with webcomponentsjs-es5-loader, but after switching to it, I get a new error:

Class constructor DomModule cannot be invoked without 'new'

How are Transpiled Polymer 2.0 elements converted to ES5 browser? Did I miss something?

+3
source share
1 answer

Custom Element V1 Spec, . ES5 . , , ES5 , .

. https://github.com/webcomponents/webcomponentsjs#custom-elements-es5-adapterjs.

ES5. Native, Polymer 2+.

0

Source: https://habr.com/ru/post/1672507/


All Articles