{"id":21933543,"url":"https://github.com/chee/solid-automerge","last_synced_at":"2025-11-03T19:08:02.204Z","repository":{"id":251957068,"uuid":"838961025","full_name":"chee/solid-automerge","owner":"chee","description":"fine-grained reactivity that's consistent across space and time.","archived":false,"fork":false,"pushed_at":"2025-08-01T11:09:01.000Z","size":597,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-27T02:51:09.743Z","etag":null,"topics":["automerge","automerge-repo","hooks","primitives","reactivity","signals","solid","solid-js","solidjs"],"latest_commit_sha":null,"homepage":"https://chee.github.io/solid-automerge/","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/chee.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-06T17:23:10.000Z","updated_at":"2025-08-01T11:09:05.000Z","dependencies_parsed_at":"2024-08-06T20:52:25.084Z","dependency_job_id":"be3c490c-1907-4ced-bb81-4c24467281ba","html_url":"https://github.com/chee/solid-automerge","commit_stats":null,"previous_names":["chee/automerge-repo-solid-primitives","chee/solid-automerge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chee/solid-automerge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chee%2Fsolid-automerge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chee%2Fsolid-automerge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chee%2Fsolid-automerge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chee%2Fsolid-automerge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chee","download_url":"https://codeload.github.com/chee/solid-automerge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chee%2Fsolid-automerge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001975,"owners_count":26083244,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["automerge","automerge-repo","hooks","primitives","reactivity","signals","solid","solid-js","solidjs"],"created_at":"2024-11-29T00:12:27.822Z","updated_at":"2025-10-09T19:30:45.215Z","avatar_url":"https://github.com/chee.png","language":"TypeScript","readme":"\u003e [!important]\n\u003e omg\n\n\u003e [!caution]\n\u003e This is now situated warm and cozy as part of the Automerge Repo monorepo:\n\u003e\n\u003e [@automerge/automerge-repo-solid-primitives](https://github.com/automerge/automerge-repo/tree/main/packages/automerge-repo-solid-primitives)\n\n\u003e [!tip]\n\u003e You can `pnpm add solid-automerge@npm:@automerge/automerge-repo-solid-primitives` and\n\u003e carry on like nothing happened.\n\n\u003e [!important]\n\u003e 🎉 omg 🎉\n\n# Solid Automerge\n\n\u003ca href=\"https://www.solidjs.com/\"\u003e \u003cimg alt=\"\" src=.assets/solid.png width=22\nheight=22\u003e Solid \u003c/a\u003e primitives for \u003ca\nhref=\"https://automerge.org/docs/repositories/\"\u003e \u003cimg alt=\"\"\nsrc=.assets/automerge.png width=22 height=22\u003eAutomerge\u003c/a\u003e .\n\n```sh\npnpm add solid-js @automerge/automerge-repo solid-automerge\n```\n\n## useDocument ✨\n\nGet a fine-grained live view of an automerge document from its URL.\n\nWhen the handle receives changes, it converts the incoming automerge patch ops\nto precise solid store updates, giving you fine-grained reactivity that's\nconsistent across space and time.\n\nReturns `[doc, handle]`.\n\n```ts\nuseDocument\u003cT\u003e(\n    () =\u003e AutomergeURL,\n    options?: {repo: Repo}\n): [Doc\u003cT\u003e, DocHandle\u003cT\u003e]\n```\n\n```tsx\n// example\nconst [url, setURL] = createSignal\u003cAutomergeUrl\u003e(props.url)\nconst [doc, handle] = useDocument(url, {repo})\n\nconst inc = () =\u003e handle()?.change(d =\u003e d.count++)\nreturn \u003cbutton onclick={inc}\u003e{doc()?.count}\u003c/button\u003e\n```\n\nThe `{repo}` option can be left out if you are using [RepoContext](#repocontext).\n\n## createDocumentProjection\n\nGet a fine-grained live view from a signal automerge `DocHandle`.\n\nUnderlying primitive for [`useDocument`](#usedocument-).\n\nWorks with [`useHandle`](#usehandle).\n\n```ts\ncreateDocumentProjection\u003cT\u003e(() =\u003e AutomergeUrl): Doc\u003cT\u003e\n```\n\n```tsx\n// example\nconst handle = repo.find(url)\nconst doc = makeDocumentProjection\u003c{items: {title: string}[]}\u003e(handle)\n\n// subscribes fine-grained to doc.items[1].title\nreturn \u003ch1\u003e{doc.items[1].title}\u003c/h1\u003e\n```\n\n## makeDocumentProjection\n\nJust like `createDocumentProjection`, but without a reactive input.\n\nUnderlying primitive for [`createDocumentProjection`](#createDocumentProjection).\n\n```ts\nmakeDocumentProjection\u003cT\u003e(handle: Handle\u003cT\u003e): Doc\u003cT\u003e\n```\n\n```tsx\n// example\nconst handle = repo.find(url)\nconst doc = makeDocumentProjection\u003c{items: {title: string}[]}\u003e(handle)\n\n// subscribes fine-grained to doc.items[1].title\nreturn \u003ch1\u003e{doc.items[1].title}\u003c/h1\u003e\n```\n\n## useDocHandle\n\nGet a [DocHandle](https://automerge.org/docs/repositories/dochandles/) from the\nrepo as a\n[resource](https://docs.solidjs.com/reference/basic-reactivity/create-resource).\n\nPerfect for handing to `createDocumentProjection`.\n\n```ts\nuseDocHandle\u003cT\u003e(\n    () =\u003e AnyDocumentId,\n    options?: {repo: Repo}\n): Resource\u003cHandle\u003cT\u003e\u003e\n```\n\n```tsx\nconst handle = useDocHandle(id, {repo})\n// or\nconst handle = useDocHandle(id)\n```\n\nThe `repo` option can be left out if you are using [RepoContext](#repocontext).\n\n## context\n\nIf you prefer the context pattern for some reason, you can pass the repo higher\nup in your app with `RepoContext`\n\n### `RepoContext`\n\nA convenience context for Automerge-Repo Solid apps. Optional: if you prefer you\ncan pass a repo as an option to `useDocHandle` and `useDocument`.\n\n```tsx\n\u003cRepoContext.Provider repo={Repo}\u003e\n\t\u003cApp /\u003e\n\u003c/RepoContext.Provider\u003e\n```\n\n### `useRepo`\n\nGet the repo from the [context](#repocontext).\n\n```ts\nuseRepo(): Repo\n```\n\n#### e.g.\n\n```ts\nconst repo = useRepo()\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchee%2Fsolid-automerge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchee%2Fsolid-automerge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchee%2Fsolid-automerge/lists"}