Open graynorton opened 7 years ago
TL;DR This is intentional.
The lazy-imports included in my-app.html
are really a stop-gap to fix some lint errors.
I have a PR out to properly handle lazy-imports. https://github.com/PolymerElements/polymer-starter-kit/pull/998
For reference, the components that are defined as lazy-imports should also be declared in the polymer.json
as fragments. This ensures that the bundling properly leaves those out for importing at a later point.
Hi, @stramel.
@justinfagnani can confirm, but arguably the main benefit of lazy imports is that they enable the tools to discover fragments via <link rel="lazy-import" ...>
tags, eliminating the need to specify them separately in polymer.json
. I don't think you'd hurt anything by including them anyway, but it's not the intended usage.
@stramel @graynorton The bundler code should discover the lazy-imports as long as they are in the transitive dependency graph of something that is specified as a fragment, in this case the shell.html
includes the lazy-import links, so bundler should identify them as a fragment wrt to bundling.
You can see the logic for this here in bundler: https://github.com/Polymer/polymer-bundler/blob/master/src/deps-index.ts#L99
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The
polymer-starter-kit-2
template inpolymer-cli
1.0.0 includes the application views as both lazy imports declared inmy-app.html
and as fragments explicitly specified inpolymer.json
.It seems that this is a mistake; I assume the intention was to include them as lazy imports only.