polymer-3-converter
Tested on:
- Windows 10 - Git Bash
- MacOS Sierra (10.12.6) - Bash
The purpose of this script is to help convert a hybrid Polymer 1 web component to Polymer 3, using polymer-modulizer
.
Before Converting
In order to keep the script simple, it assumes some things about how the repo is setup. It's easiest to make these changes in master first, before making the hybrid
branch and running the converter. Some things to look for:
- It looks for the following set of linting commands to update, and you should use one of these naming conventions:
lint
,lint:html
andlint:wc
test:lint
,test:lint:html
andtest:lint:wc
- You'll want to have
strip-whitespace
in thetemplate
to get a consistent output style from the modulizer
You should also make sure the components work in Shadow DOM before converting. See: Polymer 3 Test Plan.
How to convert a Hybrid web component to a Polymer 3 web component
- Make sure you are on the master branch and have pulled the latest changes
- Branch off master and create a
hybrid
branch - Switch back to the master branch
- Make sure you have no uncommitted changes
- Add the
toPolymer3.sh
file to the root of the component repo you are converting - Run
./toPolymer3.sh "<optional_commit_message>"
- Apply any special repo patches (found in the
/patches
folder of this repo) withgit apply <patch_name>
- Put up the PR against master
- If there are specific repo issues you need to make after running the script (for example, special galen changes), you can save those as a patch and add it to the
/patches
folder here. - Once all is good, merge!
- Make a major release against master
- Make sure to check the
dependency-map.txt
file in the repo has the correct major version, so all further conversions can use the polymer 3 version of this component.
If changes have occurred on the hybrid branch, and you need to update master/polymer 3
- Go to the hybrid branch and pull the latest changes
- Make sure you have no uncommitted changes
- Add the
toPolymer3.sh
file to the root of the repo - Run
./toPolymer3.sh "<optional_commit_message>"
- Apply any special repo patches (found in the
/patches
folder of this repo) withgit apply <patch_name>
- Put up the PR against master
- If all is good (you see the same changes as made to the hybrid branch), merge and make a release!
Testing
See: Polymer 3 Test Plan.