lit / lit/lit.dev

[doc] Best Practices Document

Open
#1,155 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
142
Forks
230
PR merge metrics
No merged PRs in 30d

Description

When using Lit, it could be helpful to have a documented list of best practices to reference.
Maybe in the form of a style-guide? E.g., https://google.github.io/styleguide/tsguide.html

This way when user questions come up asking for a best practice to do something – we can document it for all.

Rough thoughts:
- Don't reach across shadow roots. (And if you need to, how can you? – properties/context down, events up)
- Mimic native element behavior. LitElements are used just like native HTML elements, make them behave similarly. (elaborate).
- `render()` should be a pure function of state and not have side effects.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the proposed topics in this issue and the existing Lit documentation on the website. Define the scope and structure of a best-practices or style-guide document, then consider the work done when the agreed guidance is published and covers the selected topics.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.