reactpy icon indicating copy to clipboard operation
reactpy copied to clipboard

Component `fallback` and `disconnect` VDOM

Open Archmonger opened this issue 3 years ago • 1 comments
trafficstars

Current Situation

There currently is no convenient way of reacting to WS disconnection within components without doing so in the JavaScript websocket.onclose event.

Proposed Changes

Allow all components to have a

  • fallback=...
    • Pre-generated HTML when the initial render (client's first WS connection) couldn't occur
    • Probably only feasible to exist on a top level component
      • ex. @component(fallback=...)
    • Probably will be reliant on template tags
      • Maybe this fallback HTML is serialized as a string?
  • disconnect=...
    • Pre-generated HTML displayed in the event of a websocket disconnect

Implementation Details

See here for more details.

Archmonger avatar Dec 12 '21 22:12 Archmonger

I've expanded the concept of this one to fallback and disconnect as separate entities for flexibility.

Archmonger avatar Mar 28 '22 19:03 Archmonger

Closing this in favor of #653

Archmonger avatar Feb 23 '24 09:02 Archmonger