New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lit-html] Add svg tagged template literal documentation #2479
Conversation
🦋 Changeset detectedLatest commit: 99105f5 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Tachometer Benchmark ResultsSummarynop-update
render
update
update-reflect
Resultslit-element-list
render
update
update-reflect
lit-html-kitchen-sink
render
update
nop-update
lit-html-repeat
render
update
lit-html-template-heavy
render
update
reactive-element-list
render
update
update-reflect
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Made some optional suggestions to better match the language in the guides.
Co-authored-by: Arthur Evans <arthure@google.com>
Co-authored-by: Arthur Evans <arthure@google.com>
Co-authored-by: Arthur Evans <arthure@google.com>
Co-authored-by: Arthur Evans <arthure@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took me a bit to get to this. I know it's merged, but one small thought
* function. The `<svg>` element is an HTML element and should be used within a | ||
* template tagged with the {@linkcode html} tag function. | ||
* | ||
* In LitElement usage, it's rare to return an SVG fragment from the `render()` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/rare/invalid
Include Justin's feedback on #2479. Replace rare with invalid and reflow markdown.
Include Justin's feedback on #2479. Replace 'rare' with 'invalid' and reflow markdown. Co-authored-by: Andrew Jakubowicz <ajakubowicz@google.com>
Addresses issue: lit/lit.dev#652
Also addresses generated docs for
svg
: #1883 (comment)This is a documentation only change to guide correct usage of the svg tagged template literal. Currently it's easy to reach for this whenever anything svg related comes up.
Instead of going into the implementation details for how the
svg
TTL copies the fragment into an<svg>
element and then copies that fragment over, I've instead focussed on correct usage and provided an example that shows both an svg fragment and complete svg element.Test of the code example: Lit Playground
Risks
No codebase risk, docs only change. Main risk is adding incorrect documentation.