Skip to content
ERPForAll DocsDevelopment

    Declared UI assets

    UI3 base compiles inherited templates on the server during addon installation or upgrade. The web addon owns publication. A failed declaration, inheritance operation or compile aborts that transaction and preserves the previously committed bundle. Requests fetch admitted bytes; they never repair or rebuild an addon.

    Ship static/dist/manifest.json with every client-bearing addon. An absent manifest explicitly means no declared client assets. Unknown fields are errors. Every listed file must exist inside the addon; absolute paths, traversal, encoding tricks, symlinks and unsupported media fail admission. The current host runtime ABI is elang-1; a package must declare that exact ABI.

    {
    "schema": 1,
    "runtime_abi": "elang-1",
    "entry": "@example/client",
    "modules": [
    {"path": "static/dist/client.js", "specifier": "@example/client"}
    ],
    "templates": ["static/src/templates/example.xml"],
    "static_files": ["static/description/icon.svg"]
    }

    entry is optional; if present it names a declared module exporting register(ctx). Modules arrive prebuilt as UTF-8 ES modules. The developer/CI build owns JavaScript syntax, module imports and the register-export contract. Assembly preserves their supplied legal comments. Production rejects source-map directives. Declaring XML requires a dist module for @erpforall/elang/abi in the same complete addon set; a monolithic client bundle is not that bare-module declaration. Compiled-template names retain their accepted colon syntax in the import map; all targets remain declared local content hashes. See template inheritance for primary roots, anchors and diagnostics.

    Inputs follow dependency/load order, then declared file and document order. A primary child sees all parent extensions, including later addons. Keys include length-prefixed compiler identity, runtime ABI, canonical limits, mode, ordered source identities, language and group. This slice supports group main; other groups fail with an error saying lazy groups are not available yet. Language is part of identity; the host still uses source compilation. The explicit pure localized compiler API is documented in client templates; wiring it into publication is planned and must include catalogue content in the bundle key. No language-serving parity is implied.

    The native CLI registers the same asset admission and durable registry signal for generic module operations as for the server and package operations. Hosts register trusted erp_modules::LifecycleHook services with ModuleSystemBuilder::lifecycle_hook. Package/WASM admission runs first; services run afterward in registration order for initialization, install, upgrade, uninstall and reinitialization. LifecycleChange exposes the final active AddonEntry set in load order. All durable effects stay in the supplied transaction. A custom host using startup admission must configure the durable Signal on every module writer; native server, package and generic CLI composition do so. A callback failure rolls back the whole operation. Ordinary loads use separate startup compatibility admission.

    The CLI connects that seam to erp_cli::ui_assets::AssetLifecycle. Source collection and compiler/ compression work run on a blocking worker; the transaction stays in the async operation. Archive assets come from the separately retained, integrity-verified client-file map, never from an unverified filesystem or the data loader’s file map.

    Keep the LoadOutcome or OperationOutcome when composing another host service. Both expose admitted_addons(): the final effective addon entries in the same dependency/load order used by the registry. A forced-update load retains its committed operation’s entries. For filesystem addons, AddonEntry::admitted_files() borrows the exact immutable byte map captured during source admission. Package client bytes stay in the separate verified PackageData::client_files map. Neither accessor reopens a live source path.

    The CLI passes those retained entries directly from Node::load to startup asset admission. The host also passes an explicit durable Generations baseline read before the entire load, including source capture. After taking the module and asset locks, startup compares the current registry generation before assembling or publishing. A concurrent install, upgrade or uninstall returns a Concurrency error requiring a fresh load; startup cannot replace the newer committed addon bundle with its retained old snapshot. Native lifecycle writers use the shared signal so that their registry-generation bump commits atomically with their addon and asset changes. The asset collector uses an admitted snapshot whenever present, including when the live files have changed since admission. Host callbacks must not rediscover entries or replace captured bytes with a later directory read. A fresh load or lifecycle operation establishes its own source snapshot; the appropriate source and lifecycle checks apply there.

    These source accessors do not grant request access, enroll identity or change ordinary load’s existing durable-receipt policy. Upgrade/uninstall still use ADR 0097’s installed identity checks. An operator’s explicit forward candidate supplies verified previous receipts through ModuleSystemBuilder::identity_previous; failed migration or asset assembly preserves those receipts alongside the previous bundle. See installed addon identity administration.

    erp_addon_web::assets::assembly is the pure assembly API. Its validated result supplies blobs, imports, preload URLs, registration order and exact static-file mappings. Its register_module() exports an ordered registrations array of { id, register } entries retaining the original functions, for the existing runtime registerAddons consumer to supply per-addon contexts and validate synchronous return values. Assembly does not invoke addon JavaScript on the server. Durable manifests store metadata and content references; bytea blob rows hold identity, gzip and Brotli representations. The server’s PublishedAssets is a verified snapshot selected from one database, independent of the disposable node content cache. Sharing cached bytes never grants another database a route.

    AssembledBundle::register_module() supplies an external ES module exporting an ordered registrations array of { id, register } entries. Each callback is the original imported addon function. A host consumer passes that array to Elang’s existing registerAddons(registrations, { registry }) API; it supplies each addon’s context and patch ownership and refuses Promise or non-void/non-null returns. There is no asynchronous bundle wrapper and importing the module has no registration side effects. preloads() includes the registration module URL and declared module URLs. These getters are host integration APIs; activating addon entries in the current HumanApp is a separate client integration.

    Publication checks the compatible grace history inside the same transaction before success. Combined retained metadata is limited to 16 MiB and 40,001 content references, with at most 256 generations. Repeated artifact representations across generations are charged against a 384 MiB admission budget. Their combined serving URLs must fit the server’s 40,001-URL / 128 MiB raw-byte protocol limits. A new bundle that exceeds these bounds refuses the transaction, preserving the prior committed bundle; history is not silently shortened. These are safety/admission limits, not measured performance results. Storage readers guard payload sizes before transferring them and verify exact manifest identity, media declarations and content references.

    UI3 base owns transactional compilation/publication, primary roots/anchors, content identity, precompressed forms, exact declarations, nonce/CSP and runtime admission. Lazy groups, locator lint, anchor compatibility diffs and erp dev are planned. Translation integration is planned; product timings remain deferred to milestone end under ADR 0065. Optimized compressed-response transport is planned. Product performance evidence is DEFERRED_PERFORMANCE under ADR 0065; no size, latency or throughput result is claimed here.