delaneyj / datastar

MIT License
306 stars 8 forks source link

presense system #71

Closed gedw99 closed 2 weeks ago

gedw99 commented 4 weeks ago

I am using https://github.com/yomorun/presencejs which is a golang and typescript system to help with tracking users presence and hence knows where to send the updates in terms of reactive Apps.

I hope that this could one day be part of datastar, as I found it very useful.

As far as I know data start does not have anything like this.

delaneyj commented 3 weeks ago

Looks like its deprecated and now is https://github.com/pilarjs/pilarjs. Not sure how this is related to datastar. I think with DS the is not needed.

Superpat commented 3 weeks ago

@gedw99 maybe I dont understand what pillarjs does, but it's basically a platform to use webtransports to support subscriptions between web components and a backend ?

@delaneyj is aiming to moving the sse stuff to webtransports once safari support gets good enough. As for subscriptions with web components that's already taken care by the reactive signals.

gedw99 commented 3 weeks ago

thanks all for the explanation.

this all sort of relates the the very new JSON sync system actually that went in yesterday.

basically once you have a nice sync system, the next logical thing is that sometimes your users have many devices, and then maybe on line or offline.

so presence is really about the user case of "if they are online sync to all their devices and tabs, but if they are offline, and its something they really want to know about send a notification ".

this is not normally a thing in web frameworks, because not many systems are real time push like datastar.

I am not suggesting that datastar supports other push transport, ad we all know there are decent golang packages that do all that, but Mayne there is some merit to eventually track if the user is online or offline, and maybe the last device that user was on, etc. Then devs can do some interesting real time and non real time notification scenarios.

If I took datasar and wrapped it into a Webview, and let a user install it, then you have the classic use case of wanting to send a notification that opens up the app, and then opens the right Deep link.

This is all possible today with gio-plugins which is an all golang web view for Mobile and desktop.

delaneyj commented 2 weeks ago

This seems out of scope for what Datastar provides. It's "just" a way to make reactive front-ends decoratively. These seem like app level data structure specific to an use case. If you want to supply as an Attribute plugin or action pleas reopen.

gedw99 commented 2 weeks ago

Ok I will ponder this requirement and build up a POC

delaneyj commented 2 weeks ago

https://github.com/delaneyj/datastar/tree/todo-example is a branch that has the homepage using NATS to drive a todomvc clone and a single get via kv watchers

gedw99 commented 2 weeks ago

Thanks.

this is going to really help me learn the system .