FrankKai.github.io icon indicating copy to clipboard operation
FrankKai.github.io copied to clipboard

WebComponents那些事儿

Open FrankKai opened this issue 2 years ago • 1 comments

  • webcomponents-sd.js, webcomponents-cs.js, custom-elements-es5-adaptor.js是什么?

FrankKai avatar May 12 '22 09:05 FrankKai

webcomponents-sd.js, webcomponents-cs.js, custom-elements-es5-adaptor.js是什么?

web components的polyfill。

webcomponents-sd.js

sd(Shady DOM ) polyfill

webcomponents-ce.js

ce(Custom Elements) polyfill

custom-elements-es5-adaptor.js

Custom Elements es5适配器。

根据规范,只有 ES6 class可以传递给原生 customElements.define API。因此这是为了兼容不支持es6 class的浏览器去使用web components的polyfill。

polyfill仓库:https://github.com/webcomponents/polyfills

FrankKai avatar May 12 '22 09:05 FrankKai