You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Justin Fagnani f43b811405
[all] Don't publish src/ to npm (#1964)
3 months ago
.github [all] Remove Polymer references and update links (#1795) 5 months ago
.husky [all] Fix Husky after upgrade to v6 (#1760) 5 months ago
.vscode [labs] Add @lit-labs/ssr-client and move renderLight (#1689) 6 months ago
packages [all] Don't publish src/ to npm (#1964) 3 months ago
.editorconfig [all] Remove Polymer references and update links (#1795) 5 months ago
.eslintignore [localize] Refactor to isolate runtime implementations (#1831) 4 months ago
.eslintignore-sync [lit-starter-ts/js] Fix .pretterignore syncing with lit-starter templates (#1603) 8 months ago
.eslintrc.json Simplify ESLint config (#1771) 5 months ago
.gitignore Update lit-starter-ts to lit-next 8 months ago
.npmignore Add .npmignore to actually publish the lib/ dir 4 years ago
.prettierignore [localize] Refactor to isolate runtime implementations (#1831) 4 months ago
.prettierignore-sync Fix nuke (#1800) 5 months ago
.prettierrc.json Update prettier settings; run formatter. 1 year ago
CODE_OF_CONDUCT.md Update Code of Conduct (#1712) 6 months ago
CONTRIBUTING.md [all] Remove Polymer references and update links (#1795) 5 months ago
LICENSE New copyright headers (#1630) 7 months ago
README.md lit starter new location (#1926) 4 months ago
lerna.json [localize] Upgrade to Lit 2 and add @localized decorator (#1767) 5 months ago
lit-next.code-workspace Update old references to lit-next 5 months ago
package-lock.json [all] Update Prettier to v2.3.0 (#1903) 4 months ago
package.json [all] Update Prettier to v2.3.0 (#1903) 4 months ago
rollup-common.js Add prefix to stable properties to avoid collisions with short user properties (#1942) 4 months ago

README.md

Lit

Simple. Fast. Web Components.

Build Status Published on npm Join our Slack Mentioned in Awesome Lit

Lit is a simple library for building fast, lightweight web components.

At Lit's core is a boilerplate-killing component base class that provides reactive state, scoped styles, and a declarative template system that's tiny, fast and expressive.

Documentation

See the full documentation for Lit at lit.dev.

For information about upgrading lit-html 1.x and lit-element 2.x code, see the Lit 2.0 Upgrade Guide.

npm

To install from npm:

npm i lit

Lit Monorepo

This is the monorepo for upcoming Lit packages, including lit, lit-html 2.0 and lit-element 3.0.

lit-html 1.x source is available on the lit-html-1.x branch.

Packages

  • Core packages
    • lit - The primary user-facing package of Lit which includes everything from lit-html and lit-element.
    • lit-element - The web component base class used in Lit.
    • lit-html - The rendering library used by LitElement.
    • @lit/reactive-element - A low level base class that provides a reactive lifecycle based on attribute/property changes.
  • Additional libraries
    • @lit/localize - A library and command-line tool for localizing web applications built using Lit.
    • @lit/localize-tools - Localization tooling for use with @lit/localize.
  • Labs
    • @lit-labs/ssr - A server package for rendering Lit templates and components on the server.
    • @lit-labs/ssr-client - A set of client-side support modules for rendering Lit components and templates on the server using @lit-labs/ssr.
    • @lit-labs/react - A React component wrapper for web components.
    • @lit-labs/task - A controller for Lit that renders asynchronous tasks.
    • @lit-labs/motion - Lit directives for making things move
    • @lit-labs/scoped-registry-mixin - A mixin for LitElement that integrates with the speculative Scoped CustomElementRegistry polyfill.
  • Starter kits (not published to npm)
  • Internal packages (not published to npm)
    • tests - Test infrastructure for the monorepo.
    • benchmarks - Benchmarks for testing various libraries in the monorepo.
    • internal-scripts - Utility scripts used within the monorepo.

Contributing to Lit

Lit is open source and we appreciate issue reports and pull requests. See CONTRIBUTING.md for more information.

Setting up the lit monorepo for development

Initialize repo:

git clone https://github.com/lit/lit.git
cd lit
npm install
npm run bootstrap

Build all packages:

npm run build

Test all packages:

npm run test

Run benchmarks for all packages:

npm run benchmarks

See individual package READMEs for details on developing for a specific package.

Exporting starter templates

Although we maintain lit-starter-ts and lit-starter-js in the monorepo for ease of integration testing, the source is exported back out to individual repos (ts, js) as these are GitHub Template Repositories with a nice workflow for users to create their own new element repos based on the template.

Use the following command to export new commits to the monorepo packages to a branch on the template repos (lit-next branch shown in example):

# Export TS template
git remote add lit-element-starter-ts git@github.com:PolymerLabs/lit-element-starter-ts.git
git subtree push --prefix=packages/lit-starter-ts/ lit-starter-element-ts lit-next

# Export JS template
git remote add lit-element-starter-js git@github.com:PolymerLabs/lit-starter-js.git
git subtree push --prefix=packages/lit-starter-js/ lit-starter-element-js lit-next

Notes:

  • If your version of git did not come with git-subtree, you can add it by cloning the git source at git@github.com:git/git.git and symlinking git/contrib/subtree/git-subtree into your path (e.g. /usr/local/bin)
  • If git subtree errors with a segmentation fault, try increasing your stack size prior to running, e.g. ulimit -s 16384