<commit_before>This is quick experiment to try creating a custom element class using ES6's
`class` syntax. This relies on the [Polymer 0.8 preview release](https://github.com/Polymer/polymer/tree/0.8-preview) and the [Traceur](https://github.com/google/traceur-compiler) transpiler.

Some thoughts:

* Creating an element class with `class` feels good.

* Polymer's standard (ES5) syntax for defining the element tag is to define a
  `is` member on the prototype.

```
Polymer({
  is: "my-element"
});
```

The minimal definition of classes in ES6 don't (seem to?) support the
definition of a prototype member so succinctly. Instead, a getter is probably
the closest that can be managed:

```
class MyElement extends PolymerElement{

  get is() {
    return "my-element";
  }
}
```

That feels clunky. Suggestions for improvements welcome.

* Finally, it'd be nice if classes could be auto-registered. ES6 classes don't
appear to support a static constructor/initialization function, so it's unclear
how this could be achieved. The demo shows use of a static method called
`register`:

```
MyElement.register();
```

To me, this feels cleaner than

```
document.registerElement( "my-element", MyElement );
```
<commit_msg>Point to demo.<commit_after>This is quick experiment to try creating a custom element class using ES6's
`class` syntax. This relies on the [Polymer 0.8 preview release](https://github.com/Polymer/polymer/tree/0.8-preview) and the [Traceur](https://github.com/google/traceur-compiler) transpiler.

## Demo

A simple [demo](https://JanMiksovsky.github.io/polymer-classes-in-es6) shows
a "Hello, world" element created with Polymer 0.8 as an ES6 class. _Requires Google Chrome._

## Thoughts

* Creating an element class with `class` feels good.

* Polymer's standard (ES5) syntax for defining the element tag is to define a
  `is` member on the prototype.

```
Polymer({
  is: "my-element"
});
```

The minimal definition of classes in ES6 don't (seem to?) support the
definition of a prototype member so succinctly. Instead, a getter is probably
the closest that can be managed:

```
class MyElement extends PolymerElement{

  get is() {
    return "my-element";
  }
}
```

That feels clunky. Suggestions for improvements welcome.

* Finally, it'd be nice if classes could be auto-registered. ES6 classes don't
appear to support a static constructor/initialization function, so it's unclear
how this could be achieved. The demo shows use of a static method called
`register`:

```
MyElement.register();
```

To me, this feels cleaner than

```
document.registerElement( "my-element", MyElement );
```
{'fraction_non_alphanumeric': 0.10339565051507059, 'fraction_numerical': 0.007630675314765357, 'mean_word_length': 4.451143451143452, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2385555', 'n_tokens_mistral': 804, 'n_tokens_neox': 749, 'n_words': 321}