Results Summary
Performance
Bundle Size
Build Time
Load Time
Complexity
Performance Metrics
Bundle Analysis
Build Info
About the Lit Weather Front App
Status
-
Lint
-
Build
-
Test
Links
Usage Instructions
First, follow the repo setup instructions.
Then cd into ./apps/lit/
and and use the following commands:
- Dev Command npm run dev
- Test Command npm run test
- Lint Command npm run lint
- Build Command npm run build
- Start npm start
npm run verify
from the root of the project.
App Requirements
The purpose of this project, was to build the same identical app in every frontend framework, in order to benchmark and compare their performance. As such, each app is built to meet identical requirements, which are then verified with the test suite.
Technical Requirements
- Binding user input and validation
- Fetching external data asynchronously
- Basic state management of components
- Handling fallback views (loading, errors)
- Using browser features (location, storage, etc)
- Logic blocks, for iterative content and conditionals
- Lifecycle methods (mounting, updating, unmounting)
Feature Requirements
- π¦οΈ Live weather conditions
- π 7-day weather forecast
- π City search functionality
- π Geolocation support
- πΎ Persistent location storage
- π± Responsive design
- βΏ Accessible interface
- π¨ Multi-theme support
- π§ͺ Fully unit tested
- π Internationalized

Lit Implementation
Web Components & Custom Elements
The weather-app.js
extends LitElement
and registers as <weather-app>
using customElements.define()
. All components are true Web Components that work in any framework.
Tagged Template Literals
Lit uses JavaScript tagged template literals for both HTML templates (html\
`) and CSS styles (
css``). This provides syntax highlighting and type safety without build-time compilation.
Reactive Properties
Static properties are defined with static properties = { _isLoading: { state: true } }
. Changes to these properties automatically trigger re-renders of only the affected parts.
Shared Style System
The shared-styles.js
demonstrates Lit's CSS module system using css
tagged template literals for design system consistency across components.
Shadow DOM Encapsulation
Each Lit component renders in its own Shadow DOM, providing true style encapsulation without CSS-in-JS runtime overhead.
About Lit
Real-world App
Since the weather app is very simple, and doesn't show of the full features of a framework, it may be helpful to see a more practical implementation of a Lit app. So, checkout:Intro to Lit
About Lit
Lit is a framework from Google built around Web Components. Itβs minimal, modern and uses standard browser APIs rather than reinventing the wheel. Great when you want reusable components without a massive framework overhead. Itβs gaining traction for design systems and apps that need native-feeling components.
My thoughts on Lit
Lit can feel like stepping back into the old React class component days, but actually the cohesion to web standards makes Lit pretty... lit. It's built around Web Components, which is both its greatest strength and biggest frustration. Everything is properly encapsulated and framework-agnostic, but the developer experience feels surprisingly verbose for 2025.
The weird expression syntax has caught me out a lot. Want to bind a property? Use .value="${this.temp}"
. A boolean attribute? ?disabled="${this.loading}"
. An event listener? @click="${this.handleClick}"
. It's functional once you memorize the symbols, but it breaks the flow when you're trying to think about business logic.
Class-based components can feel outdated after years of hooks and functional patterns. Creating a simple weather display requires extending LitElement
, defining @property
decorators, implementing render()
, and handling lifecycle methods manually. It works, but feels like unnecessary ceremony.
The shadow DOM isolation is cool in theory - your styles can't leak, global CSS can't interfere. But in practice, it creates more problems than it solves. Want to style components consistently? Good luck getting your design system to work across shadow boundaries. Because of this, I really struggled to get the shared weather styles working across the Lit app. If you want to submit a PR to fix this, please do!
But Lit really does shine for design systems and component libraries where you need true framework-agnostic components. I did build Email Comparison in Lit, but in heindsite, I think that was a mistake!
Choosing a Framework
Stack Match
Not sure if Lit is right for your project? Use Stack Match to select your preferences and get a tailored recommendation based on the benchmark data.
