Capability first · transport second

ThemeBootstrap.js

Performs import-time Arcane theme loading and subscribes to native appearance changes.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Performs import-time Arcane theme loading and subscribes to native appearance changes.

  • Artifact
    ThemeBootstrap.js · esm
  • Classification
    public first party
  • Availability
    Browser/native hybrid
  • Normalization
    Theme state normalized; storage/native errors mixed.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/ThemeBootstrap.js';

Import immediately starts one shared load/apply promise, publishes globalThis.arcaneThemeReady, and installs one shared appearance.changed subscription when Arcane.events exists. Initial failures are warned and converted to an error-bearing result.

Application-facing behavior: bootstrapArcaneTheme(), disposeArcaneThemeBootstrap(), arcaneThemeReady, and default ready promise.

Protocol and host implementation

ThemeManager + host Arcane.events projected once through the per-realm globalThis.arcaneEvents authority This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
bootstrapArcaneThemefunctionfunction bootstrapArcaneTheme(options={})options={}
disposeArcaneThemeBootstrapfunctionfunction disposeArcaneThemeBootstrap()
arcaneThemeReadyvariable · valuevariable arcaneThemeReady
defaultdefault · valuevariable default
CallableKindExact public signatureParameter syntax
bootstrapArcaneThemeexported-functionfunction bootstrapArcaneTheme(options={})options={}

Parameter meanings and results

bootstrapArcaneTheme(options={}) returns Promise<{manager,state}|{manager:null,state:null,error}>. Empty options reuse the shared promise/listener. arcaneThemeReady and the default export are that promise.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

  • Consumes Core appearance.changed; resulting ThemeManager work may emit global arcane-theme-change.

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • Initial load errors are contained in the resolved error object.
  • An appearance-change callback reload rejection is not wrapped by bootstrap.

Availability and capabilities

Browser/native hybrid. Theme state normalized; storage/native errors mixed.

Theme load may use preferences.read and appearance.read; persistence/application may require preferences.write and appearance.write. Arcane.events subscription grants no capability.

Contract example

JavaScript
import arcaneThemeReady,{bootstrapArcaneTheme} from '/arcane/modules/ThemeBootstrap.js';

console.log((await arcaneThemeReady).state);
console.log((await bootstrapArcaneTheme()).state);