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. Reload for new random delays.

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.

Weather service

Result from weather service (took 362 ms)

Arrived as #1 after 363 ms
Stock exchange

Result from stock exchange (took 1519 ms)

Arrived as #2 after 1520 ms
News feed

Result from news feed (took 1660 ms)

Arrived as #3 after 1660 ms

All done after 1660 ms.