Skip to content

Conversation

@dfreedm
Copy link
Member

@dfreedm dfreedm commented Jun 4, 2021

In typescript, users can specify a private constructor to prevent
subclassing

class XFoo extends HTMLElement {
  private constructor() {
    super();
  }
}

In order to support this construction with @customElement, we have to
switch from using Constructor<HTMLElement> to Omit<typeof HTMLElement, 'new'>.

In typescript, users can specify a private constructor to prevent
subclassing

```ts
class XFoo extends HTMLElement {
  private constructor() {
    super();
  }
}
```

In order to support this construction with `@customElement`, we have to
switch from using `Constructor<HTMLElement>` to `Omit<typeof
  HTMLElement, 'new'>`.
@dfreedm dfreedm requested a review from justinfagnani as a code owner June 4, 2021 18:35
@google-cla google-cla bot added the cla: yes label Jun 4, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2021

📊 Tachometer Benchmark Results

Summary

  • lit-element-list
  • lit-html-kitchen-sink
  • lit-html-repeat
  • lit-html-template-heavy
  • reactive-element-list

Results

tachometer-reporter-action v2 for Benchmarks

@justinfagnani justinfagnani merged commit 39ad574 into main Jun 9, 2021
@justinfagnani justinfagnani deleted the private-element branch June 9, 2021 17:37
justinfagnani added a commit that referenced this pull request Aug 19, 2021
justinfagnani added a commit that referenced this pull request Aug 19, 2021
* Add SSR global demo changeset

* Add changeset for types cleanup

* Add CSSResult check changeset

* Add changeset for #1937

* Add changeset for #1943

* Add changeset for #1964

* Add changeset for #2050

* Add missing changesets

Co-authored-by: Kevin Schaaf <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants