pkamenarsky / replica

A remote virtual DOM library for Haskell
BSD 3-Clause "New" or "Revised" License
139 stars 14 forks source link

replica-disconnected css class #21

Open 21it opened 4 years ago

21it commented 4 years ago

Maybe it make sense to apply replica-disconnected css class to root component in case of server disconnect? Similar to this https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#module-loading-state-and-errors Then at least client will be notified about disconnect (we can have some fancy semi-transparent blurry overlay with spinner or something like this). At the moment page just freezes and nothing happens and there is no any user-friendly indication what something is going wrong (at least in concur-replica examples).

Probably another issue, but it's nice to try automatically reconnect as well (without page reload).

pkamenarsky commented 4 years ago

Yep, there's a fork of Replica which implements client reconnection, iirc. The general idea is to hold a client's state for some time and resume the session if a client reconnects during that interval.

I haven't gotten around to merging the fork yet, but maybe you'll find it helpful.