chromestatus uses Polymer.Base.importHref() to lazy load a vulcanized bundle when that button is clicked. You'll only see one network request made b/c after the first click, importHref() checks if the import is already loaded on the page.
The code is here: https://github.com/GoogleChrome/chromium-dashboard/blob/master/templates/base.html#L164-L177 On Thu, Feb 9, 2017 at 6:18 PM Darin Hensley <[email protected]> wrote: > How did chromestatus.com lazyload it's element(s) for `use metrics`? When > I click on `use metrics`, I see in the network tab that only then it is > loaded and stamped...not when the app loads. > > Originally, I thought `lazyRegister: max` took care of this automatically. > But in my set up: > > <iron-pages attr-for-selected="data-route" selected="{{route}}"> > <user-login data-route="user-login"></user-login> > <single-listing data-route="single-listing"></single-listing> > </iron-pages> > > Element `single-listing` element loads when the app initially loads, even > when I have window.Polymer = { lazyRegister: 'max' } > > Is possible to see the code of chromestatus to see how they lazyloaded > their element? And is the behavior even possible with iron-pages? > > Follow Polymer on Google+: plus.google.com/107187849809354688692 > --- > You received this message because you are subscribed to the Google Groups > "Polymer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/polymer-dev/3fec0a07-862b-4778-a214-31c22368a9af%40googlegroups.com > <https://groups.google.com/d/msgid/polymer-dev/3fec0a07-862b-4778-a214-31c22368a9af%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CACGqRCB2vjWNYh_TGxXwX5M9%3D0xu6M5kgVLgOieTK0sW8NmSvA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
