npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

iron-lazy-pages

v3.0.2

Published

Organizes a set of pages and shows one at a time, lazy-loading all element definitions.

Downloads

79

Readme

iron-lazy-pages

Published on webcomponents.org Build Status

<iron-pages> with lazy-loading functionality.

Lazy-loading pages

Big applications have a lot of pages. On first load, loading all page elements is undesirable. Most of the pages are unused for the current user. To solve these performance issues, lazy-loading provides an easy-to-use solution.

Lazy-loading means that all elements of your page are loaded when the user opens the respective page. E.g. when your user visits domain.com/about, all elements on the about page are fetched and loaded.

Example:

<iron-lazy-pages attr-for-selected="data-route" selected="{{route}}">
  <x-foo data-route="foo" data-path="demo/x-foo.html"></x-foo>
  <x-bar data-route="bar" data-path="demo/x-bar.html"></x-bar>
  <section data-route="baz">
    Inline element baz.
  </section>
</iron-lazy-pages>

In the above example, whenever the user routes to domain.com/foo, the elements defined in foo/foo.html are fetched from the server and loaded by Polymer.

Consequently whenever the selected value changes from foo to bar, the page foo will be hidden.

Fetching is only performed once, e.g. switching from foo to bar to foo will fetch foo once and show foo twice.

<dom-if> support

You can also add <dom-if> as a route to enable restamping:

<iron-lazy-pages
    attr-for-selected="data-route"
    selected="{{route}}"
    loading="{{loading}}"
    hide-immediately>
  <template is="dom-if" data-route="foo" restamp>
    Leaving this tab and coming back will loose input value due to restamp<br/>
    <input type="text"/>
  </template>
  <template is="dom-if" data-route="bar">
    Leaving this tab and coming back will keep input value<br/>
    <input type="text"/>
  </template>
</iron-lazy-pages>