Skip to main content

Module extensions

Module extensions 

Source
Expand description

Extension contracts and captured state; the executable installs the native loader.

Structs§

Binding
An extension bound to a document: its package, the input it reads and what it last prepared from it. Clones share one state; a snapshot does not.
Config
An extension as a document’s extensions: names it: its package and what it is configured with.
Live
An address an extension’s process answers — under its live/, or a page under its pages/ — and what answers it.
Process
A package’s process: the long-running program devpage starts for it, and passes the requests under the extension’s live/ address to.

Constants§

LIVE
The system extension that is the live session: its name under a document’s extensions:, and in its address.

Traits§

Loader
What loads an extension’s package from its bundle; the executable installs the native one.
Package
An extension’s package, loaded: what devpage asks, in JSON, to read its input and show its files.

Functions§

bound
Whether key, a Live::key, still names a bound extension: one whose document was not loaded again with another configuration.
changed
Whether an extension in scope prepared anew after files changed: each whose input holds one of them, or lies in one, prepares again. A failed preparation counts as a change.
configure
Binds the extensions configs to the document at doc, each package loaded from its bundle under base, and prepares each; with them the live session, where it is on in scope, unless the document’s live says enabled: false in its config or names a package of its own. Nothing to bind unbinds the document. A configuration already bound in scope is kept as it is.
for_document
The extensions bound to the document at doc — none when it has none.
for_file
The extensions of the document that owns file in folder — the entry document’s when none does.
imported_module
Resolves a package-relative import the same way when collecting the module sources and when compiling them to browser addresses.
input_roots
The input of every extension bound in scope, for the watcher to watch.
install_loader
Installs loader as the one every package is loaded with; a second call is ignored.
live
What answers path when it is under an extension’s live/ address in scope: the bound extension and its process. None when it is no such address.
page
The page of an extension path names in scope, pages/<page> under the extension’s address: what answers it, asked for pages/<page>; the page, as its extension names it; and the file of the document it is drawn in — entry when that document binds the extension, else the first that does. None when path is no extension’s page.
route
The reply to path when it is an extension’s address in scope: a browser file the package ships, or else what the package routes it to. None when it is no extension’s.
serve_entry
The shared session reads its project configuration from the entry document.
serve_live
Enables the shared live-session package for this served project.
serve_packages
Enables globally configured packages during loopback serving. Paths are relative to the global configuration file’s folder.