-
Notifications
You must be signed in to change notification settings - Fork 1k
[labs/ssr] Make attribute handling case-insensitive #3977
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
Conversation
🦋 Changeset detectedLatest commit: a34c1ca The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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
|
|
#3978 fixes the breaking test in the pipeline. |
a68eaaa to
39e5261
Compare
Rebased to bring this in and local tests are now passing. |
AndrewJakubowicz
left a comment
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.
Great!
AndrewJakubowicz
left a comment
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.
Thanks for addressing feedback!
|
Discussed offline with @AndrewJakubowicz about whether lowercasing all attributes is the right thing to do since SVG elements in the browser are case-sensitive. Marking this as draft while we consider this. |
a696750 to
2ab5453
Compare
|
Updated to not modify ssr-dom-shim, just the element renderer. #3972 (comment) |
Approach changed significantly from original review.
| }; | ||
| }, | ||
|
|
||
| 'LitElement: Attribute binding (mixed case)': () => { |
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.
Is it possible to add a test case where attribute casing is preserved? E.g. svg element in a render template?
Edit: A test that would have been broken by the DOM shim changes - but not this change.
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.
I added it separately as a unit test that makes sure the rendered markup has attribute casing preserved. How the browser handles that is up to the browser.
I do have a suspicion that something isn't quite right in how lit-html handles this in the browser.
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.
What is making you suspect something?
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.
I tried some combinations in the playground and found inconsistent results. I'll investigate and document in a separate issue. :)
Fixes #3972
ssr-dom-shimwas updated so all attribute methods lowercase the name as the browser does.LitElementRenderernow also lowercases the attribute name when callingattributeToPropertywith it.