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
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
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
bootstrapArcaneTheme | function | function bootstrapArcaneTheme(options={}) | options={} |
disposeArcaneThemeBootstrap | function | function disposeArcaneThemeBootstrap() | — |
arcaneThemeReady | variable · value | variable arcaneThemeReady | — |
default | default · value | variable default | — |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
bootstrapArcaneTheme | exported-function | function 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
import arcaneThemeReady,{bootstrapArcaneTheme} from '/arcane/modules/ThemeBootstrap.js';
console.log((await arcaneThemeReady).state);
console.log((await bootstrapArcaneTheme()).state);