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

lit-static

v2.0.1

Published

A simple base class for creating fast, lightweight web components with lit-html. But this time, it's static!

Downloads

1

Readme

Disclaimer

THIS IS NOT THE LIT-ELEMENT YOU ARE LOOKING FOR!

If you are looking for the lit-element project, you are in the wrong place buddy!

BAIL OUT NOW!

What is this then?

This is a project based on the original lit-element package. This project is the result of (slightly) modifying the output from compiling the project.

I make no promise of maintaining.

Reasoning for this project

This version aims to provide an entirely staticly hosted solution for Web Components using the lit-element interface, without the need for support from the Polymer cli tooling.

I beleive in the web being as static as possible.

The more compiling and tooling we need to create in order to deliver just adds more noise to projects, and raises the bar-for-entry to any new starters. It also creates more time spend, before value can be added.

I also believe the old browsers should die in a tragic, but maybe not so accidental, house fire, that completely obliterated all reference to their source-code. **cough** **cough** Internet Explorer **cough** **cough**

It just so happens, we are moving into an age where the future of JavaScript is now, and even the Edge team are bailing on their hot mess.

We should go back to basics. Learn the standards, and drop the tooling!

LitElement

A simple base class for creating fast, lightweight web components with lit-html. But this time, it's static!

Documentation

Full documentation is available at lit-element.polymer-project.org.

Overview

LitElement uses lit-html to render into the element's Shadow DOM and adds API to help manage element properties and attributes. LitElement reacts to changes in properties and renders declaratively using lit-html. See the lit-html guide for additional information on how to create templates for lit-element.

import {LitElement, html, css, customElement, property} from 'lit-element';

// This decorator defines the element.
@customElement('my-element')
export class MyElement extends LitElement {

  // This decorator creates a property accessor that triggers rendering and
  // an observed attribute.
  @property()
  mood = 'great';

  static styles = css`
    span {
      color: green;
    }`;

  // Render element DOM by returning a `lit-html` template.
  render() {
    return html`Web Components are <span>${this.mood}</span>!`;
  }

}
    <my-element mood="awesome"></my-element>

Note, this example uses decorators to create properties. Decorators are a proposed standard currently available in TypeScript or Babel. LitElement also supports a vanilla JavaScript method of declaring reactive properties.

Examples

Installation

From inside your project folder, run:

$ npm install lit-element

To install the web components polyfills needed for older browsers:

$ npm i -D @webcomponents/webcomponentsjs

Supported Browsers

The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition, Internet Explorer 11 is also supported.

Edge and Internet Explorer 11 require the web components polyfills.

Contributing

Please see CONTRIBUTING.md.