Lit Webcomponents Framework - Lit It Up Keynote

ilyagorenburg 11 views 33 slides May 27, 2024
Slide 1
Slide 1 of 33
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33

About This Presentation

This is second part of my talk in September 2023 about the Lit framework. In my first talk (Lit There Be Light), I talked about the framework, its features, and areas where it can be used. In the new talk (Lit it up), I will share what we’ve learned using this framework in production for eight mo...


Slide Content

Lit it up
Lit framework. Series 2

Ilya Gorenburg
Frontend Developer at .

Disclaimer
This is our journey of using the Lit framework; your
experience might differ. Use it responsively.

So, what problem were we trying to solve?...

Community Forum

What is Lit?
Lit is a simple library for building fast, lightweight web components that work in or
without any framework. You can create shareable components, applications, design
systems, and more with Lit.
Lit provides APIs to simplify everyday web component tasks, such as managing
properties, attributes, and rendering.

Why Lit?
Lightweight, fast, great documentation, built by Google. Just like Angular

Lit Stencil
Solution type Library Compiler*
Typescript ✅ ✅
Templates Declarative templates JSX
Virtual DOM ✅** ✅
Server Side Rendering ✅ ✅
Testing Jest, Karma, Mocha, Jasmine, Web
Test Runner
Jest
Localization ✅** Plug-in / Custom solutions
Tree-shaking ✅ ❌
Lit vs Stencil

The journey of using Lit

The pros of using Lit*

*After 8 months in production

Typescript ready

Storybook ready

?????? Lightweight
* From the initial version of the component to these days, the size of it grew from 29kb
to 155kb.

⚒ Extensive toolset

?????? Localization-ready

?????? Great documentation
And community on Discord

Key takeaways

?????? Subcomponents

?????? Slots aka content projection

?????? 3rd party services integration
Yes, you can integrate components with Headless CMS

Things to consider
??????

?????? Sites consuming your components
-Developers don’t read documentation
-Communication with main application
-Different approach of doing things (ex.: HTTP requests)
-CORS

⚙ Infrastructure required (?)
If have infrastructure for your main app (with dev, staging, production) - you might need
the same for the components library

?????? Versioning
You might need versioning because in case of breaking changes.
And they happen.
Unexpectedly.

?????? Attribute values
-YOU will handle all different cases (ex.: locale
values can be different: en, en-en, en-us, en-US,
en-gb, en-ca)
-YOU will deal with incorrect values

?????? Usage with other frameworks
Wrap your Lit component into your framework’s component

‼ The most important tip

Refrain from introducing a new
framework if you can solve your
problem with your existing stack.

Thank you
Web: ilya.gorenburg.com
Twitter: @gorenburg
linkedin.com/in/gorenburg
Keynote: Lit there be light