googlearchive / polymer-upgrade

Automatically upgrade web components
Other
5 stars 5 forks source link

Polymer 2.0 breaking changes #4

Open rictic opened 7 years ago

rictic commented 7 years ago

polymer-upgrade's first project is to be a helpful companion when upgrading from Polymer v1 to Polymer v2. For every breaking change listed in the readme we should either automatically transform to the correct new code or provide a warning with an explanation of what needs to change and provide more info.

This issue will act as a tracking bug for tools support for handling those changes needed to convert from a Polymer v1 element to a hybrid Polymer v1 & v2 element.

The gold standard fix is an automatic and transformation of code here in polymer-upgrade. Next best is a lint warning or error. The remaining changes will need to be documented particularly visibly and thoroughly.

Polymer.dom

cordovapolymer commented 7 years ago

@rictic Is the polymer-upgrade tool usable? I'd like to upgrade my project for use with polymer 2.0.0-rc2

rictic commented 7 years ago

In the process of developing the upgrader we realized that it had a ton of overlap with the new linter (registry, configuration, etc). So the plan is to be able to run polymer lint to discover any issues your code has with your chosen version of Polymer (1.0, 2.0, 2.0-hybrid), and to be able to run polymer lint --fix to automatically fix as many of those issues as have unambiguous fixes.

You can try out the new linter by running polymer experimental-lint in polymer-cli@next, and in the next couple of weeks it will replace the old linter, and run as polymer lint.

rictic commented 6 years ago

polymer lint --fix is now implemented in the polymer-cli at master and will be in the next major release.

skyred commented 6 years ago

It looks polymer lint --fix was included in the polymer-cli v1.5.7 https://github.com/Polymer/polymer-cli/compare/v1.5.7...master

I gave it a try, resulting a broken site. I noticed the problems were related to this.$.* local selectors used by NeonAnimation. I am not sure if there exists an easy fix?

The site is hosted on https://github.com/techyizu/techyizu.github.io, the attempt of the upgrade is at branch https://github.com/techyizu/techyizu.github.io/commit/8bbf3367b3d6ff295198e6c3ad1551ec1ec8fd4e

@rictic Can you point me to which change on https://www.polymer-project.org/2.0/docs/upgrade that I need to fix manually?

rictic commented 6 years ago

@skyred Please file a new bug with more information about what specific problems you're seeing at https://github.com/Polymer/polymer-linter