Skip to content
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

[labs/ssr] Emit lit-node marker before node to support raw text nodes. #3667

Merged
merged 2 commits into from Feb 14, 2023

Conversation

kevinpschaaf
Copy link
Member

Moves the <!--lit-node n--> marker for identifying nodes that hydration needs to stop at (to hydrate attribute/property/event/element parts and remove defer-hydration attributes) from after the start tag to before it.

This makes it compatible with bindings to the open tag of "raw text elements" (style, script, textarea, title) whose child content is parsed as raw text rather than nodes. This requires a quick lookahead in the opcode parsing to note whether the node in question has bindings, and if so write out the node marker before the tag is opened.

This had the side-effect of simplifying the condition around whether to completely finish writing out the open tag or not, since now that condition is only whether the node is a custom element or not.

Fixes #3663

@changeset-bot
Copy link

changeset-bot bot commented Feb 14, 2023

🦋 Changeset detected

Latest commit: e9061f3

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

This PR includes changesets to release 2 packages
Name Type
@lit-labs/ssr Patch
lit-html 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 Feb 14, 2023

📊 Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -7% - +11% (-1.79ms - +2.56ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 77.94ms - 82.87ms
  • lit-html-kitchen-sink: unsure 🔍 -4% - +3% (-1.23ms - +1.10ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -4% - +5% (-0.50ms - +0.54ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -2% - +3% (-0.93ms - +1.78ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -1% - +4% (-0.63ms - +1.78ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 774.53ms - 788.63ms
  • lit-html-kitchen-sink: unsure 🔍 -5% - +5% (-4.23ms - +3.98ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -2% - +3% (-4.76ms - +9.42ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -2% - +2% (-2.41ms - +2.39ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -1% - +1% (-5.44ms - +11.03ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 767.16ms - 778.65ms
  • reactive-element-list: unsure 🔍 -2% - +1% (-14.38ms - +4.13ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
77.94ms - 82.87ms-

update

VersionAvg timevs
774.53ms - 788.63ms-

update-reflect

VersionAvg timevs
767.16ms - 778.65ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
30.76ms - 32.09ms-unsure 🔍
-4% - +3%
-1.23ms - +1.10ms
unsure 🔍
-5% - +1%
-1.73ms - +0.23ms
tip-of-tree
tip-of-tree
30.53ms - 32.45msunsure 🔍
-4% - +4%
-1.10ms - +1.23ms
-unsure 🔍
-6% - +2%
-1.88ms - +0.51ms
previous-release
previous-release
31.46ms - 32.89msunsure 🔍
-1% - +6%
-0.23ms - +1.73ms
unsure 🔍
-2% - +6%
-0.51ms - +1.88ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
77.72ms - 84.46ms-unsure 🔍
-5% - +5%
-4.23ms - +3.98ms
unsure 🔍
-3% - +8%
-1.95ms - +6.21ms
tip-of-tree
tip-of-tree
78.87ms - 83.56msunsure 🔍
-5% - +5%
-3.98ms - +4.23ms
-unsure 🔍
-1% - +7%
-1.03ms - +5.55ms
previous-release
previous-release
76.66ms - 81.26msunsure 🔍
-8% - +2%
-6.21ms - +1.95ms
unsure 🔍
-7% - +1%
-5.55ms - +1.03ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
23.14ms - 26.10ms-unsure 🔍
-7% - +11%
-1.79ms - +2.56ms
unsure 🔍
-7% - +10%
-1.74ms - +2.45ms
tip-of-tree
tip-of-tree
22.65ms - 25.83msunsure 🔍
-10% - +7%
-2.56ms - +1.79ms
-unsure 🔍
-9% - +9%
-2.20ms - +2.14ms
previous-release
previous-release
22.79ms - 25.74msunsure 🔍
-10% - +7%
-2.45ms - +1.74ms
unsure 🔍
-9% - +9%
-2.14ms - +2.20ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
11.34ms - 12.08ms-unsure 🔍
-4% - +5%
-0.50ms - +0.54ms
unsure 🔍
-5% - +4%
-0.53ms - +0.51ms
tip-of-tree
tip-of-tree
11.33ms - 12.05msunsure 🔍
-5% - +4%
-0.54ms - +0.50ms
-unsure 🔍
-5% - +4%
-0.55ms - +0.49ms
previous-release
previous-release
11.35ms - 12.09msunsure 🔍
-4% - +5%
-0.51ms - +0.53ms
unsure 🔍
-4% - +5%
-0.49ms - +0.55ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
301.09ms - 312.65ms-unsure 🔍
-2% - +3%
-4.76ms - +9.42ms
unsure 🔍
-2% - +3%
-6.28ms - +8.90ms
tip-of-tree
tip-of-tree
300.44ms - 308.65msunsure 🔍
-3% - +2%
-9.42ms - +4.76ms
-unsure 🔍
-2% - +2%
-7.42ms - +5.39ms
previous-release
previous-release
300.65ms - 310.48msunsure 🔍
-3% - +2%
-8.90ms - +6.28ms
unsure 🔍
-2% - +2%
-5.39ms - +7.42ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
53.46ms - 55.12ms-unsure 🔍
-2% - +3%
-0.93ms - +1.78ms
unsure 🔍
-2% - +3%
-0.92ms - +1.65ms
tip-of-tree
tip-of-tree
52.80ms - 54.93msunsure 🔍
-3% - +2%
-1.78ms - +0.93ms
-unsure 🔍
-3% - +3%
-1.50ms - +1.38ms
previous-release
previous-release
52.95ms - 54.90msunsure 🔍
-3% - +2%
-1.65ms - +0.92ms
unsure 🔍
-3% - +3%
-1.38ms - +1.50ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
112.10ms - 115.54ms-unsure 🔍
-2% - +2%
-2.41ms - +2.39ms
unsure 🔍
-1% - +2%
-1.58ms - +2.81ms
tip-of-tree
tip-of-tree
112.15ms - 115.50msunsure 🔍
-2% - +2%
-2.39ms - +2.41ms
-unsure 🔍
-1% - +2%
-1.53ms - +2.78ms
previous-release
previous-release
111.84ms - 114.56msunsure 🔍
-2% - +1%
-2.81ms - +1.58ms
unsure 🔍
-2% - +1%
-2.78ms - +1.53ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
50.25ms - 51.98ms-unsure 🔍
-1% - +4%
-0.63ms - +1.78ms
unsure 🔍
-1% - +3%
-0.62ms - +1.57ms
tip-of-tree
tip-of-tree
49.70ms - 51.38msunsure 🔍
-3% - +1%
-1.78ms - +0.63ms
-unsure 🔍
-2% - +2%
-1.18ms - +0.98ms
previous-release
previous-release
49.96ms - 51.32msunsure 🔍
-3% - +1%
-1.57ms - +0.62ms
unsure 🔍
-2% - +2%
-0.98ms - +1.18ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
763.94ms - 775.49ms-unsure 🔍
-1% - +1%
-5.44ms - +11.03ms
unsure 🔍
-2% - +1%
-11.75ms - +6.29ms
tip-of-tree
tip-of-tree
761.04ms - 772.79msunsure 🔍
-1% - +1%
-11.03ms - +5.44ms
-unsure 🔍
-2% - +0%
-14.62ms - +3.56ms
previous-release
previous-release
765.51ms - 779.38msunsure 🔍
-1% - +2%
-6.29ms - +11.75ms
unsure 🔍
-0% - +2%
-3.56ms - +14.62ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
778.51ms - 789.94ms-unsure 🔍
-2% - +1%
-14.38ms - +4.13ms
unsure 🔍
-2% - +0%
-17.50ms - +1.89ms
tip-of-tree
tip-of-tree
782.07ms - 796.63msunsure 🔍
-1% - +2%
-4.13ms - +14.38ms
-unsure 🔍
-2% - +1%
-13.37ms - +8.01ms
previous-release
previous-release
784.20ms - 799.86msunsure 🔍
-0% - +2%
-1.89ms - +17.50ms
unsure 🔍
-1% - +2%
-8.01ms - +13.37ms
-

tachometer-reporter-action v2 for Benchmarks

Copy link
Member

@augustjk augustjk left a comment

Choose a reason for hiding this comment

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

LGTM with the one minor suggestion.

packages/labs/ssr/src/test/integration/tests/basic.ts Outdated Show resolved Hide resolved
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] Binding to textarea results comment node errantly added inside textarea
2 participants