{"id":20251716,"url":"https://github.com/osdevisnot/supertag","last_synced_at":"2025-04-10T23:16:51.474Z","repository":{"id":57374866,"uuid":"164580115","full_name":"osdevisnot/supertag","owner":"osdevisnot","description":"Supertag is a light weight library to create self contained, reusable Web Components","archived":false,"fork":false,"pushed_at":"2019-10-15T16:01:25.000Z","size":102,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T23:16:38.192Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://npm.im/supertag","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osdevisnot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-08T06:32:32.000Z","updated_at":"2024-01-23T20:21:10.000Z","dependencies_parsed_at":"2022-08-29T21:00:58.160Z","dependency_job_id":null,"html_url":"https://github.com/osdevisnot/supertag","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdevisnot%2Fsupertag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdevisnot%2Fsupertag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdevisnot%2Fsupertag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osdevisnot%2Fsupertag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osdevisnot","download_url":"https://codeload.github.com/osdevisnot/supertag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312132,"owners_count":21082638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T10:12:26.783Z","updated_at":"2025-04-10T23:16:51.450Z","avatar_url":"https://github.com/osdevisnot.png","language":"TypeScript","readme":"# Supertag\n\n\u003e create self contained, reusable web components\n\nSupertag is a light weight library to create self contained, reusable **Web Components**.\n\n[![The GZIP size of Supertag](http://img.badgesize.io/https://unpkg.com/supertag?compression=gzip\u0026label=GZIP%20Size)](https://unpkg.com/supertag)\n[![The Brotli size of Supertag](http://img.badgesize.io/https://unpkg.com/supertag?compression=brotli\u0026label=Brotli%20Size)](https://unpkg.com/supertag)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\n## Features\n\n- **Standards Based:** `Supertag` uses latest features of web platform such as [**Custom Elements**](https://developers.google.com/web/fundamentals/web-components/customelements) and [**Shadow DOM**](https://developers.google.com/web/fundamentals/web-components/shadowdom) and combines them with fast and efficient vDOM rendering based on [**Superfine**](https://github.com/jorgebucaran/superfine).\n\n- **Lightweight: \u003c 2 kb min \u0026 gzipped** - extremely light weight solution for creating self contained, reusable [**Web Components**](https://developer.mozilla.org/en-US/docs/Web/Web_Components)\n\n- **Fast** - `Supertag` enables async rendering at next [micro-task timing](https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/). Multiple calls to render are automatically batched for blazing fast view updates.\n\n## Motivation\n\nWe believe, that the emerging [**Web Components**](https://developer.mozilla.org/en-US/docs/Web/Web_Components) standard has reached a level where **truly reusable component can now become a reality**. Browser support for [**Custom Elements**](https://caniuse.com/#feat=custom-elementsv1) \u0026 [**Shadow DOM**](https://caniuse.com/#feat=shadowdomv1) is comprehensive and Framework support for Web Components is at par.\n\n\u003e See [**Custom Elements Everywhere**](https://custom-elements-everywhere.com/) - a fantastic initiative by [Rob Dodson](https://github.com/robdodson) which tracks support for many popular frameworks.\n\nHowever, the ergonomics around vanilla web components are too low level and often inconvenient, which is where `Supertag` plays a role. Primary focus for `Supertag` is to make **authoring and shipping** web components as painless as possible while still staying true to its minimalism promise.\n\n## Installation\n\nGrab a copy from [CDN](https://unpkg.com/supertag):\n\n```html\n\u003cscript src=\"https://unpkg.com/supertag\"\u003e\u003c/script\u003e\n```\n\nOr install it from NPM:\n\n```bash\nnpm i supertag\n```\n\nand use it with module bundlers like `webpack` or `parcel` as you normally would.\n\n## Usage\n\nOur first example is a component that can increment and decrement a counter\n\n```js\nimport { Component, h } from 'supertag';\n\nclass HelloCounter extends Component {\n\tget count() {\n\t\treturn Number(this.getAttribute('count') || 0);\n\t}\n\tset count(value) {\n\t\tthis.setAttribute('count', String(value));\n\t}\n\tstatic get observedAttributes() {\n\t\treturn ['count'];\n\t}\n\trender() {\n\t\treturn (\n\t\t\t\u003cdiv\u003e\n\t\t\t\t\u003ch1\u003e{this.count}\u003c/h1\u003e\n\t\t\t\t\u003cbutton onclick={() =\u003e this.count--}\u003e-\u003c/button\u003e\n\t\t\t\t\u003cbutton onclick={() =\u003e this.count++}\u003e+\u003c/button\u003e\n\t\t\t\t\u003cbutton onclick={() =\u003e (this.count = this.count + 10)}\u003e+10\u003c/button\u003e\n\t\t\t\u003c/div\u003e\n\t\t);\n\t}\n}\n```\n\nEvery time a `count` changes, we create a virtual DOM representation as described by `render` method. We then diff it against an existing virtual DOM representation and patch the real DOM using efficient diff and patch algorithm.\n\n## Contributing\n\nScaffolded using [`tslib-cli`](https://www.npmjs.com/package/tslib-cli).\n\nRun `yarn` or `npm install` in root folder to setup your project.\n\n### Available Commands:\n\n```bash\nyarn build # builds the package\nyarn test # run tests for the package\nyarn coverage # run tests and generate coverage reports\nyarn pub # publish to NPM\nyarn format # prettier format\nyarn lint # lint pkg files\nyarn setup # clean setup\n```\n\n## License\n\n[MIT License](https://oss.ninja/mit/osdevisnot) @ [osdevisnot](https://github.com/osdevisnot)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosdevisnot%2Fsupertag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosdevisnot%2Fsupertag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosdevisnot%2Fsupertag/lists"}