Last active
September 7, 2025 16:53
-
-
Save WebReflection/ae3451c17c5e882bbc7f0714c14eefcd to your computer and use it in GitHub Desktop.
Revisions
-
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -98,7 +98,7 @@ If a *lit-element* is *not bundled*, the *import* should have an absolute *CDN* In this case, the minimal component size *won't* include the library itself but each component will require an `import` capable browser (no IE11, no old Edge), plus a network request, either to download once the library, or to grab it from the network cache. However, most deployed components do include *lit-element* itself, until the day *lit-element* will use the same approach *uce* is using, so that components will be decoupled from the library itself, which can export all its namespace through the registerd Custom Element class. Alternatively, *lit-element* could be pre-bundled and leak on the global `window` context, so that components can rely on its presence: ```js -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ A very simple comparison table between these two libraries. | friendly syntax `*****` | ✔ | ❓ | | builtin extends | ✔ | ❌ | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends for IE and Safari too, but no ShadowDOM, which can be optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) ([1.3k](https://unpkg.com/[email protected]/min.js)) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme) ([19.2k](https://unpkg.com/@webcomponents/[email protected]/bundles/webcomponents-sd.js)), while *lit-element* optional polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but, as I am writing today, no builtin extends. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. Please [read more](https://gist.github.com/WebReflection/ae3451c17c5e882bbc7f0714c14eefcd#about-the-minimal-component-size) if this part is not clear. -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ A very simple comparison table between these two libraries. `***` in *uce* the usage of *ShadowDOM* is not really necessary, neither encouraged, hence its components work out of the box even landed as *SSR*. See [uce-template](https://github.com/WebReflection/uce-template#readme) for an even richer *SSR* compatible experience. In *lit-element*, the usage of *ShadowDOM* is both encouraged and demoed all over, requiring its heavy polyfill if older browsers such as *Edge*, *IE11*, or legacy Mobile, are part of the targets, and *yet*, ShadowDOM is not *SSR* friendly, so choose carefully here. `****` in *uce* components can be distributed without carrying the library with them, thanks to [its presence as customElements library](https://medium.com/@WebReflection/some-web-components-hint-75dce339ac6b), while *lit-element* components usually bundle the library in order to work, adding unnecessary bloat when components are published as stand-alone. That is: *uce* libarry size is *O(1)*, while in *lit-element* it's currently *O(n)*. Please [read more](https://gist.github.com/WebReflection/ae3451c17c5e882bbc7f0714c14eefcd#about-the-minimal-component-size) if this part is not clear. `*****` in *uce* interpolations can be just plain *JS*, no need to import, know, or learn, any *repeater* or specialized syntax/feature. -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -63,7 +63,7 @@ customElements.whenDefined('uce-lib').then( } ); ``` No `import`, no `require`, no external dependencies needed, the size of the library is completely irrelevant because it's exported through its own namespace defined as `uce-lib` Custom Element. In *lit-element*, the structure of the page will be similar: ```html -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,10 +38,10 @@ A Web page that uses *uce* can have this structure: <!doctype html> <html> <head> <script async src="/js/uce.js"></script> <script async src="js/components/component-a.js"></script> <script async src="js/components/component-b.js"></script> <script async src="js/components/component-c.js"></script> </head> <body> <component-a>content</component-a> @@ -70,9 +70,9 @@ In *lit-element*, the structure of the page will be similar: <!doctype html> <html> <head> <script async src="js/components/component-a.js"></script> <script async src="js/components/component-b.js"></script> <script async src="js/components/component-c.js"></script> </head> <body> <component-a>content</component-a> -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ A very simple comparison table between these two libraries. `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends for IE and Safari too, but no ShadowDOM, which can be optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) ([1.3k](https://unpkg.com/[email protected]/min.js)) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme) ([19.2k](https://unpkg.com/@webcomponents/[email protected]/bundles/webcomponents-sd.js)), while *lit-element* optional polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. Please [read more](https://gist.github.com/WebReflection/ae3451c17c5e882bbc7f0714c14eefcd#about-the-minimal-component-size) if this part is not clear. `***` in *uce* the usage of *ShadowDOM* is not really necessary, neither encouraged, hence its components work out of the box even landed as *SSR*. See [uce-template](https://github.com/WebReflection/uce-template#readme) for an even richer *SSR* compatible experience. In *lit-element*, the usage of *ShadowDOM* is both encouraged and demoed all over, requiring its heavy polyfill if older browsers such as *Edge*, *IE11*, or legacy Mobile, are part of the targets, and *yet*, ShadowDOM is not *SSR* friendly, so choose carefully here. -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -98,4 +98,13 @@ If a *lit-element* is *not bundled*, the *import* should have an absolute *CDN* In this case, the minimal component size *won't* include the library itself but each component will require an `import` capable browser (no IE11, no old Edge), plus a network request, either to download once the library, or to grab it from the network cache. However, most deployed components do include *lit-element* itself, until the day *lit-element* will use the same approach *uce* is using, so that components will be decoupled from the libarry itself, which can export all its namespace through the registerd Custom Element class. Alternatively, *lit-element* could be pre-bundled and leak on the global `window` context, so that components can rely on its presence: ```js const { LitElement } = window.litElement; customElements.define('component-a', class extends LitElement { // ... }); ``` However, this code would break if the global `litElement` namespace is not already available, while *uce* components will never break, even if they are evaluated *before* the *uce* library is included in the page. -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -96,6 +96,6 @@ If a *lit-element* component is *bundled*, so that it can be deployed anywhere, If a *lit-element* is *not bundled*, the *import* should have an absolute *CDN* url so that it can be deployed anywhere a third party *CDN* dependency is acceptable. In this case, the minimal component size *won't* include the library itself but each component will require an `import` capable browser (no IE11, no old Edge), plus a network request, either to download once the library, or to grab it from the network cache. However, most deployed components do include *lit-element* itself, until the day *lit-element* will use the same approach *uce* is using, so that components will be decoupled from the libarry itself, which can export all its namespace through the registerd Custom Element class. -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 73 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ A very simple comparison table between these two libraries. | language | JS w/ TS definition | TS w/ JS transpilation | | size <sup><sub>( brotli )</sub></sup> | 9437b ES5 / 6811b ES2015+ | 8634b ES5 / 6708b ES2015+ | | polyfill <sup><sub>( brotli )</sub></sup> `*` | [2.1k](https://unpkg.com/@ungap/[email protected]/min.js) w/ builtin extends | [5.2k](https://unpkg.com/@webcomponents/[email protected]/bundles/webcomponents-ce.js) CE w/out builtin or [31.7k](https://unpkg.com/@webcomponents/[email protected]/webcomponents-bundle.js) w/ SD | | minimal components size `**` | 73b plain | 92b plain up to 30k+ plain | | declaration | object literal w/ extends | the base class is `LitElement` only | | extends-ability | mixins | classes | | tooling-free | ✔ | `import` + `@decorators` | @@ -27,4 +27,75 @@ A very simple comparison table between these two libraries. `****` in *uce* components can be distributed without carrying the library with them, thanks to [its presence as customElements library](https://medium.com/@WebReflection/some-web-components-hint-75dce339ac6b), while *lit-element* requires that each component bundles the library in order to work, adding unnecessary bloat when components are published as stand-alone. That is: *uce* libarry size is *O(1)*, while in *lit-element* it's currently *O(n)*. `*****` in *uce* interpolations can be just plain *JS*, no need to import, know, or learn, any *repeater* or specialized syntax/feature. - - - ## About the minimal component size A Web page that uses *uce* can have this structure: ```html <!doctype html> <html> <head> <script defer src="/js/uce.js"></script> <script defer src="js/components/component-a.js"></script> <script defer src="js/components/component-b.js"></script> <script defer src="js/components/component-c.js"></script> </head> <body> <component-a>content</component-a> <component-b>content</component-b> <component-c>content</component-c> </body> </html> ``` All components can be developed without using any toolchain. ```js customElements.whenDefined('uce-lib').then( function (uce) { uce.define('component-a', { connected() { console.log('I am alive!'); } }); } ); ``` No `import`, no `require`, no external dependencies needed, the size of the library is completely irrelevant because it's exported through its own namespace. In *lit-element*, the structure of the page will be similar: ```html <!doctype html> <html> <head> <script defer src="js/components/component-a.js"></script> <script defer src="js/components/component-b.js"></script> <script defer src="js/components/component-c.js"></script> </head> <body> <component-a>content</component-a> <component-b>content</component-b> <component-c>content</component-c> </body> </html> ``` However, accordingly with the way components are *currently* written, each of them requires either a toolchain, or an import, so that the library can be used. ```js import { LitElement } from 'lit-element'; customElements.define('component-a', class extends LitElement { connectedCallback() { console.log('I am alive'); } }); ``` If a *lit-element* component is *bundled*, so that it can be deployed anywhere, the *LitElement* part of the library will be bundled too. If a *lit-element* is *not bundled*, the *import* should have an absolute *CDN* url so that it can be deployed anywhere a third party *CDN* dependency is acceptable. In this case, the minimal component size *won't* include the library itself but each component will require a network request, either to download once the library, or to grab it from the network cache. However, most deployed components do include *lit-element* itself, until the day *lit-element* will use the same approach *uce* is using, so that components will be decoupled from the libarry itself, which can export all its namespace through the registerd Custom Element class. -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ A very simple comparison table between these two libraries. | language | JS w/ TS definition | TS w/ JS transpilation | | size <sup><sub>( brotli )</sub></sup> | 9437b ES5 / 6811b ES2015+ | 8634b ES5 / 6708b ES2015+ | | polyfill <sup><sub>( brotli )</sub></sup> `*` | [2.1k](https://unpkg.com/@ungap/[email protected]/min.js) w/ builtin extends | [5.2k](https://unpkg.com/@webcomponents/[email protected]/bundles/webcomponents-ce.js) CE w/out builtin or [31.7k](https://unpkg.com/@webcomponents/[email protected]/webcomponents-bundle.js) w/ SD | | minimal components size `**` | 73b plain | 30k+ plain | | declaration | object literal w/ extends | the base class is `LitElement` only | | extends-ability | mixins | classes | | tooling-free | ✔ | `import` + `@decorators` | -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ A very simple comparison table between these two libraries. | friendly syntax `*****` | ✔ | ❓ | | builtin extends | ✔ | ❌ | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends for IE and Safari too, but no ShadowDOM, which can be optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) ([1.3k](https://unpkg.com/[email protected]/min.js)) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme) ([19.2k](https://unpkg.com/@webcomponents/[email protected]/bundles/webcomponents-sd.js)), while *lit-element* optional polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ A very simple comparison table between these two libraries. | friendly syntax `*****` | ✔ | ❓ | | builtin extends | ✔ | ❌ | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends for IE and Safari too, but no ShadowDOM, which can be optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) [1.3k](https://unpkg.com/[email protected]/min.js) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme) [19.2k](https://unpkg.com/@webcomponents/[email protected]/bundles/webcomponents-sd.js), while *lit-element* optional polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ A very simple comparison table between these two libraries. | license | ISC (simplified MIT) | BSD-3-Clause License | | language | JS w/ TS definition | TS w/ JS transpilation | | size <sup><sub>( brotli )</sub></sup> | 9437b ES5 / 6811b ES2015+ | 8634b ES5 / 6708b ES2015+ | | polyfill <sup><sub>( brotli )</sub></sup> `*` | [2.1k](https://unpkg.com/@ungap/[email protected]/min.js) w/ builtin extends | [5.2k](https://unpkg.com/@webcomponents/[email protected]/bundles/webcomponents-ce.js) CE w/out builtin or [31.7k](https://unpkg.com/@webcomponents/[email protected]/webcomponents-bundle.js) w/ SD | | minimal components size `**` | 73b | 30k+ | | declaration | object literal w/ extends | the base class is `LitElement` only | | extends-ability | mixins | classes | -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ A very simple comparison table between these two libraries. | license | ISC (simplified MIT) | BSD-3-Clause License | | language | JS w/ TS definition | TS w/ JS transpilation | | size <sup><sub>( brotli )</sub></sup> | 9437b ES5 / 6811b ES2015+ | 8634b ES5 / 6708b ES2015+ | | polyfill <sup><sub>( brotli )</sub></sup> `*` | 2.1k w/ builtin extends | 5.2k CE w/out builtin or 68.3k w/ SD | | minimal components size `**` | 73b | 30k+ | | declaration | object literal w/ extends | the base class is `LitElement` only | | extends-ability | mixins | classes | -
WebReflection revised this gist
Oct 15, 2020 . 1 changed file with 12 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,19 +3,19 @@ A very simple comparison table between these two libraries. | | uce | lit-element | | --------------------------------------------- |:--------------------------:|:------------------------------------:| | version | 1.11.9 | 2.4.0 | | license | ISC (simplified MIT) | BSD-3-Clause License | | language | JS w/ TS definition | TS w/ JS transpilation | | size <sup><sub>( brotli )</sub></sup> | 9437b ES5 / 6811b ES2015+ | 8634b ES5 / 6708b ES2015+ | | polyfill <sup><sub>( brotli )</sub></sup> `*` | 2.1k | 5.2k CE w/out builtin or 68.3k w/ SD | | minimal components size `**` | 73b | 30k+ | | declaration | object literal w/ extends | the base class is `LitElement` only | | extends-ability | mixins | classes | | tooling-free | ✔ | `import` + `@decorators` | | keyed & non-keyed ability | ✔ | ✔ | | SSR `***` | ✔ | ❓ | | distributable components `****` | ✔ | **⚠️** | | friendly syntax `*****` | ✔ | ❓ | | builtin extends | ✔ | ❌ | -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ A very simple comparison table between these two libraries. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. `***` in *uce* the usage of *ShadowDOM* is not really necessary, neither encouraged, hence its components work out of the box even landed as *SSR*. See [uce-template](https://github.com/WebReflection/uce-template#readme) for an even richer *SSR* compatible experience. In *lit-element*, the usage of *ShadowDOM* is both encouraged and demoed all over, requiring its heavy polyfill if older browsers such as *Edge*, *IE11*, or legacy Mobile, are part of the targets, and *yet*, ShadowDOM is not *SSR* friendly, so choose carefully here. `****` in *uce* components can be distributed without carrying the library with them, thanks to [its presence as customElements library](https://medium.com/@WebReflection/some-web-components-hint-75dce339ac6b), while *lit-element* requires that each component bundles the library in order to work, adding unnecessary bloat when components are published as stand-alone. That is: *uce* libarry size is *O(1)*, while in *lit-element* it's currently *O(n)*. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ A very simple comparison table between these two libraries. | friendly syntax `*****` | ✔ | ❓ | | builtin extends | ✔ | ❌ | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends for IE and Safari too, but no ShadowDOM, which can be optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme), while *lit-element* optional polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ A very simple comparison table between these two libraries. | friendly syntax `*****` | ✔ | ❓ | | builtin extends | ✔ | ❌ | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends for IE and Safari too, but no ShadowDOM, which can optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme), while *lit-element* optional polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ A very simple comparison table between these two libraries. | friendly syntax `*****` | ✔ | ❓ | | builtin extends | ✔ | ❌ | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends too for IE or Safari, but no ShadowDOM, which can optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme), while *lit-element* optional polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ A very simple comparison table between these two libraries. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. `***` in *uce* the usage of *ShadowDOM* is not really necessary, neither encouraged, hence its components work out of the box even landed as *SSR*. See [uce-template](https://github.com/WebReflection/uce-template#readme) for an even reacher *SSR* compatible experience. In *lit-element*, the usage of *ShadowDOM* is both encouraged and demoed all over, requiring its heavy polyfill if older browsers such as *Edge*, *IE11*, or legacy Mobile, are part of the targets, and *yet*, ShadowDOM is not *SSR* friendly, so choose carefully here. `****` in *uce* components can be distributed without carrying the library with them, thanks to [its presence as customElements library](https://medium.com/@WebReflection/some-web-components-hint-75dce339ac6b), while *lit-element* requires that each component bundles the library in order to work, adding unnecessary bloat when components are published as stand-alone. That is: *uce* libarry size is *O(1)*, while in *lit-element* it's currently *O(n)*. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ A very simple comparison table between these two libraries. | size <sup><sub>( brotli )</sub></sup> | 9437b ES5 / 6811b ES2015+ | 8634b ES5 / 6708b ES2015+ | | polyfill <sup><sub>( brotli )</sub></sup> `*` | 2.1k | 68.3k | | minimal components size `**` | 73b | 30k+ | | declaration | object literal w/ extends | the base class is `LitElement` only | | extends-ability | mixins | classes | | tooling-free | ✔ | `import` + `@decorators` | | keyed & non-keyed ability | ✔ | ✔ | -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ A very simple comparison table between these two libraries. | language | JS w/ TS definition | TS w/ JS transpilation | | size <sup><sub>( brotli )</sub></sup> | 9437b ES5 / 6811b ES2015+ | 8634b ES5 / 6708b ES2015+ | | polyfill <sup><sub>( brotli )</sub></sup> `*` | 2.1k | 68.3k | | minimal components size `**` | 73b | 30k+ | | declaration | object literals w/ extends | the base class is `LitElement` only | | extends-ability | mixins | classes | | tooling-free | ✔ | `import` + `@decorators` | -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ A very simple comparison table between these two libraries. | size <sup><sub>( brotli )</sub></sup> | 9437b ES5 / 6811b ES2015+ | 8634b ES5 / 6708b ES2015+ | | polyfill <sup><sub>( brotli )</sub></sup> `*` | 2.1k | 68.3k | | minimal components size `**` | 73 plain chars | 30K+ plain chars | | declaration | object literals w/ extends | the base class is `LitElement` only | | extends-ability | mixins | classes | | tooling-free | ✔ | `import` + `@decorators` | | keyed & non-keyed ability | ✔ | ✔ | -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ A very simple comparison table between these two libraries. | SSR `***` | ✔ | ❓ | | distributable components `****` | ✔ | **⚠️** | | friendly syntax `*****` | ✔ | ❓ | | builtin extends | ✔ | ❌ | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends too but no ShadowDOM, which can optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme), while *lit-element* optional polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ A very simple comparison table between these two libraries. | keyed & non-keyed ability | ✔ | ✔ | | SSR `***` | ✔ | ❓ | | distributable components `****` | ✔ | **⚠️** | | friendly syntax `*****` | ✔ | ❓ | | builtin extends | ✔ | | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends too but no ShadowDOM, which can optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme), while *lit-element* optional polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ A very simple comparison table between these two libraries. | friendly syntax `*****` | ✔ | | | builtin extends | ✔ | | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends too but no ShadowDOM, which can optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme), while *lit-element* optional polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # [uce](https://github.com/WebReflection/uce#readme) vs [lit-element](https://github.com/Polymer/lit-element#readme) A very simple comparison table between these two libraries. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,6 +25,6 @@ A very simple comparison table between these two libraries. `***` in *uce* the usage of *ShadowDOM* is not really necessary, neither encouraged, hence its components work out of the box even landed as *SSR*. See [uce-template](https://github.com/WebReflection/uce-template#readme) for an even reacher *SSR* compatible experience. In *lit-element*, the usage of *ShadowDOM* is both encouraged and demoed all over, requiring its heavy polyfill if older browsers such as *Edge*, *IE11*, or legacy Mobile, are part of the targets. `****` in *uce* components can be distributed without carrying the library with them, thanks to [its presence as customElements library](https://medium.com/@WebReflection/some-web-components-hint-75dce339ac6b), while *lit-element* requires that each component bundles the library in order to work, adding unnecessary bloat when components are published as stand-alone. That is: *uce* libarry size is *O(1)*, while in *lit-element* it's currently *O(n)*. `*****` in *uce* interpolations can be just plain *JS*, no need to import, know, or learn, any *repeater* or specialized syntax/feature. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 7 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,15 +14,17 @@ A very simple comparison table between these two libraries. | extends-ability | mixins | classes | | tooling-free | ✔ | `import` + `@decorators` | | keyed & non-keyed ability | ✔ | ✔ | | SSR `***` | ✔ | ❓ | | distributable components `****` | ✔ | **⚠️** | | friendly syntax `*****` | ✔ | | | builtin extends | ✔ | | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends too but no ShadowDOM, which can optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme), while *lit-element* polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`. `***` in *uce* the usage of *ShadowDOM* is not really necessary, neither encouraged, hence its components work out of the box even landed as *SSR*. See [uce-template](https://github.com/WebReflection/uce-template#readme) for an even reacher *SSR* compatible experience. In *lit-element*, the usage of *ShadowDOM* is both encouraged and demoed all over, requiring its heavy polyfill if older browsers such as *Edge*, *IE11*, or legacy Mobile, are part of the targets. `****` in *uce* components can be distributed without carrying the library with them, thanks to [its present as customElements library](https://medium.com/@WebReflection/some-web-components-hint-75dce339ac6b), while *lit-element* requires that each component bundles the library in order to work, adding unnecessary bloat when components are published as stand-alone. That is: *uce* libarry size is *O(1)*, while in *lit-element* it's currently *O(n)*. `*****` in *uce* interpolations can be just plain *JS*, no need to import, know, or learn, any *repeater* or specialized syntax/feature. -
WebReflection revised this gist
Oct 14, 2020 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # [uce](github.com/WebReflection/uce#readme) vs [lit-element](https://github.com/Polymer/lit-element#readme) A very simple comparison table between these two libraries. @@ -14,12 +14,12 @@ A very simple comparison table between these two libraries. | extends-ability | mixins | classes | | tooling-free | ✔ | `import` + `@decorators` | | keyed & non-keyed ability | ✔ | ✔ | | SSR `****` | ✔ | ❓ | | friendly syntax `***` | ✔ | | | builtin extends | ✔ | | | distributable components | ✔ | | `*` *uce* optional polyfill is [@ungap/custom-elements](https://github.com/ungap/custom-elements#readme) which provides builtin extends too but no ShadowDOM, which can optionally added via [attachshadow](https://github.com/WebReflection/attachshadow#readme) or [ShadyDOM](https://github.com/webcomponents/polyfills/tree/master/packages/shadydom#readme), while *lit-element* polyfill is [@webcomponents/webcomponentsjs](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#readme) which provides Shadow DOM but no builtin extends. `**` in *uce* the minimal custom element is `customElements.whenDefined('uce-lib').then(({define})=>define('a-b',{}))`, while in *lit-element* it's `import{LitElement}from'lit-element';customElements.define('a-b',class extends LitElement{})`.
NewerOlder