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

Remove abstract from members of ElementRendererConstructor type #3584

Merged
merged 1 commit into from Jan 25, 2023

Conversation

justinfagnani
Copy link
Collaborator

This lets you write mixins against ElementRendererConstructor without errors that you're not implementing abstract members.

For example, mixins are useful for modifying existing renderers:

const excludeElements = (
  renderer: ElementRendererConstructor,
  excludedTagNames: Array<string>
) => {
  return class ExcludeElementRenderer extends renderer {
    static matchesClass(
      ceClass: typeof HTMLElement,
      tagName: string,
      attributes: Map<string, string>
    ) {
      return !excludedTagNames.includes(tagName) && super.matchesClass(ceClass, tagName, attributes);
    }
  };
};

@changeset-bot
Copy link

changeset-bot bot commented Jan 18, 2023

🦋 Changeset detected

Latest commit: be81c2c

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 Jan 18, 2023

📊 Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -3% - +8% (-0.71ms - +1.65ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 81.69ms - 84.30ms
  • lit-html-kitchen-sink: unsure 🔍 -7% - +2% (-2.15ms - +0.53ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -4% - +5% (-0.46ms - +0.62ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -1% - +2% (-0.66ms - +1.20ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -3% - +2% (-1.86ms - +0.84ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 686.21ms - 691.87ms
  • lit-html-kitchen-sink: unsure 🔍 -0% - +7% (-0.27ms - +5.50ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -10% - +13% (-28.85ms - +37.71ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -1% - +1% (-1.13ms - +1.22ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -1% - +0% (-6.65ms - +2.35ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 694.14ms - 698.47ms
  • reactive-element-list: unsure 🔍 -1% - +0% (-7.05ms - +2.76ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
81.69ms - 84.30ms-

update

VersionAvg timevs
686.21ms - 691.87ms-

update-reflect

VersionAvg timevs
694.14ms - 698.47ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
29.62ms - 31.55ms-unsure 🔍
-7% - +2%
-2.15ms - +0.53ms
unsure 🔍
-6% - +2%
-1.98ms - +0.71ms
tip-of-tree
tip-of-tree
30.46ms - 32.33msunsure 🔍
-2% - +7%
-0.53ms - +2.15ms
-unsure 🔍
-4% - +5%
-1.15ms - +1.50ms
previous-release
previous-release
30.28ms - 32.16msunsure 🔍
-2% - +7%
-0.71ms - +1.98ms
unsure 🔍
-5% - +4%
-1.50ms - +1.15ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
78.91ms - 83.61ms-unsure 🔍
-0% - +7%
-0.27ms - +5.50ms
unsure 🔍
-2% - +7%
-1.67ms - +5.54ms
tip-of-tree
tip-of-tree
76.97ms - 80.31msunsure 🔍
-7% - +0%
-5.50ms - +0.27ms
-unsure 🔍
-5% - +3%
-3.88ms - +2.53ms
previous-release
previous-release
76.59ms - 82.05msunsure 🔍
-7% - +2%
-5.54ms - +1.67ms
unsure 🔍
-3% - +5%
-2.53ms - +3.88ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
21.51ms - 23.59ms-unsure 🔍
-3% - +8%
-0.71ms - +1.65ms
unsure 🔍
-3% - +8%
-0.61ms - +1.67ms
tip-of-tree
tip-of-tree
21.52ms - 22.63msunsure 🔍
-7% - +3%
-1.65ms - +0.71ms
-unsure 🔍
-3% - +4%
-0.67ms - +0.79ms
previous-release
previous-release
21.55ms - 22.49msunsure 🔍
-7% - +3%
-1.67ms - +0.61ms
unsure 🔍
-4% - +3%
-0.79ms - +0.67ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
11.43ms - 12.17ms-unsure 🔍
-4% - +5%
-0.46ms - +0.62ms
unsure 🔍
-5% - +5%
-0.58ms - +0.58ms
tip-of-tree
tip-of-tree
11.32ms - 12.12msunsure 🔍
-5% - +4%
-0.62ms - +0.46ms
-unsure 🔍
-6% - +4%
-0.68ms - +0.52ms
previous-release
previous-release
11.35ms - 12.25msunsure 🔍
-5% - +5%
-0.58ms - +0.58ms
unsure 🔍
-4% - +6%
-0.52ms - +0.68ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
267.98ms - 319.00ms-unsure 🔍
-10% - +13%
-28.85ms - +37.71ms
unsure 🔍
-10% - +14%
-27.67ms - +41.12ms
tip-of-tree
tip-of-tree
267.69ms - 310.43msunsure 🔍
-13% - +10%
-37.71ms - +28.85ms
-unsure 🔍
-10% - +12%
-29.15ms - +33.74ms
previous-release
previous-release
263.70ms - 309.83msunsure 🔍
-14% - +9%
-41.12ms - +27.67ms
unsure 🔍
-12% - +10%
-33.74ms - +29.15ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
51.46ms - 52.77ms-unsure 🔍
-1% - +2%
-0.66ms - +1.20ms
unsure 🔍
-2% - +2%
-0.93ms - +1.01ms
tip-of-tree
tip-of-tree
51.18ms - 52.51msunsure 🔍
-2% - +1%
-1.20ms - +0.66ms
-unsure 🔍
-2% - +1%
-1.20ms - +0.75ms
previous-release
previous-release
51.35ms - 52.79msunsure 🔍
-2% - +2%
-1.01ms - +0.93ms
unsure 🔍
-1% - +2%
-0.75ms - +1.20ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
103.59ms - 105.33ms-unsure 🔍
-1% - +1%
-1.13ms - +1.22ms
unsure 🔍
-1% - +1%
-0.93ms - +1.33ms
tip-of-tree
tip-of-tree
103.62ms - 105.21msunsure 🔍
-1% - +1%
-1.22ms - +1.13ms
-unsure 🔍
-1% - +1%
-0.91ms - +1.23ms
previous-release
previous-release
103.53ms - 104.97msunsure 🔍
-1% - +1%
-1.33ms - +0.93ms
unsure 🔍
-1% - +1%
-1.23ms - +0.91ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
53.06ms - 54.81ms-unsure 🔍
-3% - +2%
-1.86ms - +0.84ms
unsure 🔍
-3% - +2%
-1.51ms - +1.00ms
tip-of-tree
tip-of-tree
53.42ms - 55.47msunsure 🔍
-2% - +3%
-0.84ms - +1.86ms
-unsure 🔍
-2% - +3%
-1.11ms - +1.63ms
previous-release
previous-release
53.29ms - 55.09msunsure 🔍
-2% - +3%
-1.00ms - +1.51ms
unsure 🔍
-3% - +2%
-1.63ms - +1.11ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
689.22ms - 695.68ms-unsure 🔍
-1% - +0%
-6.65ms - +2.35ms
unsure 🔍
-1% - +1%
-5.97ms - +3.51ms
tip-of-tree
tip-of-tree
691.47ms - 697.73msunsure 🔍
-0% - +1%
-2.35ms - +6.65ms
-unsure 🔍
-1% - +1%
-3.75ms - +5.60ms
previous-release
previous-release
690.21ms - 697.15msunsure 🔍
-1% - +1%
-3.51ms - +5.97ms
unsure 🔍
-1% - +1%
-5.60ms - +3.75ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
721.04ms - 728.58ms-unsure 🔍
-1% - +0%
-7.05ms - +2.76ms
unsure 🔍
-1% - +0%
-7.45ms - +2.44ms
tip-of-tree
tip-of-tree
723.82ms - 730.10msunsure 🔍
-0% - +1%
-2.76ms - +7.05ms
-unsure 🔍
-1% - +1%
-4.85ms - +4.13ms
previous-release
previous-release
724.11ms - 730.52msunsure 🔍
-0% - +1%
-2.44ms - +7.45ms
unsure 🔍
-1% - +1%
-4.13ms - +4.85ms
-

tachometer-reporter-action v2 for Benchmarks

@justinfagnani justinfagnani merged commit 61ec3da into main Jan 25, 2023
@justinfagnani justinfagnani deleted the ssr-element-renderer-ctor-interface branch January 25, 2023 02:34
@lit-robot lit-robot mentioned this pull request Mar 10, 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.

None yet

3 participants