Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@augustjk
Copy link
Member

Fixes #3972

ssr-dom-shim was updated so all attribute methods lowercase the name as the browser does.

LitElementRenderer now also lowercases the attribute name when calling attributeToProperty with it.

@changeset-bot
Copy link

changeset-bot bot commented Jun 23, 2023

🦋 Changeset detected

Latest commit: a34c1ca

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lit-labs/ssr Patch

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

@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2023

📊 Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -13% - +4% (-3.56ms - +1.02ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 78.50ms - 82.67ms
  • lit-html-kitchen-sink: unsure 🔍 -9% - +5% (-3.10ms - +1.58ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -5% - +1% (-0.58ms - +0.15ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -4% - +1% (-2.43ms - +0.35ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -4% - +0% (-2.09ms - +0.16ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 878.27ms - 892.29ms
  • lit-html-kitchen-sink: unsure 🔍 -7% - +4% (-6.68ms - +3.54ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -5% - +3% (-16.00ms - +8.85ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -1% - +2% (-1.52ms - +2.15ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -1% - +1% (-7.52ms - +10.28ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 824.47ms - 836.09ms
  • reactive-element-list: unsure 🔍 -1% - +1% (-10.65ms - +5.97ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
78.50ms - 82.67ms-

update

VersionAvg timevs
878.27ms - 892.29ms-

update-reflect

VersionAvg timevs
824.47ms - 836.09ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
31.73ms - 35.21ms-unsure 🔍
-9% - +5%
-3.10ms - +1.58ms
faster ✔
0% - 14%
0.01ms - 5.25ms
tip-of-tree
tip-of-tree
32.66ms - 35.80msunsure 🔍
-5% - +9%
-1.58ms - +3.10ms
-unsure 🔍
-12% - +2%
-4.38ms - +0.64ms
previous-release
previous-release
34.15ms - 38.06msunsure 🔍
-0% - +16%
+0.01ms - +5.25ms
unsure 🔍
-2% - +13%
-0.64ms - +4.38ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
88.04ms - 93.76ms-unsure 🔍
-7% - +4%
-6.68ms - +3.54ms
unsure 🔍
-3% - +7%
-2.34ms - +6.07ms
tip-of-tree
tip-of-tree
88.24ms - 96.71msunsure 🔍
-4% - +7%
-3.54ms - +6.68ms
-unsure 🔍
-2% - +10%
-1.80ms - +8.67ms
previous-release
previous-release
85.96ms - 92.12msunsure 🔍
-7% - +3%
-6.07ms - +2.34ms
unsure 🔍
-9% - +2%
-8.67ms - +1.80ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
23.47ms - 26.37ms-unsure 🔍
-13% - +4%
-3.56ms - +1.02ms
unsure 🔍
-11% - +5%
-2.88ms - +1.29ms
tip-of-tree
tip-of-tree
24.42ms - 27.96msunsure 🔍
-4% - +14%
-1.02ms - +3.56ms
-unsure 🔍
-7% - +11%
-1.84ms - +2.80ms
previous-release
previous-release
24.22ms - 27.21msunsure 🔍
-5% - +12%
-1.29ms - +2.88ms
unsure 🔍
-11% - +7%
-2.80ms - +1.84ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
11.13ms - 11.63ms-unsure 🔍
-5% - +1%
-0.58ms - +0.15ms
unsure 🔍
-2% - +4%
-0.18ms - +0.49ms
tip-of-tree
tip-of-tree
11.33ms - 11.86msunsure 🔍
-1% - +5%
-0.15ms - +0.58ms
-slower ❌
0% - 6%
0.02ms - 0.71ms
previous-release
previous-release
11.00ms - 11.46msunsure 🔍
-4% - +2%
-0.49ms - +0.18ms
faster ✔
0% - 6%
0.02ms - 0.71ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
327.42ms - 345.77ms-unsure 🔍
-5% - +3%
-16.00ms - +8.85ms
unsure 🔍
-4% - +3%
-11.93ms - +11.27ms
tip-of-tree
tip-of-tree
331.80ms - 348.54msunsure 🔍
-3% - +5%
-8.85ms - +16.00ms
-unsure 🔍
-2% - +4%
-7.73ms - +14.23ms
previous-release
previous-release
329.82ms - 344.02msunsure 🔍
-3% - +4%
-11.27ms - +11.93ms
unsure 🔍
-4% - +2%
-14.23ms - +7.73ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
57.42ms - 59.27ms-unsure 🔍
-4% - +1%
-2.43ms - +0.35ms
unsure 🔍
-4% - +3%
-2.20ms - +1.55ms
tip-of-tree
tip-of-tree
58.35ms - 60.42msunsure 🔍
-1% - +4%
-0.35ms - +2.43ms
-unsure 🔍
-2% - +5%
-1.21ms - +2.65ms
previous-release
previous-release
57.04ms - 60.30msunsure 🔍
-3% - +4%
-1.55ms - +2.20ms
unsure 🔍
-4% - +2%
-2.65ms - +1.21ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
124.17ms - 126.44ms-unsure 🔍
-1% - +2%
-1.52ms - +2.15ms
unsure 🔍
-1% - +1%
-1.35ms - +1.49ms
tip-of-tree
tip-of-tree
123.55ms - 126.43msunsure 🔍
-2% - +1%
-2.15ms - +1.52ms
-unsure 🔍
-2% - +1%
-1.92ms - +1.43ms
previous-release
previous-release
124.39ms - 126.08msunsure 🔍
-1% - +1%
-1.49ms - +1.35ms
unsure 🔍
-1% - +2%
-1.43ms - +1.92ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
49.52ms - 51.26ms-unsure 🔍
-4% - +0%
-2.09ms - +0.16ms
unsure 🔍
-3% - +1%
-1.65ms - +0.65ms
tip-of-tree
tip-of-tree
50.64ms - 52.07msunsure 🔍
-0% - +4%
-0.16ms - +2.09ms
-unsure 🔍
-1% - +3%
-0.58ms - +1.51ms
previous-release
previous-release
50.13ms - 51.64msunsure 🔍
-1% - +3%
-0.65ms - +1.65ms
unsure 🔍
-3% - +1%
-1.51ms - +0.58ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
883.03ms - 895.89ms-unsure 🔍
-1% - +1%
-7.52ms - +10.28ms
unsure 🔍
-1% - +1%
-6.21ms - +10.83ms
tip-of-tree
tip-of-tree
881.93ms - 894.23msunsure 🔍
-1% - +1%
-10.28ms - +7.52ms
-unsure 🔍
-1% - +1%
-7.38ms - +9.24ms
previous-release
previous-release
881.56ms - 892.74msunsure 🔍
-1% - +1%
-10.83ms - +6.21ms
unsure 🔍
-1% - +1%
-9.24ms - +7.38ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
856.80ms - 866.93ms-unsure 🔍
-1% - +1%
-10.65ms - +5.97ms
unsure 🔍
-1% - +1%
-10.49ms - +5.95ms
tip-of-tree
tip-of-tree
857.62ms - 870.79msunsure 🔍
-1% - +1%
-5.97ms - +10.65ms
-unsure 🔍
-1% - +1%
-9.16ms - +9.30ms
previous-release
previous-release
857.67ms - 870.60msunsure 🔍
-1% - +1%
-5.95ms - +10.49ms
unsure 🔍
-1% - +1%
-9.30ms - +9.16ms
-

tachometer-reporter-action v2 for Benchmarks

@augustjk
Copy link
Member Author

#3978 fixes the breaking test in the pipeline.

@augustjk augustjk force-pushed the ssr-dom-shim-attr branch from a68eaaa to 39e5261 Compare June 26, 2023 20:32
@augustjk
Copy link
Member Author

#3978 fixes the breaking test in the pipeline.

Rebased to bring this in and local tests are now passing.

Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz left a 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!

@augustjk augustjk marked this pull request as draft June 27, 2023 20:15
@augustjk
Copy link
Member Author

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.

@AndrewJakubowicz AndrewJakubowicz self-requested a review June 27, 2023 20:26
@augustjk augustjk force-pushed the ssr-dom-shim-attr branch from a696750 to 2ab5453 Compare June 30, 2023 00:11
@augustjk augustjk marked this pull request as ready for review June 30, 2023 00:12
@augustjk
Copy link
Member Author

Updated to not modify ssr-dom-shim, just the element renderer. #3972 (comment)

@augustjk augustjk dismissed AndrewJakubowicz’s stale review June 30, 2023 00:14

Approach changed significantly from original review.

};
},

'LitElement: Attribute binding (mixed case)': () => {
Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz Jun 30, 2023

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.

Copy link
Member Author

@augustjk augustjk Jun 30, 2023

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.

Copy link
Contributor

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?

Copy link
Member Author

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. :)

@augustjk augustjk merged commit a2366a3 into main Jun 30, 2023
@augustjk augustjk deleted the ssr-dom-shim-attr branch June 30, 2023 21:25
@lit-robot lit-robot mentioned this pull request Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[labs/ssr] Uppercase in attribute name behaves differently

2 participants