Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Snippets that are relatively synonymous with the
pe
andpes
snippets, but with the new ES6 spec used with polymer 2.0.The
pe2
andpes2
shortcuts are used to generate the boilerplate element code, the latter being near-identical but with an external stylesheet reference instead. Could also be logically changed top2e
, or replacepe
and have the original polymer element snippet have a different shortcut, such aspel
(for legacy).For both, the tab fields follow similarly to their legacy counterparts, with
$1
at the start polymer import path,$2
filling in the name of the element in all relevant fields, and, for the external stylesheet snippet,$3
is used to fill the name of the stylesheet to use.There is also a regex substitution in 3 places that turns the
$2
field from its expected slug-case to camelCase for use as the class name at declaration, and in the two arguments of the finalwindow.customElements.define()
call for the element.Other than the regex-replacement, the only other relative difference from the original polymer element snippets are a default properties definition, with one property named
prop1
that has a string value set by field$2
and a<h2>Hello [[prop1]]</h2>
in the template (similar to the polymer-cli element boilerplate).