API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classAssetManifest

@codexo/exojs / assets / stable

The packs a deployment holds, addressed by logical name. A pack file is named after the hash of its own bytes, so its URL changes exactly when its contents do and it can be cached forever. The manifest is the one URL that has to be re-read: it says which file currently holds each logical pack, and describes each one - byte length, block count, the sources it carries - well enough to decide what to load before loading anything. Reading a pack through a manifest is what makes a re-packed asset set cheap for a returning client. Blocks are stored by hash, so the blocks that did not change are re-used from a `ContainerBlockStore` and only the changed ones are fetched.

2
props
5
methods
0
events
Import
import { AssetManifest } from '@codexo/exojs'

The packs a deployment holds, addressed by logical name.

A pack file is named after the hash of its own bytes, so its URL changes exactly when its contents do and it can be cached forever. The manifest is the one URL that has to be re-read: it says which file currently holds each logical pack, and describes each one - byte length, block count, the sources it carries - well enough to decide what to load before loading anything.

Reading a pack through a manifest is what makes a re-packed asset set cheap for a returning client. Blocks are stored by hash, so the blocks that did not change are re-used from a `ContainerBlockStore` and only the changed ones are fetched.

Methods5
has(name: string): boolean
Whether the manifest carries a pack under this name.
The pack under name. Throws when the manifest does not carry one, naming the packs it does: a name that is not there is a mistake in the call, not something a caller can recover from at runtime.
packFor(source: string): ManifestPackOne pack a manifest carries. | undefined
The pack carrying source, or undefined when no pack does. source is the logical path the entry was packed under - the same string a network load would use. This answers from the manifest alone, so nothing is fetched to find out where an asset lives.
open(url: string, options: AssetManifestOptionsHow a manifest is fetched.): Promise<AssetManifest>
Fetch and validate the manifest at url. Prefer loader.loadManifest, which resolves url against the loader's base path and carries the application's request options. This is the same thing for a caller that has neither. Throws an AssetNetworkError when the manifest cannot be fetched, and an AssetDecodeError when it is not JSON, states a version this build does not read, or describes a pack it cannot address.
parse(document: unknown, url: string): AssetManifest
Validate a manifest document that arrived some other way - inlined by a bundler, or read from a store - as if it had been fetched from url. url is what pack files are addressed against, so it has to be the URL the manifest is deployed at even when nothing fetched it.
Properties2
url: string
The URL this manifest was read from; every pack file is addressed relative to it.
Every pack the manifest carries, in the order it lists them.
Source