lit / lit/lit.dev

Add more details to valid expression locations

Open
#453 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

We should document how bindings in comments, `` tags, and `` when polyfilled work or don't work.

- Bindings in comments don't break a template, but don't render
- Bindings in `<template>` will break a template (due to them being invisible to lit-html's template prep code). Use static templates instead.
- Bindings in `<style>` work in native shadow DOM, but in Shady CSS they will only render the first value and never update.
- Bindings in `<textarea>` will work for initial render (TODO verify, and we might throw soon), but if the user edits the value the binding will break.
- Bindings in open tag name position will throw in dev mode and break a template in prod mode. Bindings in close tag name position will break a template in prod mode.

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

Find the documentation section covering valid expression locations and review the listed behavior for comments, , , <textarea>, and tag-name positions. Verify the textarea note before editing, then document each case so the page reflects which bindings render, update, throw, or break templates.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.