Installation

Every release is served from https://aegisjs.com/<version>/ and never changes; the import map carries the integrity hash, so the browser refuses a file that does not match:

<script type="importmap">
{
  "imports": { "aegis": "https://aegisjs.com/0.7.0/aegis.min.js" },
  "integrity": { "https://aegisjs.com/0.7.0/aegis.min.js": "sha384-IlZI8EunTsg50qmYrO6AIH/tIHqkkD1bZZIIln8MQrwlRKLz8NuE+aW5umJBGDgu" }
}
</script>
<script type="module">
import { island, html } from 'aegis';
</script>

The integrity key of an import map is enforced in Chrome 127+ and Safari 18+; an older browser ignores the key and loads the same file, still pinned by its URL. Nothing breaks either way, and the hash is checked wherever the browser knows how.

The same files with hashes for every version: aegisjs.com/docs/installation. https://aegisjs.com/aegis.js without a version is the latest release, for experiments only. The files on the site are the files in this repository at the tag; the jsDelivr mirror works too: https://cdn.jsdelivr.net/gh/bauratynov/aegis@v0.7.0/aegis.min.js.

Which size is which#

One file is served, but you rarely ship all of it. Every number on this page is real; they measure different things:

Number What it is
7 KB gzip signal, computed, effect, batch, createScope after a production build: the reactive core alone
30 KB gzip the usual page: islands, html templates, lists, events and two-way binding, production build
93 KB gzip every export, production build (node build.mjs --from app.js strips the developer layer)
108 KB gzip aegis.min.js as served from the pinned URL: the same code plus the 60+ dev warnings, which only fire on localhost
11 KB gzip aegis.core.min.js, the signals + scope file for non-DOM code

The pinned URL is the whole file, so a page that imports five names still downloads 108 KB. If that matters, build the subset once (below) or let a bundler tree-shake it; the per-subset numbers are in docs/distribution.md.

Vendored#

Copy aegis.js (or aegis.min.js + .map) into your static folder next to your templates — it is one file with no dependencies. aegis.core.js is the signals + scope subset for non-DOM code.

<script type="module">
import { signal, island, html } from './aegis.js';
</script>

Only what you use, without a bundler#

Three lines: the repo reads the import { … } from 'aegis' line of your app and writes one tree-shaken production module.

git clone https://github.com/bauratynov/aegis && cd aegis
node build.mjs --from ../app/static/js/admin.js --out ../app/static/js/aegis.js
# → one file with exactly the exports admin.js imports (a 15-export admin bundle is 26 KB gzip); unknown names fail here, not in the browser

npm#

The package is aegisjs, the same name as the site (aegis and aegis-engine on npm belong to other projects). Not published yet: the exports map (., ./min, ./core, ./core/min) is ready and npm i aegisjs lands with 0.8. Until then the pinned URL above is the release channel, and a bundler resolves it the same way after npm i.

How the bare name aegis resolves#

Every example here and on the site imports from 'aegis'. That name is not magic: it comes from the import map in your base template (the pinned block above). With a bundler it comes from node_modules instead. Without either, import the URL directly:

import { island } from 'https://aegisjs.com/0.7.0/aegis.min.js';

Every version#

The files under https://aegisjs.com/<version>/ are the repository files at the git tag and never change. Put the hash into the integrity section of your import map (enforced in Chrome 127+ and Safari 18+; older browsers ignore the key and load the same file, still pinned by its URL). The gzip column is each file as served: aegis.min.js carries every export and the dev warnings, so it is the largest number here — “Which size is which” above says what a page actually ships.

Version File gzip Integrity
0.7.0 /0.7.0/aegis.min.js 109 KB sha384-IlZI8EunTsg50qmYrO6AIH/tIHqkkD1bZZIIln8MQrwlRKLz8NuE+aW5umJBGDgu
0.7.0 /0.7.0/aegis.core.min.js 11 KB sha384-SIbZxX4W5pteuZrFDW82MPlA6zSnzfPN2kMXJngDIhe66tm3RlrNAC9l+3m5NJtb
0.7.0 /0.7.0/aegis.js 208 KB sha384-EFAJFONjfFLHdu2Mbc3QlWY6NA2oAlObeO5ntG/gDznyfrg/C0thKwhwHC9pBuPW

The latest release without a version: /aegis.js (readable, dev warnings on localhost) and /aegis.min.js. They change with every release; use them for experiments.

Edit this page on GitHub