{"id":320457,"date":"2020-09-07T13:45:37","date_gmt":"2020-09-07T20:45:37","guid":{"rendered":"https:\/\/css-tricks.com\/?p=320457"},"modified":"2020-09-07T13:45:39","modified_gmt":"2020-09-07T20:45:39","slug":"all-the-ways-to-make-a-web-component","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/all-the-ways-to-make-a-web-component\/","title":{"rendered":"All the Ways to Make a Web Component"},"content":{"rendered":"\n

This is a neat page that compares a ton of different libraries with web components. One of the things I learned after posting “A Bit on Web Components Libraries”<\/a> is that the web platform APIs were designed for libraries to be built around them<\/em>. Interesting, right? <\/p>\n\n\n\n

This page makes a counter component. By extending HTMLElement<\/code> natively, they do it in 1,293 bytes, then each library adds things on top of that. The big libraries, like Vue and React, are clearly much bigger (but bring a ton of other functionality to the table). One of the biggest is CanJS (230,634 bytes), which isn’t aiming to be small, but, from their about page: “It targets experienced developers building complex applications with long futures ahead of them.” If the goal is small, Svelte<\/a> is true to its mission of nearly compiling itself away ending at just 3,592 bytes, a third of the size of the super tiny lit-html<\/a> and half the size of uhtml<\/a> \u2014 both of which are just tiny abstractions that offer nicer templating and re-rendering.<\/p>\n","protected":false},"excerpt":{"rendered":"

This is a neat page that compares a ton of different libraries with web components. One of the things I learned after posting “A Bit on Web Components Libraries” is that the web platform APIs were designed for libraries to be built around them. Interesting, right? This page makes a counter component. By extending HTMLElement […]<\/p>\n","protected":false},"author":3,"featured_media":320498,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[17],"tags":[803],"jetpack_publicize_connections":[],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/css-tricks.com\/wp-content\/uploads\/2020\/09\/color-pencils.png?fit=1200%2C600&ssl=1","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/320457"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=320457"}],"version-history":[{"count":5,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/320457\/revisions"}],"predecessor-version":[{"id":320497,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/320457\/revisions\/320497"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media\/320498"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=320457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=320457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=320457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}