automerge / automerge-repo

MIT License
471 stars 51 forks source link

Browser / vanilla javascript example? #76

Open pwFoo opened 1 year ago

pwFoo commented 1 year ago

Is there a vanilla JS browser example available? Searching for a way to build a multi user collaborative javascript app. Local first and syncing with other clients... Listening for other clients changes like todo list, chat or similar apps.

pvh commented 1 year ago

In the early days of automerge-repo, I wrote it in vanilla JS and had just such an example. As time went on, I found that maintaining vanilla JS was painful, and there were painful tradeoffs between supporting native ESM modules with WASM packaging versus integrating with systems like Vite and WebPack.

You should still be able to run Automerge-Repo without React or anything, but I don't have any surviving example code showing how to do it. That said, if you pull together a sample I'm happy to review it and keep it around for other folks.

pwFoo commented 1 year ago

I just worked with simple JS files and haven't played with svelte or wasm... Maybe a small starting point how to load setup automerge to use in browser?