{"id":20178191,"url":"https://github.com/mattkrick/relay-linear-publish-queue","last_synced_at":"2025-04-10T04:33:18.867Z","repository":{"id":35010846,"uuid":"196277703","full_name":"mattkrick/relay-linear-publish-queue","owner":"mattkrick","description":"Publish changes in the order they're received.","archived":false,"fork":false,"pushed_at":"2022-02-12T09:25:24.000Z","size":226,"stargazers_count":4,"open_issues_count":7,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T05:43:57.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattkrick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-10T21:32:54.000Z","updated_at":"2021-02-26T08:09:11.000Z","dependencies_parsed_at":"2022-08-08T03:16:24.989Z","dependency_job_id":null,"html_url":"https://github.com/mattkrick/relay-linear-publish-queue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattkrick%2Frelay-linear-publish-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattkrick%2Frelay-linear-publish-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattkrick%2Frelay-linear-publish-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattkrick%2Frelay-linear-publish-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattkrick","download_url":"https://codeload.github.com/mattkrick/relay-linear-publish-queue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248157550,"owners_count":21057034,"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-14T02:19:43.860Z","updated_at":"2025-04-10T04:33:18.845Z","avatar_url":"https://github.com/mattkrick.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# relay-linear-publish-queue\n\nPublish changes in the order they're received\n\n## Installation\n\n`yarn add relay-linear-publish-queue`\n\n## Why\n\n- By default, Relay publishes changes in an arbitrary order, making local and optimistic updates unpredictable based on latency.\n- By default, Relay double normalizes every optimistic update \u0026 reconstructs the state tree more often than necessary\n- For more info, read the blog post: [https://dev.to/mattkrick/distributed-state-101-why-i-forked-facebook-s-relay-1p7d](https://dev.to/mattkrick/distributed-state-101-why-i-forked-facebook-s-relay-1p7d)\n\n## High level architecture\n\n- Updates (local, optimistic, or server) get put into a queue\n- Updates get processed in that order\n- When a server update returns, it's provided the same state as it's optimistic counterpart. This is standard for distributed systems. Otherwise, state is a function of latency, which causes divergence. \n\n## Usage\n```js\nimport defaultGetDataID from 'relay-runtime/lib/defaultGetDataID'\nimport LinearPublishQueue from 'relay-linear-publish-queue'\nconst publishQueue = new LinearPublishQueue(store, handlerProvider, defaultGetDataID)\nnew Environment({store, handlerProvider, network, publishQueue})\n```\n\nAlso requires installing my fork. See package.json for the hash\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattkrick%2Frelay-linear-publish-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattkrick%2Frelay-linear-publish-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattkrick%2Frelay-linear-publish-queue/lists"}