Currently all of Chrome's Polymer WebUIs use Polymer 1, which is using Shadow DOM v0 and will eventually get removed from Chrome (unclear when exactly). Polymer 2 is out for a few months now, and besides using Shadow DOM v1, it has many benefits over Polymer 1.
Should we migrate to Polymer2?
I think so, because Polymer 2 has incorporated basically all the feedback that we (and other early adopters of Polymer) gave back to the Polymer team, and as a result is a big improvement.
- Its API is cleaner (less idiomatic).
- Uses the new Shadow DOM v1 (which has consensus from other major browsers).
- Is more modular (no more including unnecessary polyfils), will help with performance by loading smaller amounts of code.
If others agree (we can talk about this here, or an a separate thread), we should start thinking and documenting the work necessary to migrate all of Polymer WebUIs to Polymer 2, since it will require a long and co-ordinated effort.
Some of my initial findings/suggestions:
A possible viable approach (based on [1]) would be to
1) Modify our code to conform to "hybrid" mode, while still using Polymer 1.
2) Add Polymer2 to somewhere under third_party/polymer/ along side with existing Polymer1.
3) Start migrating WebUI pages to use Polymer2 core instead of Polymer1 core.
4) Once all pages are migrated, delete Polymer1 from third_party/polymer
Regarding step 1, we need to roll a bunch of paper-*, iron-* elements to their latest versions, which conform to "hybrid" mode, see for example [2] where paper-button was updated to "hybrid".
Thinking of keeping this bug as a metabug, tracking the high level discussion/approach, and file dependent bugs for all discovered work items.
[1] https://www.polymer-project.org/2.0/docs/upgrade
[2] https://github.com/PolymerElements/paper-button/commit/008c39267dae35c6a74920132b515fa231ace512?diff=split
Comment 1 by dschuyler@chromium.org
, Jul 5 2017