SSR / API

foldkit-ssr/loader

foldkit-ssr/loader: a served page's entry script when the runtime's chunk should not run at load. It imports only modules that import nothing, so the page loads it without effect, Foldkit or the application.

It follows the plan's start, which the server writes into the envelope: 'now' runs the chunk at once; 'idle' fetches it at once and runs it when the page is idle after load and the chunk has arrived; 'on-interaction' fetches it at once and runs it on the first intent, a pointer over or down, focus or a key on an element the server marked (a binding or a kept field), or a scroll. Until SSR.hydrate in the chunk takes over, it holds each event a marker names, a form's submission prevented, and hands them over to be answered from the markers once. A held event the runtime has not taken UNTIL_LIMIT_MS after it happened is released: a submission goes to the browser (requestSubmit), anything else is dropped. A chunk that fails to load releases everything at once, and the loader holds nothing after.

Functions

loadStarts the page's runtime as its plan says, holding what it must answer until it runs.

Interfaces