{"id":16982536,"url":"https://github.com/cloudspeech/sig-html","last_synced_at":"2025-03-29T07:10:41.866Z","repository":{"id":197756327,"uuid":"699264969","full_name":"cloudspeech/sig-html","owner":"cloudspeech","description":"A micro framework featuring signals + lit-html template syntax ","archived":false,"fork":false,"pushed_at":"2024-04-05T16:39:17.000Z","size":88,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T20:09:59.380Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/cloudspeech.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-10-02T09:32:03.000Z","updated_at":"2023-10-12T15:52:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b0e4409-b641-4d0b-b3ad-299b8a0b2151","html_url":"https://github.com/cloudspeech/sig-html","commit_stats":null,"previous_names":["cloudspeech/sig-html"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudspeech%2Fsig-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudspeech%2Fsig-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudspeech%2Fsig-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudspeech%2Fsig-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudspeech","download_url":"https://codeload.github.com/cloudspeech/sig-html/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246150437,"owners_count":20731419,"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-10-14T02:08:39.187Z","updated_at":"2025-03-29T07:10:41.848Z","avatar_url":"https://github.com/cloudspeech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sig-html\n sig-html is a micro framework for web apps based on plain or computed signals + lit-html template syntax.\n\n How micro? **943** bytes, when maximally Brotli-compressed!\n\n## Status\nThis is alpha-quality software and as such not ready for production.\n\n## Counter Example\n\n```js\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eCounter Example in sig-html\u003c/title\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003clink rel=\"stylesheet\" href=\"style.css\"/\u003e\n    \u003cdiv class=\"app\"\u003e\u003c/div\u003e\n    \u003cscript type=\"module\"\u003e\n      import {html, render, Signal} from './index.js';\n      const container = document.querySelector('.app');\n      const counter = new Signal(0);\n      const app = html `\u003ch1 title=\"${counter}\"\u003e${document.title}\u003c/h1\u003e\n      \u003cdiv class=\"container\"\u003e\n\t\u003cbutton @click=\"${e =\u003e counter.value++}\"\u003e+\u003c/button\u003e\n\t\u003cspan class=\"value\"\u003e${counter}\u003c/span\u003e\n\t\u003cbutton @click=\"${e =\u003e counter.value--}\"\u003e-\u003c/button\u003e\n      \u003c/div\u003e`;\n      render(container, app);\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Supported lit-html syntax\n\n```html\n\u003cdiv attribute=\"${1}\" .property=\"${2}\" ?booleanAttribute=\"${false}\" @event=\"${e =\u003e alert(e)}\"\u003e${5}\u003c/div\u003e\n```\nThis is a subset of the [full lit-html syntax](https://lit.dev/docs/templates/expressions/).\n\n## Known restrictions:\n- Signals are the only mechanism provided for reactivity\n- any template literal variables must span the _entire_ attribute value or text content in which it occurs, i.e. no `some ${aTemplateVariable} followed by other text or template variable` is allowed (for now)\n- no HTML validation or sanitizing whatsoever\n- no careful memory or performance optimizations (yet)\n\n## How to try it out\n\n1. Install [bun](https://bun.sh)\n2. bun install\n3. bun start\n4. Point your browser to http://localhost:8080/index.html **or** http://localhost:8080/counter.html **or** http://localhost:8080/spreadsheet.html **or** http://localhost:8080/eventlog.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudspeech%2Fsig-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudspeech%2Fsig-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudspeech%2Fsig-html/lists"}