Repository navigation
v0.1.43
Say when the client has taken over
Nothing in aurora said it, so every caller that needed to know guessed
or polled -- in tests and in the application alike.
Read from the runtimes that solve the same problem before designing
one: @adonisjs/inertia dispatches CustomEvents (inertia:${name}),
Hotwire has turbo:load and turbo:frame-load, htmx has htmx:load per
swapped fragment. Three things they agree on, none of them obvious. It
is an event, not a promise, because a promise is consumed once while
the client becomes ready again after every navigation. Granularity
matters as much as the event -- a page-level signal alone is either too
early or too late for a page of islands. And the name states the phase,
never the intent: load, settle, navigate, never ready.
So: aurora:hydrate on each root as it is adopted, bubbling; aurora:load
once on document after the last one settles.
Two deliberate departures. The event fires even when a root throws,
with the reason in detail.error and hydrationErrors() -- a signal
withheld on failure turns a race into a silent hang, and the waiter
cannot tell the two apart. And there is a readable state beside the
event, because an event alone carries the very race it removes:
attach a listener after it fired and you wait for ever. whenHydrated()
resolves at once when the work is done, the arrangement the DOM uses
with document.readyState beside DOMContentLoaded.
Changes since v0.1.42.