When adding a HTML import, I want to use @PolymerImport("element-name") so that I have less chance of writing a typo in @HtmlImport("frontend://bower_components/element-name/element-name.html")
Same for Page.addHtmlImport
When this gets implemented, need to take care about flow-maven-plugin so that it is able to detect get values from those imports.
This would also help transitioning between Polymer 2 to Polymer 3, e.g. from bower_components to node_modules. May this also involve some kind of WebJars handling? Currently WebJars don's work with PolymerTemplate (see https://github.com/vaadin/flow/issues/3263).
I like the general idea, but I don't think we should tie the naming to Polymer. In the future, we may build our components with other libraries or no libraries at all. Maybe someone wants to include a stencil component or an Angular app built as a Web Component using Angular Elements.
Consider using a more generic name like @ImportComponent()
@marcushellberg One big benefit with naming this specifically for Polymer is the mentioned possibility for automatically choosing whether to do an HTML import from from bower_components or a JS module import from node_modules depending on which version of Polymer is used.
As of today, different component ecosystems have different conventions for how to import (and bundle) components, which means that we cannot reasonably have any generic annotation. Once a convention has been established, we should also create a generic annotation for that purpose.
It seems like Polymer is aligning itself with the rest of the JS world, which means that the the logical operation is to import a package, while optionally also defining a file path inside the package if not using the default (aka _main_ module).
Basic usage would thus be one of these forms:
@Import("vaadin-grid")@Import(value = "vaadin-grid", file = "vaadin-grid-selection-column.js")I guess we are not going to do anything with HTML imports anymore? Maybe close this one?
While this could be still done to change the way modules are imported, like instead of
@JsModule("@polymer/paper-slider/paper-slider.js")
would be using
@JsModule("@polymer/paper-slider")
or something else, I'm not sure if there is really enough benefit from reducing this bit.
I'm closing this issue and if there seems to be DX issues with importing modules, I would expect a new one to be opened as this has been done with the html imports era.