{"versions":{"0.1.0":{"name":"@lit-labs/signals","version":"0.1.0","description":"JavaScript Signals proposal integration for Lit","license":"BSD-3-Clause","homepage":"https://lit.dev/","repository":{"type":"git","url":"git+https://github.com/lit/lit.git","directory":"packages/labs/signals"},"type":"module","main":"index.js","module":"index.js","typings":"index.d.ts","directories":{"test":"test"},"exports":{".":{"types":"./development/index.d.ts","development":"./development/index.js","default":"./index.js"}},"scripts":{"build":"wireit","build:ts":"wireit","build:ts:types":"wireit","test":"wireit","test:dev":"wireit","test:prod":"wireit"},"wireit":{"build":{"dependencies":["build:rollup","build:ts","build:ts:types","../../lit:build"]},"build:ts":{"command":"tsc --build --pretty","dependencies":["../../lit:build:ts:types"],"clean":"if-file-deleted","files":["src/**/*.ts","src/**/*.tsx","tsconfig.json"],"output":["development","tsconfig.tsbuildinfo"]},"build:ts:types":{"command":"treemirror development . \"**/*.d.ts{,.map}\"","dependencies":["../../internal-scripts:build","build:ts"],"files":[],"output":["*.d.ts{,.map}","lib/*.d.ts{,.map}","test/**/*.d.ts{,.map}"]},"build:rollup":{"command":"rollup -c","dependencies":["build:ts"],"files":["rollup.config.js","../../../rollup-common.js","src/test/*_test.html"],"output":["index.js{,.map}","lib/*.js{,.map}","test/*_test.html"]},"test":{"dependencies":["test:dev","test:prod"]},"test:dev":{"command":"MODE=dev node ../../tests/run-web-tests.js \"development/test/**/*_test.js\" --config ../../tests/web-test-runner.config.js","dependencies":["build:ts","../../tests:build"],"env":{"BROWSERS":{"external":true}},"files":[],"output":[]},"test:prod":{"command":"MODE=prod node ../../tests/run-web-tests.js \"development/test/**/*_test.js\" --config ../../tests/web-test-runner.config.js","dependencies":["build","../../tests:build"],"env":{"BROWSERS":{"external":true}},"files":[],"output":[]}},"author":{"name":"Google LLC"},"devDependencies":{"@lit-internal/scripts":"^1.0.1"},"publishConfig":{"access":"public"},"dependencies":{"lit":"^3.1.2","signal-polyfill":"^0.1.2"},"_id":"@lit-labs/signals@0.1.0","gitHead":"03771e01e9a5d21a78905fc0d5bffb876373307f","bugs":{"url":"https://github.com/lit/lit/issues"},"_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-oRtdOObCuuZSAOLbIVd7EKgu325AJk+u6VJoUQ6xCTGPezCafHDUnC+TGrAW6ac86B/9iiQ2RJvLeSCnpHKWMw==","shasum":"e89021054574f004a1e2f457387a4d56dbd56273","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@lit-labs/signals/-/signals-0.1.0.tgz","fileCount":35,"unpackedSize":90364,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCD6mPmsG30sIaBPUBbBIEtC8MPPTuzZHN3pNK7B4kFKgIhAKaMAtmPZx3pYDn249irUQpM1KLW9MwUZ/Z8yJXjFuN/"}],"size":21093},"_npmUser":{"name":"anonymous","email":"lit-robot@google.com"},"maintainers":[{"name":"anonymous","email":"ajk830@gmail.com"},{"name":"anonymous","email":"brendan@usergenic.com"},{"name":"anonymous","email":"lit-robot@google.com"},{"name":"anonymous","email":"graynorton@google.com"},{"name":"anonymous","email":"sorvell@google.com"},{"name":"anonymous","email":"aomarks@gmail.com"},{"name":"anonymous","email":"justin@fagnani.com"},{"name":"anonymous","email":"kevinpschaaf@gmail.com"},{"name":"anonymous","email":"jb@jbingham.com"},{"name":"anonymous","email":"gray@stanfordalumni.org"},{"name":"anonymous","email":"rictic@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signals_0.1.0_1728327649439_0.6572725364906247"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-10-07T19:00:49.647Z","publish_time":1728327649647,"_source_registry_name":"default","contributors":[]},"0.1.1":{"name":"@lit-labs/signals","version":"0.1.1","description":"JavaScript Signals proposal integration for Lit","license":"BSD-3-Clause","homepage":"https://lit.dev/","repository":{"type":"git","url":"git+https://github.com/lit/lit.git","directory":"packages/labs/signals"},"type":"module","main":"index.js","module":"index.js","typings":"index.d.ts","directories":{"test":"test"},"exports":{".":{"types":"./development/index.d.ts","development":"./development/index.js","default":"./index.js"}},"scripts":{"build":"wireit","build:ts":"wireit","build:ts:types":"wireit","test":"wireit","test:dev":"wireit","test:prod":"wireit"},"wireit":{"build":{"dependencies":["build:rollup","build:ts","build:ts:types","../../lit:build"]},"build:ts":{"command":"tsc --build --pretty","dependencies":["../../lit:build:ts:types"],"clean":"if-file-deleted","files":["src/**/*.ts","src/**/*.tsx","tsconfig.json"],"output":["development","tsconfig.tsbuildinfo"]},"build:ts:types":{"command":"treemirror development . \"**/*.d.ts{,.map}\"","dependencies":["../../internal-scripts:build","build:ts"],"files":[],"output":["*.d.ts{,.map}","lib/*.d.ts{,.map}","test/**/*.d.ts{,.map}"]},"build:rollup":{"command":"rollup -c","dependencies":["build:ts"],"files":["rollup.config.js","../../../rollup-common.js","src/test/*_test.html"],"output":["index.js{,.map}","lib/*.js{,.map}","test/*_test.html"]},"test":{"dependencies":["test:dev","test:prod"]},"test:dev":{"command":"MODE=dev node ../../tests/run-web-tests.js \"development/test/**/*_test.js\" --config ../../tests/web-test-runner.config.js","dependencies":["build:ts","../../tests:build"],"env":{"BROWSERS":{"external":true}},"files":[],"output":[]},"test:prod":{"command":"MODE=prod node ../../tests/run-web-tests.js \"development/test/**/*_test.js\" --config ../../tests/web-test-runner.config.js","dependencies":["build","../../tests:build"],"env":{"BROWSERS":{"external":true}},"files":[],"output":[]}},"author":{"name":"Google LLC"},"devDependencies":{"@lit-internal/scripts":"^1.0.1"},"publishConfig":{"access":"public"},"dependencies":{"lit":"^2.0.0 || ^3.0.0","signal-polyfill":"^0.2.0"},"_id":"@lit-labs/signals@0.1.1","gitHead":"873a58500c9cd8ffdc7f659229d895c92f821a74","bugs":{"url":"https://github.com/lit/lit/issues"},"_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-QQYp2CyXzxaYho4EHKLLOHLMX0Jz8HWUfGGiCKyei54Vol0DqiPggbA1z3t53oYJ3mqU/NTWF+flfcY7Tfpozg==","shasum":"8155ba9dce95fe83f0b3c795432d677eb2520ef1","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@lit-labs/signals/-/signals-0.1.1.tgz","fileCount":35,"unpackedSize":90374,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHypYoVYBASrHIHcrK9Ng0l9Netr/m71vOj1OFyCi6EzAiEA3xuBgkNrmN0alHECW8ujHB0viSSjmjxKX/EbQ43BvmA="}],"size":21102},"_npmUser":{"name":"anonymous","email":"lit-robot@google.com"},"maintainers":[{"name":"anonymous","email":"ajk830@gmail.com"},{"name":"anonymous","email":"brendan@usergenic.com"},{"name":"anonymous","email":"lit-robot@google.com"},{"name":"anonymous","email":"graynorton@google.com"},{"name":"anonymous","email":"sorvell@google.com"},{"name":"anonymous","email":"aomarks@gmail.com"},{"name":"anonymous","email":"justin@fagnani.com"},{"name":"anonymous","email":"kevinpschaaf@gmail.com"},{"name":"anonymous","email":"jb@jbingham.com"},{"name":"anonymous","email":"gray@stanfordalumni.org"},{"name":"anonymous","email":"rictic@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signals_0.1.1_1728335358401_0.348029985703707"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-10-07T21:09:18.656Z","publish_time":1728335358656,"_source_registry_name":"default","contributors":[]},"0.1.2":{"name":"@lit-labs/signals","version":"0.1.2","description":"JavaScript Signals proposal integration for Lit","license":"BSD-3-Clause","homepage":"https://lit.dev/","repository":{"type":"git","url":"git+https://github.com/lit/lit.git","directory":"packages/labs/signals"},"type":"module","main":"index.js","module":"index.js","typings":"index.d.ts","directories":{"test":"test"},"exports":{".":{"types":"./development/index.d.ts","development":"./development/index.js","default":"./index.js"}},"scripts":{"build":"wireit","build:ts":"wireit","build:ts:types":"wireit","test":"wireit","test:dev":"wireit","test:prod":"wireit"},"wireit":{"build":{"dependencies":["build:rollup","build:ts","build:ts:types","../../lit:build"]},"build:ts":{"command":"tsc --build --pretty","dependencies":["../../lit:build:ts:types"],"clean":"if-file-deleted","files":["src/**/*.ts","src/**/*.tsx","tsconfig.json"],"output":["development","tsconfig.tsbuildinfo"]},"build:ts:types":{"command":"treemirror development . \"**/*.d.ts{,.map}\"","dependencies":["../../internal-scripts:build","build:ts"],"files":[],"output":["*.d.ts{,.map}","lib/*.d.ts{,.map}","test/**/*.d.ts{,.map}"]},"build:rollup":{"command":"rollup -c","dependencies":["build:ts"],"files":["rollup.config.js","../../../rollup-common.js","src/test/*_test.html"],"output":["index.js{,.map}","lib/*.js{,.map}","test/*_test.html"]},"test":{"dependencies":["test:dev","test:prod"]},"test:dev":{"command":"MODE=dev node ../../tests/run-web-tests.js \"development/test/**/*_test.js\" --config ../../tests/web-test-runner.config.js","dependencies":["build:ts","../../tests:build"],"env":{"BROWSERS":{"external":true}},"files":[],"output":[]},"test:prod":{"command":"MODE=prod node ../../tests/run-web-tests.js \"development/test/**/*_test.js\" --config ../../tests/web-test-runner.config.js","dependencies":["build","../../tests:build"],"env":{"BROWSERS":{"external":true}},"files":[],"output":[]}},"author":{"name":"Google LLC"},"devDependencies":{"@lit-internal/scripts":"^1.0.1"},"publishConfig":{"access":"public"},"dependencies":{"lit":"^2.0.0 || ^3.0.0","signal-polyfill":"^0.2.0"},"_id":"@lit-labs/signals@0.1.2","gitHead":"7db8eadb285c2a55fe4aa78c491585e1e90d3b1c","bugs":{"url":"https://github.com/lit/lit/issues"},"_nodeVersion":"20.18.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-hkOL0ua4ILeHlaJ8IqFKS+Y+dpYznWaDhdikzwt3zJ1/LPz3Etft4OPIMoltzbBJS5pyXPRseD/uWRlET3ImEA==","shasum":"76c9ef6af9b45d9417d4cbf3f923833fb76eae0b","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@lit-labs/signals/-/signals-0.1.2.tgz","fileCount":35,"unpackedSize":90503,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lit-labs%2fsignals@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHOwgAOw3kBZeRw9neHIjBQSiDK24gEXNZpz6g78z7HpAiEA15YHyxVWxDwzZtanxU9h1vwYMgaurFlV+FOh7lxDl2k="}],"size":21142},"_npmUser":{"name":"anonymous","email":"lit-robot@google.com"},"maintainers":[{"name":"anonymous","email":"sorvell@google.com"},{"name":"anonymous","email":"aomarks@gmail.com"},{"name":"anonymous","email":"justin@fagnani.com"},{"name":"anonymous","email":"kevinpschaaf@gmail.com"},{"name":"anonymous","email":"jb@jbingham.com"},{"name":"anonymous","email":"gray@stanfordalumni.org"},{"name":"anonymous","email":"rictic@gmail.com"},{"name":"anonymous","email":"graynorton@google.com"},{"name":"anonymous","email":"lit-robot@google.com"},{"name":"anonymous","email":"brendan@usergenic.com"},{"name":"anonymous","email":"ajk830@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/signals_0.1.2_1739553901696_0.6787760133915715"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-02-14T17:25:01.897Z","publish_time":1739553901897,"_source_registry_name":"default","contributors":[]},"0.1.3":{"name":"@lit-labs/signals","version":"0.1.3","description":"JavaScript Signals proposal integration for Lit","license":"BSD-3-Clause","homepage":"https://lit.dev/","repository":{"type":"git","url":"git+https://github.com/lit/lit.git","directory":"packages/labs/signals"},"type":"module","main":"index.js","module":"index.js","typings":"index.d.ts","directories":{"test":"test"},"exports":{".":{"types":"./development/index.d.ts","development":"./development/index.js","default":"./index.js"}},"scripts":{"build":"wireit","build:ts":"wireit","build:ts:types":"wireit","test":"wireit","test:dev":"wireit","test:prod":"wireit"},"wireit":{"build":{"dependencies":["build:rollup","build:ts","build:ts:types","../../lit:build"]},"build:ts":{"command":"tsc --build --pretty","dependencies":["../../lit:build:ts:types"],"clean":"if-file-deleted","files":["src/**/*.ts","src/**/*.tsx","tsconfig.json"],"output":["development","tsconfig.tsbuildinfo"]},"build:ts:types":{"command":"treemirror development . \"**/*.d.ts{,.map}\"","dependencies":["../../internal-scripts:build","build:ts"],"files":[],"output":["*.d.ts{,.map}","lib/*.d.ts{,.map}","test/**/*.d.ts{,.map}"]},"build:rollup":{"command":"rollup -c","dependencies":["build:ts"],"files":["rollup.config.js","../../../rollup-common.js","src/test/*_test.html"],"output":["index.js{,.map}","lib/*.js{,.map}","test/*_test.html"]},"test":{"dependencies":["test:dev","test:prod"]},"test:dev":{"command":"MODE=dev node ../../tests/run-web-tests.js \"development/test/**/*_test.js\" --config ../../tests/web-test-runner.config.js","dependencies":["build:ts","../../tests:build"],"env":{"BROWSERS":{"external":true}},"files":[],"output":[]},"test:prod":{"command":"MODE=prod node ../../tests/run-web-tests.js \"development/test/**/*_test.js\" --config ../../tests/web-test-runner.config.js","dependencies":["build","../../tests:build"],"env":{"BROWSERS":{"external":true}},"files":[],"output":[]}},"author":{"name":"Google LLC"},"devDependencies":{"@lit-internal/scripts":"^1.0.1"},"publishConfig":{"access":"public"},"dependencies":{"lit":"^2.0.0 || ^3.0.0","signal-polyfill":"^0.2.0"},"_id":"@lit-labs/signals@0.1.3","gitHead":"43c6168acc4a30d70091ee30c307f692a02387d5","bugs":{"url":"https://github.com/lit/lit/issues"},"_nodeVersion":"20.19.3","_npmVersion":"10.8.2","dist":{"integrity":"sha512-P0yWgH5blwVyEwBg+WFspLzeu1i0ypJP1QB0l1Omr9qZLIPsUu0p4Fy2jshOg7oQyha5n163K3GJGeUhQQ682Q==","shasum":"f71543bff6886d6560f6775e4622d6a9a084f05d","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@lit-labs/signals/-/signals-0.1.3.tgz","fileCount":35,"unpackedSize":91141,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lit-labs%2fsignals@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAgl9ZX1wamTQcmLSz6jg20V47VQRyk+t97QBTOvq+vLAiEA3cLz3SyAd31xTgrcpDbi9lQChJTvqSwJOkqmC/tD1AQ="}],"size":21399},"_npmUser":{"name":"anonymous","email":"lit-robot@google.com"},"maintainers":[{"name":"anonymous","email":"sorvell@google.com"},{"name":"anonymous","email":"aomarks@gmail.com"},{"name":"anonymous","email":"justin@fagnani.com"},{"name":"anonymous","email":"kevinpschaaf@gmail.com"},{"name":"anonymous","email":"jb@jbingham.com"},{"name":"anonymous","email":"gray@stanfordalumni.org"},{"name":"anonymous","email":"rictic@gmail.com"},{"name":"anonymous","email":"graynorton@google.com"},{"name":"anonymous","email":"lit-robot@google.com"},{"name":"anonymous","email":"brendan@usergenic.com"},{"name":"anonymous","email":"ajk830@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/signals_0.1.3_1752205006229_0.8143134265733518"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-07-11T03:36:46.427Z","publish_time":1752205006427,"_source_registry_name":"default","contributors":[]},"0.2.0":{"name":"@lit-labs/signals","version":"0.2.0","description":"JavaScript Signals proposal integration for Lit","license":"BSD-3-Clause","homepage":"https://lit.dev/","repository":{"type":"git","url":"git+https://github.com/lit/lit.git","directory":"packages/labs/signals"},"type":"module","main":"index.js","module":"index.js","typings":"index.d.ts","directories":{"test":"test"},"exports":{".":{"types":"./development/index.d.ts","development":"./development/index.js","default":"./index.js"}},"scripts":{"build":"wireit","build:ts":"wireit","build:ts:types":"wireit","test":"wireit","test:dev":"wireit","test:prod":"wireit"},"wireit":{"build":{"dependencies":["build:rollup","build:ts","build:ts:types","../../lit:build"]},"build:ts":{"command":"tsc --build --pretty","dependencies":["../../lit:build:ts:types"],"clean":"if-file-deleted","files":["src/**/*.ts","src/**/*.tsx","tsconfig.json"],"output":["development","tsconfig.tsbuildinfo"]},"build:ts:types":{"command":"treemirror development . \"**/*.d.ts{,.map}\"","dependencies":["../../internal-scripts:build","build:ts"],"files":[],"output":["*.d.ts{,.map}","lib/*.d.ts{,.map}","test/**/*.d.ts{,.map}"]},"build:rollup":{"command":"rollup -c","dependencies":["build:ts"],"files":["rollup.config.js","../../../rollup-common.js","src/test/*_test.html"],"output":["index.js{,.map}","lib/*.js{,.map}","test/*_test.html"]},"test":{"dependencies":["test:dev","test:prod"]},"test:dev":{"command":"MODE=dev node ../../tests/run-web-tests.js \"development/test/**/*_test.js\" --config ../../tests/web-test-runner.config.js","dependencies":["build:ts","../../tests:build"],"env":{"BROWSERS":{"external":true}},"files":[],"output":[]},"test:prod":{"command":"MODE=prod node ../../tests/run-web-tests.js \"development/test/**/*_test.js\" --config ../../tests/web-test-runner.config.js","dependencies":["build","../../tests:build"],"env":{"BROWSERS":{"external":true}},"files":[],"output":[]}},"author":{"name":"Google LLC"},"devDependencies":{"@lit-internal/scripts":"^1.0.1"},"publishConfig":{"access":"public"},"dependencies":{"lit":"^2.0.0 || ^3.0.0","signal-polyfill":"^0.2.2"},"_id":"@lit-labs/signals@0.2.0","gitHead":"0fc671bc390cac3b9900fc3616347eeeecd91d5a","bugs":{"url":"https://github.com/lit/lit/issues"},"_nodeVersion":"24.5.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-68plyIbciumbwKaiilhLNyhz4Vg6/+nJwDufG2xxWA9r/fUw58jxLHCAlKs+q1CE5Lmh3cZ3ShyYKnOCebEpVA==","shasum":"3419069a0a885bf927e665723359bf21f672e67c","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@lit-labs/signals/-/signals-0.2.0.tgz","fileCount":35,"unpackedSize":101214,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lit-labs%2fsignals@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFP890+3Uu+rEQ2nBP2hEpzu21N6eaacxxPjXH/ZMgiaAiAKm3zGkuPIC2NGt28BCYzRkUJM1+Bqlh9kY46OUWhzYA=="}],"size":23766},"_npmUser":{"name":"anonymous","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:09092a74-4985-45dc-ac61-63749516569b"}},"maintainers":[{"name":"anonymous","email":"sorvell@google.com"},{"name":"anonymous","email":"aomarks@gmail.com"},{"name":"anonymous","email":"justin@fagnani.com"},{"name":"anonymous","email":"kevinpschaaf@gmail.com"},{"name":"anonymous","email":"jb@jbingham.com"},{"name":"anonymous","email":"gray@stanfordalumni.org"},{"name":"anonymous","email":"rictic@gmail.com"},{"name":"anonymous","email":"graynorton@google.com"},{"name":"anonymous","email":"lit-robot@google.com"},{"name":"anonymous","email":"brendan@usergenic.com"},{"name":"anonymous","email":"ajk830@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/signals_0.2.0_1766527407915_0.06702825252915279"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-12-23T22:03:28.061Z","publish_time":1766527408061,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.2.0"},"name":"@lit-labs/signals","time":{"created":"2024-10-07T19:16:35.112Z","modified":"2025-12-23T22:03:40.162Z","0.1.0":"2024-10-07T19:00:49.647Z","0.1.1":"2024-10-07T21:09:18.656Z","0.1.2":"2025-02-14T17:25:01.897Z","0.1.3":"2025-07-11T03:36:46.427Z","0.2.0":"2025-12-23T22:03:28.061Z"},"readme":"# @lit-labs/signals\n\nTC39 Signals Proposal integration for Lit.\n\n[![Build Status](https://github.com/lit/lit/workflows/Tests/badge.svg)](https://github.com/lit/lit/actions?query=workflow%3ATests)\n[![Published on npm](https://img.shields.io/npm/v/@lit-labs/signals.svg?logo=npm)](https://www.npmjs.com/package/@lit-labs/signals)\n[![Join our Discord](https://img.shields.io/badge/discord-join%20chat-5865F2.svg?logo=discord&logoColor=fff)](https://lit.dev/discord/)\n[![Mentioned in Awesome Lit](https://awesome.re/mentioned-badge.svg)](https://github.com/web-padawan/awesome-lit)\n\n> [!WARNING]\n>\n> This package is part of [Lit Labs](https://lit.dev/docs/libraries/labs/). It\n> is published in order to get feedback on the design and may receive breaking\n> changes or stop being supported.\n>\n> Please read our [Lit Labs documentation](https://lit.dev/docs/libraries/labs/)\n> before using this library in production.\n>\n> Give feedback: https://github.com/lit/lit/discussions/4779\n>\n> RFC: https://github.com/lit/rfcs/blob/main/rfcs/0005-standard-signals.md\n\n## Documentation\n\nFull documentation is available at\n[lit.dev/docs/data/signals/](https://lit.dev/docs/data/signals/).\n\n## Overview\n\n`@lit-labs/signals` integrates the [TC39 Signals\nProposal](https://github.com/tc39/proposal-signals) with Lit's template system\nand reactive update lifecycle. Signals used within an element's update\nlifecycle, such as in a template, will cause the element to re-render when the\nsignal value changes. Signals can also be used for targetted or \"pin-point\" DOM\nupdates, which can update the DOM without running the entire `render()` method.\n\n### The TC39 Signals Proposal\n\nThe [TC39 Signals Proposal](https://github.com/tc39/proposal-signals) is a\nproposal to add standard signals to the JavaScript language.\n\nThis is very exciting for web components, since it means that different web\ncomponents that don't use the same libraries can interoperably consume and\nproduce signals.\n\nIt also means that many existing state management systems and observability\nlibraries that might currently each require their own adapter to integrated with\nthe Lit lifecycle, might converge on using standard signals so that we only need\none Lit adapter, and eventually no adapter at all as support for signals is\ndirectly added to Lit\n\n### Why Signals?\n\nSignals have several nice attributes for use with reactive components like Lit:\n\n1. Signals are an easy way to create shared observable state - state that many\n   elements can use and update when it changes. This is great for things like a\n   game state that many components need to read.\n\n2. Signals can be individually observed, and when used in a template binding,\n   can be handled so that they only update the DOM their bound to. These\n   targetted DOM updates don't re-render the entire template.\n\n3. Standard signals are an observability interoperabiliy point that many\n   different libraries can use. Any library that produces signals will work with\n   any standard signal watcher.\n\n4. Signals can be good for performance. Signals track dependencies and changes\n   so that only signals that miht have changed and have been read are\n   re-computd. This can help perform minimal computations and DOM updates when\n   doing small updates to large signal graphs or UIs.\n\n5. Signal auto-tracking can reduce the need for component-specific lifecycle\n   APIs. For example, rather than having lifecycle callbacks for when updates\n   have happened, or when specific reactive properties have changed, any code\n   could create a reactive effect that simple accesses the signals it uses, and\n   is automatically re-run when they change.\n\n6. Signals may allow for interoperable _synchronous_ and _batched_ DOM updates.\n   There are ways to respond to signal changes synchronously but also batched,\n   so if reactive properties were backed by signals, an element could re-render\n   itself once a batch of them had been updated. Elements could take care to\n   update children inside of batches, meaning entire subtrees could be updated\n   synchrously. The batching mechanism isn't standard yet, but could be an\n   extension to the proposal.\n\nSignals are a natural fit for Lit: a LitElement render method is already\nsomewhat like a computed signal in that it is computed based on updates to\ninputs (reactive properties).\n\nThe difference between Lit renders and signals is\nthat in Lit the data flow is push-based, rather than pull-based as in signals.\nLit elements react when changes are pushed into them, whereas signals\nautomatically subscribe to the other signals they access. But these approaches\nare very compatible, and we can easily make elements subscribe to the signals\nthey access and trigger an update with an integration library like this one.\n\n### On Proposals and Polyfills\n\nLike all Lit Labs packages, `@lit-labs/signals` package may change frequently,\nhave serious bugs, or not be maintained as well as Lit's core packages.\n\nAdditionally, this package depends on the API defined in the [TC39 Signals\nproposal](https://github.com/tc39/proposal-signals) and directly depends on the\n[Signals polyfill](https://github.com/proposal-signals/signal-polyfill), which\nadd more potential sources of instability and bugs. The proposal may change, and\nthe polfyill may have bugs or serious performance issues. If multiple versions\nof the polyfill are included on a page, interoperabiilty may fail.\n\nAs the Signals proposal and polyfill progress we will update this package. At\nsome point we will remove the dependency on the polyfill and assume the standard\nsignal APIs exist, and pages will have to install the polyfill if needed.\n\nSo `@lit-labs/signals` is not recommended for production use. If you choose to\nuse it, please thouroughly test and check the performance of your components\nand/or app _at scale_, with the number of signals and component instances that\nyou expect in real-world usage.\n\nPlease file feedback and bugs with the [Lit\nproject](https://github.com/lit/lit/issues), the [Signals\nProposal](https://github.com/tc39/proposal-signals), and the [Signals\npolyfill](https://github.com/proposal-signals/signal-polyfill) a appropriate.\n\n## Usage\n\nThere are three main exports:\n\n- The `SignalWatcher` mixin\n- The `watch()` directive\n- The `html` template tag, and `withWatch()` template tag factory\n\n### SignalWatcher\n\n`SignalWatcher` is the core of signals integration. It's a mixin that makes an\nelement watch all signal accesses during the element's reactive update\nlifecycle, then triggers an element update when signals change. This includes\nsignals read in `shouldUpdate()`, `willUpdate()`, `update()`, `render()`,\n`updated()`, `firstUpdated()`, and reactive controller's `hostUpdate()` and\n`hostUpdated()`.\n\nThis effectively makes the the return result of `render()` a computed signal.\n\n```ts\nimport {LitElement, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {SignalWatcher, signal} from '@lit-labs/signals';\n\nconst count = signal(0);\n\n@customElement('signal-example')\nexport class SignalExample extends SignalWatcher(LitElement) {\n  static styles = css`\n    :host {\n      display: block;\n    }\n  `;\n\n  render() {\n    return html`\n      <p>The count is ${count.get()}</p>\n      <button @click=${this.#onClick}>Increment</button>\n    `;\n  }\n\n  #onClick() {\n    count.set(count.get() + 1);\n  }\n}\n```\n\nElements should not _write_ to signals in these lifecycle methods or they might\ncause an infinite loop.\n\n### watch() directive\n\nThe `watch()` directive accepts a single Signal and renders its value,\nsubscribing to updates and updating the DOM when the signal changes. This allows\nfor very targeted updates of the DOM, which can be good for performance (but as\nalways, measure!).\n\n```ts\nimport {LitElement, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {SignalWatcher, watch, signal} from '@lit-labs/signals';\n\nconst count = signal(0);\n\n@customElement('signal-example')\nexport class SignalExample extends SignalWatcher(LitElement) {\n  static styles = css`\n    :host {\n      display: block;\n    }\n  `;\n\n  render() {\n    return html`\n      <p>The count is ${watch(count)}</p>\n      <button @click=${this.#onClick}>Increment</button>\n    `;\n  }\n\n  #onClick() {\n    count.set(count.get() + 1);\n  }\n}\n```\n\n`watch()` updates do not trigger the Lit reactive update cycle. However, they\nare batched and run in coordination with reactive updates. When a watched\nsignal changes, if a reactive update is pending, the watched signal update\nrenders with the update; otherwise, it renders in a batch with any other\nwatched signals. Other changes, to reactive properties or signals accessed\noutside of `watch()`, trigger reactive updates as usual.\n\nYou can mix and match targeted updates with `watch()` directive and\nauto-tracking with `SignalWatcher`. When you pass a signal directly to `watch()`\nit is not accessed in a callback watched by `SignalWatcher`, so an update to\nthat signal will only cause a targeted DOM update and not an full template\nrender.\n\n> [!NOTE]\n>\n> <!-- -->\n>\n> The value passed to `watch` must be a signal. If it isn't, it can be\n> converted to one using `computed`. For example\n> `${watch(computed(() => list.get().map(item => item))}`.\n\n### this.effect\n\n`SignalWatcher` also exposes an `effect(callback)` method that allows targeted\nreactions to signal changes independent of but coordinated with the reactive\nupdate lifecycle. This provides an easy mechanism to react generally to signals\nused only with `watch` that do not trigger a reactive update. By default,\nthe `effect` is run after any DOM based updates are rendered, including\nthe element's reactive update cycle, if it is pending when the effect would\ntrigger. Adding an options argument with `beforeUpdate: true` allows effects\nto run before any DOM is updated. For example,\n`this.effect(() => console.log(this.aSignal.get())), {beforeUpdate: true});`\n\n### html tag and withWatch()\n\nThis package also exports an `html` template tag that can be used in place of\nLit's default `html` tag and automatically wraps any signals in `watch()`.\n\n```ts\nimport {LitElement} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {SignalWatcher, html, signal} from '@lit-labs/signals';\n\nconst count = signal(0);\n\n@customElement('signal-example')\nexport class SignalExample extends SignalWatcher(LitElement) {\n  static styles = css`\n    :host {\n      display: block;\n    }\n  `;\n\n  render() {\n    return html`\n      <p>The count is ${count}</p>\n      <button @click=${this.#onClick}>Increment</button>\n    `;\n  }\n\n  #onClick() {\n    count.set(count.get() + 1);\n  }\n}\n```\n\n#### `withWatch()`\n\n`withWatch()` is a function that wraps an `html` tag function with the\nauto-watching functionality. The `html` tag exported by `@lit-labs/signals` is a\nconvenient export of the core lit-html template tag wrapped with `withWatch()`.\n\n`withWatch()` allows you to compose the signal watching wrapper with other\nlit-html tag wrappers like Lit's `withStatic()` utility.\n\n```ts\nimport {html as coreHtml} from 'lit';\nimport {withStatic} from 'lit/static-html.js';\nimport {withWatch} from '@lit-labs/signals';\n\n/**\n * A Lit template tag that support static values and pinpoint signal updates.\n */\nconst html = withWatch(withStatic(coreHtml));\n```\n\n## Future Work\n\nThis library will change based on feedback from developers. Some existing dieas we have for futher development are:\n\n- A signal-aware `repeat()` directive that can update items in a list independently of the entire list.\n- Signal aware `when()` directive that wraps the condition in a computed signal and watches it.\n- A `@property()` decorator that creates a signal-backed property that can be watched.\n- An `@effect()` method decorator that runs a method inside a watched computed signal, and re-runs it when any signal dependencies change. This would be an alternative the the common `@observe()` feature request.\n- Batched synchronous updates, when using a utility like []`batchedEffect()`](https://github.com/proposal-signals/signal-utils?tab=readme-ov-file#batched-effects)\n\n## Related Libraries\n\n### signal-utils\n\nThe [`signal-utils` project](https://github.com/proposal-signals/signal-utils)\ncontains a lot of utilities for building signals-based data models.\n\nSome of these are especially useful for use cases around shared observable state. The signal-backed collections (arrays, maps, and sets) can help address cases where Lit's reactive properties cannot see internal changes to objects.","users":{}}