I need to build a component that should need to work with both specs, custom elements spec v0
which got deprecated and custom elements spec v1
, latest stable version.
If I build components with custom elements v0
spec some apps will face issues since they are using polymer 2
and above and the same problem with polymer 1
applications which will not work with custom elements v1
spec.
I do not have control over applications to change polyfills, some applications have to use polyfills supports old spec and some uses new polyfills.
I am looking for a solid solution to combine both the specs to run my custom elements in all the applications irrespective of polyfills version. I can add any piece of polyfill or snippet to my components so that they can run anywhere, I have not found any such library or polyfill which support both specs in my research.
I am planning to write an adapter that can combine both the specs like mapping mentioned below for attached callback, inputs on this thought will be much appreciated.
connectedCallback(){
this.attachedCallback();
}
I tried to use stenciljs but it can work only with the latest version of custom elements spec. I have not found any way to tweak it to make it work with earlier spec.
Please suggest some viable alternatives and feasible solutions to the above-mentioned situation.