Conversation
Contributor
|
ceb31a0 was deployed to: https://fred-pr1946.review.mdn.allizom.net/ |
addAttrs
caugner
force-pushed
the
curriculum-immutable-svg
branch
3 times, most recently
from
September 28, 2026 17:56
fc2d4f4 to
3724046
Compare
Move the helper out of `utils.js` unchanged and import it directly at the call sites.
`addAttrs` overwrote `original.strings` on the imported SVG template, so every SSR render appended the attributes again and gave Lit a new strings array to parse. Return a new result instead. Derived strings arrays are cached per source template and attribute set, so Lit can reuse its parsed template across renders.
caugner
force-pushed
the
curriculum-immutable-svg
branch
from
September 28, 2026 18:10
3724046 to
936fe07
Compare
caugner
marked this pull request as ready for review
September 28, 2026 18:14
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix curriculum topic icon rendering by deriving attribute variants without mutating imported SVG templates.
Motivation
Prevent repeated SSR renders from accumulating duplicate SVG attributes and changing Lit template hashes.
Additional details
Cache derived template strings by source SVG and attribute set so Lit can reuse parsed templates.
Related issues and pull requests
Related to #936.