Skip to content

Instantly share code, notes, and snippets.

@WebReflection
Last active September 7, 2025 16:53
Show Gist options
  • Select an option

  • Save WebReflection/ae3451c17c5e882bbc7f0714c14eefcd to your computer and use it in GitHub Desktop.

Select an option

Save WebReflection/ae3451c17c5e882bbc7f0714c14eefcd to your computer and use it in GitHub Desktop.
A very simple comparison table between uce and lit-element.

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 ( brotli ) 9437b ES5 / 6811b ES2015+ 8634b ES5 / 6708b ES2015+
polyfill ( brotli ) * 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
SSR ***
distributable components **** ⚠️
friendly syntax *****
builtin extends

* uce optional polyfill is @ungap/custom-elements which provides builtin extends too for IE or Safari, but no ShadowDOM, which can optionally added via attachshadow or ShadyDOM, while lit-element optional polyfill is @webcomponents/webcomponentsjs 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 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, 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
Copy link
Author

P.S. components written for uce will run without any change in uce-template too ... which is another benefit of not needing the library to define a component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment