Skip to content

Instantly share code, notes, and snippets.

@jifalops
Last active August 25, 2017 19:20
Show Gist options
  • Save jifalops/3efaa595323a5305f14593f7d8720799 to your computer and use it in GitHub Desktop.
Save jifalops/3efaa595323a5305f14593f7d8720799 to your computer and use it in GitHub Desktop.

Polymer element 1->2 upgrade checklist

Do these in order.

bower.json

Between "main" and "dependencies":

"authors": ["Jacob Phillips (https://github.com/jifalops) <[email protected]>"],
"license": "MIT",
"keywords": [
  ""
],
"devDependencies": {
  "iron-demo-helpers": "^2.0.0",
  "iron-component-page": "^2.0.0",
  "web-component-tester": "^6.0.0",
  "webcomponentsjs": "^1.0.0"
}

element-name.html

Above <dom-module>

CSS custom property | Description | Default
------------------- | ----------- | -------
<template strip-whitespace></template>

Above Polymer

* @customElement
* @polymer
* @demo demo/index.html
/**
 * Triggered when a user taps the send button. The text may be empty.
 * @event send
 * @param {text} string The message to be sent.
 */

demo

Replace any <template is=""> usages.

<custom-style>
  <style include="demo-pages-shared-styles">
  </style>
</custom-style>
<dom-bind>
</dom-bind>
<dom-repeat items="">
  <template></template>
</dom-repeat>

readme

Use 2-3 of these.

bower i -S jifalops/xx      # Polymer 2.0 class based
bower i -S jifalops/xx#^0.2 # Polymer 2.0 hybrid (1.x compatible)
bower i -S jifalops/xx      # Polymer 2.0 hybrid (1.x compatible)
bower i -S jifalops/xx#^0.1 # Polymer 1.x based
  • Remove link to Github API (if using webcomponents v1).
    <div>
      <dom-bind>
        <template is="dom-bind">
          <next-code-block></next-code-block>
        </template>
      </dom-bind>
    </div>

@depricated Choose one disclaimer for the webcomponents.org live demo, below "## Demo".

See the full demo for examples using Polymer.
<small><i>Polymer bindings may not work in this readme demo.</i></small>

@depricated in favor of using the commented installation commands

## Releases
Version | Description
------- | -----------
0.2.0 | Polymer 1.x and 2.0 compatible (hybrid mode)
0.1.0 | Polymer 1.x based

shell

Make sure you have .gitignore, LICENSE, and polymer.json files.

...
git tag -a 0.2.0 -m ''
../tools/bin/gp.sh jifalops xx
bower register x-x https://github.com/jifalops/x-x
bower_components
node_modules
build
.idea

Published on webcomponents.org

element-name

DESCRIPTION

Installation

bower i -S jifalops/element-name      # Polymer 2.0 class based
bower i -S jifalops/element-name#^0.2 # Polymer 2.0 hybrid (1.x compatible)
bower i -S jifalops/element-name      # Polymer 2.0 hybrid (1.x compatible)
bower i -S jifalops/element-name#^0.1 # Polymer 1.x based

Usage

How/Why

  • easy to read

Demo

Polymer bindings may not work in this readme demo. See the full demo for examples using Polymer.

<element-name></element-name>

Full demo: webcomponents.org | github.

API: webcomponents.org

Contributing

  1. Fork it on Github.
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

License

MIT

{
"name": "element-name",
"description": "DESCRIPTION",
"main": "element-name.html",
"authors": ["Jacob Phillips (https://github.com/jifalops) <[email protected]>"],
"license": "MIT",
"keywords": [
""
],
"dependencies": {
"polymer": "#^2.0.0"
},
"devDependencies": {
"iron-demo-helpers": "^2.0.0",
"iron-component-page": "^2.0.0",
"web-component-tester": "^6.0.0",
"webcomponentsjs": "^1.0.0"
}
}
MIT License
Copyright (c) 2017 Jacob Phillips
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
"lint": {
"rules": ["polymer-2"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment