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

Skip to content

Conversation

@AndrewJakubowicz
Copy link
Contributor

Issue: #189
RFC: lit/rfcs#21
Full prototype PR: #3984

Why

It's possible to create a binding in a comment node.

For example: html<!-- ${'hi'} -->. It also occurs if a portion of a template with bindings is commented out.

How

The compiler transform handles this in exactly the same way as the runtime lit-html prepare phase. We find the markers and add no-op comment parts for those values.

Test

Add golden (and also manually check the golden result): https://lit.dev/playground/#gist=21e8224b1195990b09d9a5821b441dfc

@changeset-bot
Copy link

changeset-bot bot commented Aug 1, 2023

🦋 Changeset detected

Latest commit: 61ce6b5

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

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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 Aug 1, 2023

📊 Tachometer Benchmark Results

Summary

nop-update

  • this-change, tip-of-tree, previous-release: unsure 🔍 -7% - +5% (-1.39ms - +1.01ms)
    this-change vs tip-of-tree

render

  • this-change: 67.00ms - 70.89ms
  • this-change, tip-of-tree, previous-release: unsure 🔍 -3% - +6% (-0.76ms - +1.50ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -3% - +0% (-1.67ms - +0.15ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -1% - +2% (-0.65ms - +0.84ms)
    this-change vs tip-of-tree

update

  • this-change: 667.03ms - 681.49ms
  • this-change, tip-of-tree, previous-release: unsure 🔍 -9% - +1% (-6.52ms - +0.52ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -2% - +1% (-2.49ms - +0.79ms)
    this-change vs tip-of-tree
  • this-change, tip-of-tree, previous-release: unsure 🔍 -0% - +1% (-2.29ms - +5.99ms)
    this-change vs tip-of-tree

update-reflect

  • this-change: 648.80ms - 660.05ms
  • this-change, tip-of-tree, previous-release: unsure 🔍 -1% - +1% (-6.24ms - +3.76ms)
    this-change vs tip-of-tree

Results

this-change

render

VersionAvg timevs
67.00ms - 70.89ms-

update

VersionAvg timevs
667.03ms - 681.49ms-

update-reflect

VersionAvg timevs
648.80ms - 660.05ms-
this-change, tip-of-tree, previous-release

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
26.71ms - 28.38ms-unsure 🔍
-3% - +6%
-0.76ms - +1.50ms
unsure 🔍
-2% - +6%
-0.56ms - +1.71ms
tip-of-tree
tip-of-tree
26.41ms - 27.94msunsure 🔍
-5% - +3%
-1.50ms - +0.76ms
-unsure 🔍
-3% - +5%
-0.88ms - +1.28ms
previous-release
previous-release
26.21ms - 27.73msunsure 🔍
-6% - +2%
-1.71ms - +0.56ms
unsure 🔍
-5% - +3%
-1.28ms - +0.88ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
68.51ms - 72.24ms-unsure 🔍
-9% - +1%
-6.52ms - +0.52ms
unsure 🔍
-6% - +2%
-4.22ms - +1.78ms
tip-of-tree
tip-of-tree
70.39ms - 76.36msunsure 🔍
-1% - +9%
-0.52ms - +6.52ms
-unsure 🔍
-3% - +8%
-2.01ms - +5.58ms
previous-release
previous-release
69.24ms - 73.94msunsure 🔍
-3% - +6%
-1.78ms - +4.22ms
unsure 🔍
-8% - +3%
-5.58ms - +2.01ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
19.09ms - 20.90ms-unsure 🔍
-7% - +5%
-1.39ms - +1.01ms
unsure 🔍
-8% - +6%
-1.66ms - +1.27ms
tip-of-tree
tip-of-tree
19.39ms - 20.98msunsure 🔍
-5% - +7%
-1.01ms - +1.39ms
-unsure 🔍
-7% - +7%
-1.41ms - +1.40ms
previous-release
previous-release
19.03ms - 21.35msunsure 🔍
-6% - +8%
-1.27ms - +1.66ms
unsure 🔍
-7% - +7%
-1.40ms - +1.41ms
-
this-change, tip-of-tree, previous-release

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
47.81ms - 48.87ms-unsure 🔍
-3% - +0%
-1.67ms - +0.15ms
faster ✔
0% - 3%
0.03ms - 1.62ms
tip-of-tree
tip-of-tree
48.36ms - 49.84msunsure 🔍
-0% - +3%
-0.15ms - +1.67ms
-unsure 🔍
-2% - +2%
-1.01ms - +0.88ms
previous-release
previous-release
48.57ms - 49.75msslower ❌
0% - 3%
0.03ms - 1.62ms
unsure 🔍
-2% - +2%
-0.88ms - +1.01ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
100.19ms - 101.96ms-unsure 🔍
-2% - +1%
-2.49ms - +0.79ms
unsure 🔍
-2% - +1%
-1.66ms - +1.06ms
tip-of-tree
tip-of-tree
100.55ms - 103.31msunsure 🔍
-1% - +2%
-0.79ms - +2.49ms
-unsure 🔍
-1% - +2%
-1.18ms - +2.27ms
previous-release
previous-release
100.35ms - 102.41msunsure 🔍
-1% - +2%
-1.06ms - +1.66ms
unsure 🔍
-2% - +1%
-2.27ms - +1.18ms
-
this-change, tip-of-tree, previous-release

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
44.62ms - 45.67ms-unsure 🔍
-1% - +2%
-0.65ms - +0.84ms
unsure 🔍
-2% - +1%
-1.03ms - +0.46ms
tip-of-tree
tip-of-tree
44.52ms - 45.57msunsure 🔍
-2% - +1%
-0.84ms - +0.65ms
-unsure 🔍
-2% - +1%
-1.13ms - +0.37ms
previous-release
previous-release
44.90ms - 45.96msunsure 🔍
-1% - +2%
-0.46ms - +1.03ms
unsure 🔍
-1% - +3%
-0.37ms - +1.13ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
661.09ms - 666.42ms-unsure 🔍
-0% - +1%
-2.29ms - +5.99ms
unsure 🔍
-1% - +0%
-4.95ms - +2.98ms
tip-of-tree
tip-of-tree
658.74ms - 665.07msunsure 🔍
-1% - +0%
-5.99ms - +2.29ms
-unsure 🔍
-1% - +0%
-7.15ms - +1.48ms
previous-release
previous-release
661.81ms - 667.67msunsure 🔍
-0% - +1%
-2.98ms - +4.95ms
unsure 🔍
-0% - +1%
-1.48ms - +7.15ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
668.83ms - 677.05ms-unsure 🔍
-1% - +1%
-6.24ms - +3.76ms
unsure 🔍
-1% - +1%
-4.19ms - +5.66ms
tip-of-tree
tip-of-tree
671.34ms - 677.03msunsure 🔍
-1% - +1%
-3.76ms - +6.24ms
-unsure 🔍
-0% - +1%
-1.96ms - +5.91ms
previous-release
previous-release
669.50ms - 674.92msunsure 🔍
-1% - +1%
-5.66ms - +4.19ms
unsure 🔍
-1% - +0%
-5.91ms - +1.96ms
-

tachometer-reporter-action v2 for Benchmarks

Copy link
Collaborator

@rictic rictic left a comment

Choose a reason for hiding this comment

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

Nice!

@AndrewJakubowicz AndrewJakubowicz merged commit bd0ad1d into main Aug 1, 2023
@AndrewJakubowicz AndrewJakubowicz deleted the compiler-comment-binding branch August 1, 2023 23:30
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.

3 participants