Skip to content
docsv0.9.0

ClientRuntime

The client-side files this package ships, by name — where they live on disk and where a host serves them by default. Two runtimes and one vendored library, on purpose (ADR#9/#10, greenhouse decisions/0083): the LOCAL runtime (`milpa-live.js`, frozen: activates what the server declared, never touches the network), the REMOTE runtime (`milpa-live-remote.js`: takes declared actions to the LiveEndpoint and applies the answer), and Alpine.js (vendored, MIT — see resources/vendor/README.md). A host that mounts the live routes serves these three files; it never inlines or rewrites them.

ClientRuntime::path()

public static function path(string $name): ?string

The absolute path of a shipped file, or null when `$name` is not one of the three.

Parameters

Parameters of path()
NameTypeDescription
$namestring

ClientRuntime::defaultUrls()

public static function defaultUrls(): array

The URLs a host serves the files at by default — the local runtime keeps the `/milpa-live.js` URL the Alpine adapter already promised.

Returns

name => URL

ClientRuntime::contentType()

public static function contentType(): string

The MIME type a host should serve the files with.