Summary
The async-component API (@async/@error directives + :component="() => import('./X.stx')" lazy loading) is processed at build/SSR time, but its client-side resolver is not in the emitted runtime and there is no SPA-router integration — so on a live client the loading placeholder is never swapped for the real component, and async components are never re-resolved across SPA navigation.
What exists
packages/stx/src/async-components.ts (with tests under packages/stx/test/async-components/):
@async(...) … @error … @endasyncdirective with loading / error / retry-backoff states:component="() => import('./HeavyChart.stx')"lazy loadingprocessAsyncDirectivesis called at build/SSR (packages/stx/src/process.ts:1363), emitting<div class="stx-async-loading" data-async-loading="…">…</div>placeholders.
What's missing (verified)
The emitted signals runtime does not contain the client loader or a placeholder resolver:
const rt = generateSignalsRuntime() rt.includes('loadComponent') // false rt.includes('data-async-loading') // false (no handler for the emitted placeholder)packages/router/src/client.tshas zero references to async-components /data-async-loading. So the SPA_handleStxLoadpath never resolves async placeholders.
Impact
@async / :component look supported (directive + passing unit tests), but in a served app the loading placeholder is never resolved on the client, and across SPA navigation async components don't re-resolve. Net effect: a silent "stuck on loading" / missing component — with the appearance of a supported feature.
Suggested fix
- Ship the async client loader in the emitted runtime (or inject it per-page when a page actually uses async components).
- Add a
data-async-loadingresolve pass to_handleStxLoadso async components hydrate on both initial load and SPA navigation. - Until then, consider documenting async components as experimental / SSR-only so apps don't build on client resolution.
Note on confidence
Confirmed via generateSignalsRuntime() string content + a grep of router/client.ts. The existing tests pass but exercise the module outside the served-runtime path, so they don't catch the missing client/SPA wiring.