{"id":14563666,"url":"https://github.com/rozek/SyncedStore-bundle","last_synced_at":"2025-09-04T06:32:58.005Z","repository":{"id":255485785,"uuid":"850987474","full_name":"rozek/SyncedStore-bundle","owner":"rozek","description":"bundles SyncedStore, yjs and several related packages into a single module that can be used in no-build environments","archived":false,"fork":false,"pushed_at":"2024-09-04T14:07:09.000Z","size":605,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-05T18:36:27.952Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rozek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2024-09-02T08:06:33.000Z","updated_at":"2024-09-04T14:07:13.000Z","dependencies_parsed_at":"2024-09-05T18:36:46.221Z","dependency_job_id":"6f6ba935-26f9-4235-ab8f-029698ab4a51","html_url":"https://github.com/rozek/SyncedStore-bundle","commit_stats":null,"previous_names":["rozek/syncedstore-bundle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2FSyncedStore-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2FSyncedStore-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2FSyncedStore-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2FSyncedStore-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rozek","download_url":"https://codeload.github.com/rozek/SyncedStore-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":217902475,"owners_count":16248435,"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-09-07T02:04:19.739Z","updated_at":"2025-09-04T06:32:57.993Z","avatar_url":"https://github.com/rozek.png","language":"TypeScript","funding_links":[],"categories":["others"],"sub_categories":[],"readme":"# SyncedStore-bundle #\n\nbundles the author's fork of [SyncedStore](https://github.com/YousefED/SyncedStore), [yjs](https://github.com/yjs/yjs) and several related packages into a single module that can be used in no-build environments\n\n\u003e Just a small note: if you like this module and plan to use it, consider \"starring\" this repository (you will find the \"Star\" button on the top right of this page), so that I know which of my repositories to take most care of.\n\n## Background ##\n\nWhen using [Yjs](https://github.com/yjs/yjs) and depending modules in a browser (or another no-build environment, typical import statements such as\n\n```\nimport * as Y                from 'yjs'\nimport { WebsocketProvider } from 'y-websocket'\nimport { YKeyValue }         from 'y-utility/y-keyvalue'\nimport { syncedStore }       from 'https://cdn.jsdelivr.net/npm/@syncedstore/core@0.6.0/+esm'\n```\n\nmay lead to a **completely unpredictable behaviour of Yjs**.\n\nA brief look into the browser console will reveal one or multiple error messages starting with `Yjs was already imported. This breaks constructor checks and will lead to issues!`\n\nAs written by [dmonad](https://github.com/dmonad): this message has to be taken seriously - **Yjs will not work as expected**!\n\nBut how does it then become possible to use Yjs within a browser without having to use a build environment (which will collect all required imports and build a large package including every import only once - together with other advantages)?\n\nOne possibility is to just bundle Yjs and all packages that depend on it into one module which may then be safely imported into a script - such an approach is by no means elegant but makes Yjs usable even within no-build environments.\n\nThis is what this repo wants to provide.\n\nIt currently bundles\n\n* Yjs\n* y-indexeddb\n* y-websocket\n* y-webrtc\n* y-keyvalue and\n* y-lwwmap\n* @syncedstore/core\n\ninto a single monolith.\n\n## Usage ##\n\nAs a consequence, import statements like those shown above will either have to be rewritten as\n\n```\nimport * as Y                from 'https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js'\nimport { WebsocketProvider } from 'https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js'\nimport { YKeyValue }         from 'https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js'\nimport { LWWMap }            from 'https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js'\nimport { syncedStore }       from 'https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js'\n```\n\nor - and that's the **recommended approach** - you will have to provide an importmap with the following contents:\n\n```\n\u003cscript type=\"importmap\"\u003e\n{\n  \"imports\": {\n    \"yjs\":                 \"https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js\",\n    \"y-indexeddb\":         \"https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js\",\n    \"y-websocket\":         \"https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js\",\n    \"y-webrtc\":            \"https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js\",\n    \"y-utility/y-keyvalue\":\"https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js\",\n    \"y-lwwmap\":            \"https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js\",\n    \"@syncedstore/core\":   \"https://rozek.github.io/SyncedStore-bundle/dist/SyncedStore-bundle.esm.js\"\n  }\n}\n\u003c/script\u003e\n```\n\nand use the same import statements as shown in the docs.\n\nThe **potential disadvantage of importmaps**, however, is that you - or your customers - will need a reasonably modern browser. Definitely supported browsers include:\n\n* Chrome ≥ 89\n* MS Edge ≥ 89\n* Safari ≥ 16.4\n* Firefox ≥ 108\n* Opera ≥ 76\n\u003cbr\u003e\u0026nbsp;\u003cbr\u003e\n* Chrome for Android ≥ 111\n* Safari on iOS ≥ 16.4\n\n(see \"[Can I use](https://caniuse.com/import-maps)\" for additional details, especially if your browser is not listed above)\n\n## Build Instructions ##\n\nYou may easily build this package yourself.\n\nJust install [NPM](https://docs.npmjs.com/) according to the instructions for your platform and follow these steps:\n\n1. either clone this repository using [git](https://git-scm.com/) or [download a ZIP archive](https://github.com/rozek/SyncedStore-bundle/archive/refs/heads/main.zip) with its contents to your disk and unpack it there \n2. open a shell and navigate to the root directory of this repository\n3. run `npm install` in order to install the complete build environment\n4. execute `npm run build` to create a new build\n\n## License ##\n\n[MIT License](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozek%2FSyncedStore-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frozek%2FSyncedStore-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozek%2FSyncedStore-bundle/lists"}