DEV Community

Cover image for Smaller, Better, Faster... Server?
Daniel Turner
Daniel Turner

Posted on

Smaller, Better, Faster... Server?

Lit Element brought us 60 FPS pure DOM changes wrapped in a super light library with simple, declarative JavaScript templating.

Well, now Lit 2.0 is here and it is smaller, better and faster.

"Our major goals for Lit 2.0 were to reduce size, add powerful new features, improve performance and make some key changes under the hood to facilitate server-side rendering (SSR)... " - Gray Norton

Unlike most libraries, with a new version Lit actually is smaller, meaning your users get features they deserve faster with reduced download times.

Lit also improved its API so you will find it even easier to write clean and maintainable code. It has ultra fast templating, reactive properties so your components can update in response to changing state, a customisation reactive update lifecycle and very easy to use scoped styles.

Lit 2.0 is speedier, compared to the previous versions of Lit, which were already faster than other popular Javascript libraries. Lit 2.0 is faster by up to 20% faster on the initial render, and 15% faster on updates.

Perhaps the biggest change of Lit 2.0 is that it is now much simpler to use Lit for SSR. This enables a full range of integration for SSR including using Next.js and even static site generators or even using apps entirely built with Lit.

Every Lit components is a standard web component. This means you can use it anywhere you can use HTML. Be that another web framework, inside other components and plain html.

Lit then becomes the perfect addition for progressively enhancing basic websites, creating shareable components across frameworks and teams especially in the case of design systems.

Lit really does make it easy to build fast, lightweight web components. To find out more visit the new Lit website at lit.dev.
Or watch the Lit 2.0 launch video.

Top comments (0)