0

Is there a way I can make Polymer WebComponents and LitElements coexist? It should be doable in theory, but afaik you cannot import html in LitElements, so it is actually infeasible. This issue try to address the problem https://github.com/Polymer/lit-element/issues/48

Is there a way to use importHref in LitElement?

alfredopacino
  • 2,979
  • 9
  • 42
  • 68
  • Below you say you're using Polymer 2.x. [This comment](https://github.com/Polymer/lit-element/issues/48#issuecomment-388293100) in the GitHub issue thread you linked to says "previously in a JS file, I could do this," meaning the `importHref` technique shown there *does* work with Polymer 2.x. Is it not working for you? What problem are you having? – Jordan Running Oct 07 '19 at 15:19

1 Answers1

1

You cannot import HTML into anything but another Polymer 2/HTML element. If you are dealing with Polymer 2 elements from Google--paper-input, iron-dropdown, etc.--use npm to install their Polymer 3.0 version. If your HTML elements are from another source, you will have to rewrite them. I was able to use polymer-modulizer to convert some simple elements to JavaScript, but it was not up to a more complex element (15 components and 5 mix-ins). (Even those that did convert I ended up rewriting to LitElement.)

Thad
  • 898
  • 13
  • 24
  • I'm migrating a project from polymer 2 to litElement. During the process I have to check if everything works fine and I need both polymer 2 components and litElement components working together. – alfredopacino Oct 07 '19 at 09:14