lit / lit/lit.dev

More docs on working with slotted children

Open
#628 0 comments 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

https://github.com/lit/lit.dev/pull/571#discussion_r770901532 adds a new section on slotted children in the context of the composition doc. We also discuss this in the shadow DOM doc, but some aspects are not really covered either place:

- Listening to events (where to install the listener, how to clean up if you installed them directly on the children and they are removed).
- Maybe mentioning MutationObserver and that slotchange is better because of reprojection.
- Discuss when or whether to set attributes and properties, etc.
- Registration order and events are a tricky topic that should be covered somewhere - it's possible when trying to use events to communicate that a child can fire them before the parent is upgraded and can listen.

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 composition and shadow DOM documentation, along with the linked pull request discussion. Determine where the listed topics fit, then update the docs so they cover event listeners and cleanup, slotchange versus MutationObserver, attributes and properties, and registration order; done means each concern is addressed clearly.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.