logoalt Hacker News

santa_boy01/17/20252 repliesview on HN

I am just looking at this but quick question. Is there an example for building a local-first app? Also, I working with plain vanilla HTML & JS and Alpine. Can this be used in my apps?


Replies

paulgb01/17/2025

Y-sweet (which this is built with) allows you to make a Yjs app local-first by passing “offlineSupport” to the provider when constructing.

There’s a demo of this here: https://demos.y-sweet.dev/color-grid

The source for that demo is here: https://github.com/jamsocket/y-sweet/blob/5fa6941cf5568f4a3f...

That demo uses react, but there is a vanilla js version of the same demo here: https://github.com/jamsocket/y-sweet/tree/main/examples/vani...

(The vanilla js version is not local first, but it would just be a matter of passing the same offlineSupport flag to make it so.)

show 2 replies