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

embed-page

v0.0.20

Published

Proof of concept for Embeddable Progressive Application - a microapplication container, a WebComponent acting as seamless IFRAME or html include

Downloads

100

Readme

<embed-page>

Proof of concept for Embeddable Progressive Application

  • a microapplication container, a WebComponent acting as seamless IFRAME and html include

NPM version Published on webcomponents.org Join the chat at https://gitter.im/embed-page/Lobby

Where to use?

<embed-page/> covers 2 extreme cases.

  1. Super-simple development with library of pre-made microapplications and plain html codebase. It assumes no web component knowledge and development.
  2. Super-complex apps where on same page need to mix UX made with different frameworks and their incompatible otherwise revisions. The JS Context insulation of embed-page provides "evolutionary architecture" support to web page.

Security

Briefly, increases security by jailing 3rd party content and JS, a secure alternative to directly including of 3rd party JS into page.

The scope insulation for DOM and CSS is done by WebComponet shadow dom, API for JS are insulated by closure for global objects with wrappers limiting the dom access root to component content. Similar approach is applied for url, storage, cookies, etc.

Use

  1. Add to project via npm, bower, or simply placing embed-page.js into project tree
  2. Import into page/module either by ES6 import, simple SCRIPT tag, webcomponent link rel="import", or AMD require
  3. Develop your reusable widgets as insulated HTML and include into page by <embed-page> or

Add some useful 3rd party microapplication into your page same way.

The content could be set either by src attribute or by Polymer {{data}} binding of content; including the insulated content in TEMPLATE; or binding content via html attribute.

    <embed-page src="abc.html" ></embed-page><!-- like seamless iframe -->
    
    <embed-page src="demo-menu.html" scope="none" ></embed-page><!-- like html import, no insulation -->
    

    <embed-page>    <!-- inline scope insulation -->
         <template>
             <style>h1{color:chocolate;}</style>
             <h1> In chocolate only itself, no fumes spread. </h1>
         <template>
    </embed-page>


    <!-- dynamic content binding -->
    <iron-ajax  last-response="{{htmlContent}}" url="abc.html" auto ></iron-ajax>
    <embed-page html="[[htmlContent]]"></embed-page>    

At the moment <embed-page> resides in Polymer echosystem, file the change request if need other or no framework compatibility.

Dependencies

Polymer 3 Element is a base for embed-page. No other dependencies in run time planned before first release ( currently project is in pre-release alpha stage). Polymer Paper Elements and Vaadin are used for demo and are not required to use <embed-page/>

To see in action

See the live basic DEMO on CDN , JSFiddle , or locally run

$ polymer serve --open

It will open the demo page in browser. In demo the external page is loaded into shadow dom and its embedded and referenced JS will work with document via wrapper in same way as standalone page.

The host page document is not available from embedded content, which is validated by using same DOM selectors as in host page as in instances of <embed-page>.

Project

Install the Polymer-CLI

First, make sure you have the Polymer CLI and npm (packaged with Node.js) installed. Run npm install to install your element's dependencies, then run polymer serve to serve your element locally.

Viewing Your Element

$ polymer serve

Running Tests

$ polymer test

Demo pages are set up to be tested via web-component-tester. Run polymer test to run your application's test suite locally.