The whole idea in 30 seconds
Mark an element, write a class that receives it, start a dispatcher. This greeting is a real component loaded right now:
<div data-component="Greeting"></div>
// components/Greeting.ts
export default class Greeting {
constructor(element: HTMLElement, dispatcher: ComponentDispatcher) {
element.textContent = 'Hello!';
}
}
// main.ts
import { ComponentDispatcher } from 'html-scoped-component-importer';
const dispatcher = new ComponentDispatcher();
await dispatcher.importAsyncComponents();
dispatcher.observeDomChanges();
Explore
Each page focuses on one feature, with live examples and the code behind them.
β‘Loading componentsAsync chunks, sync registries, options, DOM observation, error overlay.
π¬Event busComponents talk by name, and a visible queue keeps events for late listeners.
πShared stateOne object, many subscribers, immutable updates.
πLoggerColourful scoped logs in development, silent in production.
πTechnical referenceSignatures, lifecycle, ordering, queue and error semantics.