Out-of-order streaming

Jeasx streams markup in order, so a slow component holds back everything after it (see Streaming HTML). Here, the results show up in the order they finish and still appear in their place on the page.

This works without client-side JavaScript, thanks to Declarative Shadow DOM: the container is sent first, with a <slot> for each source and a loading indicator inside it. An async generator then streams each result as soon as it's ready, marked with slot="…", and the browser moves it into the matching slot.

Reload with new delays

#1Weather service

Result from weather service (took 316 ms)

arrived after 316 ms
#2Stock exchange

Result from stock exchange (took 896 ms)

arrived after 897 ms
#3News feed

Result from news feed (took 1117 ms)

arrived after 1118 ms
All done after 1118 ms