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...
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 months, its pros, key takeaways, and things to consider.
Size: 1.89 MB
Language: en
Added: May 27, 2024
Slides: 33 pages
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