Skip to content

bahrus/up-down-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

up-down-counter

NPM version How big is this package in your project?

This is the famous counter test example for web components.

Note that the "run time" files for this web component are all html based. There are, however, some JS dependencies, due primarily to lack of love shown by the WHATWG towards end users.

However, to benefit from the tooling that JS provides, a few extra hops are supported, that splits the html file into two (a bundling step could combine them back into one, which would benefit initial load, but could hurt fine-grain caching).

The Typescript-safe definition for the binding is maintained in file root.mjs, which generates the html file which is designed as the distributed file reference for the web component.

To build the html file as you edit the mjs file, run:

npm run watch

to output to def.html.

Viewing up-down-counter locally

Any web server that can serve static files will do, but...

  1. Install git.
  2. Fork/clone this repo.
  3. Install node.js
  4. Open command window to folder where you cloned this repo.
  5. npm install

  6. npm run serve

  7. Open http://localhost:3030/demo/dev.html in a modern browser.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published