The canonical API

Aegis exports a lot (about 160 names, most of them small helpers). The API has three tiers:

  • Core, ten names, enough for most pages: signal, computed, effect, batch, html, island, mount, resource, wireForm, swap.
  • Extended: everything else — helpers for specific jobs (router, forms, cache, motion, accessibility). Same file, same guarantees; a bundler or build.mjs leaves out what you do not import.
  • Removed in 0.8: the old aliases clsMap, store, cachedResource, offlineResource and component are gone; cls(el, { … }), reactive(obj, { shallow: true }), resource(url, { cache: true }), resource(url, { offline: true }) and mount() are the names. Nothing in the file is marked @deprecated.
Job Use Not
Component on a server page island(name, Component, { types }) register() (low-level; keep for { load })
Component anywhere else mount(el, Component) —
Custom element element(tag, Component, { props }) defineElement() (low-level definition object; keep for reflection and formAssociated)
State signal, computed, effect, reactive —
Template html``, when, list, show text/attr/cls/style (for adopting existing DOM)
Data resource(url, { cache, offline, params, loader }), mutation, api, invalidate('/api/users*') / invalidate(['users']) —
Forms wireForm(formEl) for server forms, form(defaults) for virtual ones —
Server HTML swap, adopt, boost innerHTML with data
Router router({ '/users/:id': { loader, component: Page } }, { outlet, hash }) — props = params + { data, query } handler + manual mount()

Component is one contract everywhere: ({ props, html, signal, on, … }) => Node | api | void.

Edit this page on GitHub