2020-12-26 11:35

CustomElements.js vs @webcomponents/custom-elements/custom-elements.min.js

Is the CustomElements.js similar to /custom-elements/custom-elements.min.js ? What is the difference? /custom-elements/custom-elements.min.js was working, but the CustomElements.js in this directory not working.


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • weixin_39711914 weixin_39711914 4月前

    CustomElements.js from where?

    点赞 评论 复制链接分享
  • weixin_39575410 weixin_39575410 4月前

    oh sorry. My question was what is different in this custom-elements.js from CustomElement.js in https://github.com/WebComponents/webcomponentsjs? I know this directory is moved from there. But I would like to know the difference and reasoning behind it. Thanks!

    点赞 评论 复制链接分享
  • weixin_39711914 weixin_39711914 4月前

    Not sure but I think they created a new separate project for the Custom Element polyfill for the needs of the "version 1" implementation.

    You shouldn't use the old one since it is not updated any more. It supports only the old specfication.

    点赞 评论 复制链接分享
  • weixin_39640265 weixin_39640265 4月前

    see this, very useful explanation of customElements v1: https://developers.google.com/web/fundamentals/getting-started/primers/customelements see also new spec: https://www.w3.org/TR/custom-elements/

    点赞 评论 复制链接分享
  • weixin_39943000 weixin_39943000 4月前

    Correct. https://github.com/webcomponents/custom-elements is for the v1 CE polyfill. We broke up each polyfill into a separate repo.

    https://github.com/WebComponents/webcomponentsjs is v0 APIs.

    点赞 评论 复制链接分享