DOM ENGINEV0.31.0FIZLET
Start

0.28.0 RELEASE NOTES

Fizlet 0.28.0

By Chris Cooley ↗ · · CHANGELOG.md ↗

  • Breaking: every storage key and page hook is named for Fizlet. Renames, with no alias left behind (the older names are no longer read, matched or set):
    • @fzlt/core/ui: PERF_KEY is "fizlet:perf". A visitor's saved "Performance overlay" switch is read from the new key, so it starts off once.
    • @fzlt/core/ui/tokens.json: name is "Fizlet Board UI"; the storage keys are fizlet:theme, fizlet:perf, fizlet:<game>:sound and fizlet:doors; the second entry of shadow.domains is "example: a site with a diagonal light".
    • @fzlt/core/arcade: the default selectors match the data-fizlet-* hooks only ([data-fizlet-text], [data-fizlet-target], [data-fizlet-ignore]), and the overlay host carries data-fizlet-host and data-fizlet-ignore only. A page that used the older hook attributes renames them to these. Comments, docs, tests and the brick catalog name the Fizlet Arcade's games only; the repository is https://github.com/fizlet/fzlt ↗.
  • Repository: the package alone, ready to become fizlet/fzlt (public, MIT). The website (site/, examples/, its build scripts, its tests, the Pages deploy and the site, settle and page-cost CI jobs) moves to its own repository; fizlet.com is rebuilt there. No change to the package's code or API: the tarball is the same bin/, dist/, CHANGELOG, LICENSE and README. package.json: repository and bugs at fizlet/fzlt, homepage https://docs.fzlt.dev ↗ (the fzlt bin prints it). The brick catalog moves to scripts/bricks.mjs; npm run perf measures the home demo on a page of its own (tests/perf/fixture); the release workflow publishes from fizlet/fzlt only. docs/bricks-inventory.md: every brick's measured gzip size, who ships it and its docs. The package keeps its public documentation and nothing else: the TSDoc blocks in dist/*.d.ts and the /* @__PURE__ */ annotations in dist/*.js stay, every other comment is stripped (packed 364,459 B, was 377,562 B; consumers' bundles unchanged). npm run publish-clean gates every PR and publish: only dist/, bin/ and the four docs, no other comments, no agent words, no private names. Credits: created by Chris Cooley, built with fzlt, sponsored by coded.design (tests/credits.test.mjs). docs/SPLIT.md: what this repository is now, where the site lives, how a release reaches it, and the transfer steps.
  • @fzlt/core/ribbon (new brick, ALPHA; 2,683 B gz, budget 2,752): roads, tracks and edge strips drawn along their true curve at their true width on a heightfield, lifted from Holeshot's road-edge ribbons (its road graph and materials stay in the game). ribbon(d, ground, options) adds one decal to the ground's cluster; band(line, from, to, color, closed) paints the strip between two offsets across a line, mitred at the joints, every corner on the ground's own height; near-clipped, culled, slope-shaded, far to near in depth buckets, one fill per colour and shade, seamless; hide skips pieces behind a crest. Zero allocation per frame.
    • Tests: tests/ribbon.test.mjs (corners where the diorama projects them, draped on the terrain's own sample, mitred joints, near clip, cull, hide, cap, 0 young GCs over 2,000 frames with a terrain and three bands) and tests/ribbon.mjs (Chromium: a dune track with two edge strips, the track's colour under its projected centre line, orbiting, settles to 0 frames).
  • @fzlt/core/rig (new brick, ALPHA; 1,321 B gz, budget 1,344): jointed limbs for diorama figures, lifted from Holeshot's rider (its art stays in the game). limb(d, id, { on, l1, l2, normal, bend }) adds two groups (:a the upper bone, :b the lower; parts hang along +x) and reach(ax, ay, az, bx, by, bz) poses both so the lower bone's tip lands on the target (pulled in along the line out of reach). ik2 (a plane) and ik3 (3D, in the plane nearest a normal, with each bone's diorama rotation) stand alone; outset grows an outline for an ink edge. Zero allocation per pose.
    • Tests: tests/rig.test.mjs (lengths, tips, bend sides, frames through the diorama's own matrices, degenerate inputs, 0 young GCs posing four limbs for 100k frames) and tests/rig.mjs (Chromium: a pedalling figure, every hand and foot within 0.5 px of its target, moving, settles to 0 frames).
  • @fzlt/core/turntable (new brick, ALPHA; 1,395 B gz, budget 1,408): a model viewer's angle, lifted from the garage turntables Holeshot and CitySmash each built by hand (the art and the drawing stay in the game). turntable(engine, el, { yaw, rate, key, friction, snap, ease, spin, motion, label, onTurn }): a sideways drag turns it at once, ← → and Home with focus, spin(secs) after a change, an opt-in throw (friction) and step (snap), a slider's ARIA with label; reduced motion jumps and never spins. onTurn(yaw) runs in render only when the angle changed; the engine sleeps at rest.
    • Tests: tests/turntable.test.mjs (drag, keys, Home, spin, throw and snap, motion off, the ledger gives the element back, 0 young GCs over 300k steps) and tests/turntable.mjs (Chromium: a diorama model turned by a real mouse drag and keys, reduced motion, settles to 0 frames).
  • @fzlt/core/ground (new brick, ALPHA; 603 B gz, budget 640): paint on a diorama's ground through its own projection, lifted from the decal painters Holeshot, CitySmash, Dune Hop and Salvo Bay each wrote by hand. seg (a world line, dropped at the eye), spot (a level disc as an ellipse sized by depth), ring (a closed ring on a plane or on a ground's slope), shadow (a blob that fades and narrows with lift) and horizon (its screen y); at is the last point projected. Calls add to the current path. Zero allocation per call.
    • Tests: tests/ground.test.mjs (each against the diorama's own project, the eye and near, a real terrain's slope, the horizon against far ground, 0 young GCs over 20k frames) and tests/ground.mjs (Chromium: the pixels where the diorama projects them, a shadow that fades as its ball lifts).
  • @fzlt/core/diorama: glide(cam, goal, rate, dt, snap), a camera ease. Three games eased a diorama's camera toward a goal by hand each frame and jumped under reduced motion (Salvo Bay's view changes, CitySmash's pan, Dune Hop's reframe). glide moves each field the goal names 1 − e^(−rate·dt) of the way, lands exactly once close (0.0005 rad, 0.01 units, 0.4 px), leaves the other fields alone, and returns true while it moves (settle-friendly); snap cuts. API-compatible (a new export; it tree-shakes: diorama() alone stays 6,613 B). The whole module: 7,456 B gz (+198 B), budget 7,296 → 7,488.
    • Tests: tests/diorama-glide.test.mjs (the step, the exact landing, partial goals, snap, 0 young GCs over 1M steps).
  • @fzlt/core/presence: send() writes a message's frame and value through one DataView (−11 B gz). 2,197 → 2,186 B gz (budget 2,240 → 2,208), presence/check 4,870 → 4,850 B. The same 12 little-endian bytes on the wire; 4 peers in lockstep cost the same (1.02–1.08 µs a round before and after, Node 24, median of 7 × 20,000 rounds, 3 runs each); still no allocation per message.
  • @fzlt/core/ui: launch() reads the key's look and the board's tones before it adds the burst layer (no forced layout). The burst layer went onto <body> before the key's look and the board's tones were read, so those reads forced a style and layout pass; now they come before the layer is added. One click on a 4,000-node page at 4× CPU: 6.7–7.8 → 4.6 ms median (40 clicks, 2 runs each, Chromium), forced layouts in the call 1 → 0. Same burst, same colours; 2,907 → 2,900 B gz.
  • @fzlt/core/collide: Grid's insert and query share one cell-range helper (−14 B gz, about 24 % faster). 1,265 → 1,251 B gz (budget 1,536 → 1,280); 512 inserts + 512 queries a frame 42.5 → 32.0 µs (Node 24, median of 7 × 2,000 frames, 3 runs each); board-page 4,104 → 4,076 B, arcade 24,145 → 24,115 B. Same cells, same ids, same counters: no behaviour change. The API snapshot lists Grid's two new private members (o, b).
  • Brick audit (fe audit fizlet): no fails, no gaps in exports, README or tests. @fzlt/core/presence/rollback no longer reads wall time in its step: the correction meters resimMs and resimTotal read a clock the host passes (clock: () => performance.now(), a profiling opt-in) and stay 0 without one (2,181 B gz, +5 B). @fzlt/core/touch has a Node suite (tests/touch.test.mjs: listeners, one finger never cancelled, null and custom selectors, release, zero allocation over 2M events). The README names every runtime export (a "Named constants and small helpers" list under Engine API).
  • Site: the roadmap ticks E8.blitz-kit (Battlefield Blitz on steer and coach, dom-battlefield-blitz#22); every E8 box is ticked, so E8 The game kit is done. The engine's ROADMAP.md agrees (fe roadmap check).
  • @fzlt/core/steer and @fzlt/core/coach are COMPLETE. Battlefield Blitz moves every tank on steer (drive, seek, arriveGoal, wander, the exact hypot) and counts its practice coach's steps and tricks on tour (its own card stays; dom-battlefield-blitz#22, merged; Blitz's next release ships it). Its replay plays the pinned matches value for value, lockstep shows 0 desyncs, and its zero-GC test is green. No API change. The README table and site/bricks.mjs say COMPLETE; API snapshots in api/.
  • @fzlt/core/scene (new brick, EXPERIMENTAL, E13; 1,928 B gz of its own, planned at ≤ 2,048; 8,369 B with the kernel, fx, sprite and timeline's easings it composes, budget 8,704): an animation recipe as data. A scene is JSON: a stage (a pixel grid fitted to the box, background, seeded starfield, shake, end, loop, an intro delay, the reduced-motion poster time), a cast (sprites, rects, text and lines drawn in order; every value a number, a track [from, to, at, dur, ease] on @fzlt/core/timeline's EASES, a jump (dur 0, numbers or colours) or a blink), cues (fx words, kicks and bursts, once each, in order) and gags (an fx emitter held open over a window, following a track). scene(data, { motion }) is a slot mount; mountScene(stage, data) returns { engine, play, destroy } and is the engine's system. One canvas through the ledger (Recall exact), the clock moves in the step on numbers only, it rests on the last frame and settles (engine.busy(sec) holds it to the end, intro delay included), a tap replays, reduced motion draws the poster and settles.
    • Tests: tests/scene.test.mjs (values, cues, gags, settle, replay, loop, delay, poster, Recall, zero allocation per step, the own-code size, every gallery scene file against the format) and tests/scene.mjs in Chromium (below).
    • Allocation: zero per step, except a gag that follows a track. It hands fx.emit a new x and y each step (~32 B), only while its window is open. @fzlt/core/fx's emit takes numbers, and the recipe code made the same call.
    • Status: EXPERIMENTAL (ALPHA in the README) in site/bricks.mjs (since 0.28.0, no. 43; snapshot and agent move to 44 and 45), a README row, its brick page; it leaves PLANNED, and E13 lists its acceptance items (E13.scene, E13.fe-anim, E13.shrink).
  • Gallery: two meme micros are scene data, not code. #38 "a to the moon rocket launches off a button" and #40 "a candle chart pumps then dumps" are site/gallery/anims/<id>.scene.json. Same ids, numbers and approvals. The build mounts a .json module with @fzlt/core/scene (entrySource in scripts/gallery.mjs; the settle guard uses it too). Live size, gzip (buildGallery): rocket 9,158 → 8,999 B (−159), candles 9,162 → 8,913 B (−249). Behaviour is unchanged: in Chromium, both versions run by hand on the same clock and match pixel for pixel on every frame of a play and a tap replay; they settle within a step of each other, the poster is the rest frame, and Recall is exact (tests/scene.mjs). #41 laser eyes stays the hand-built piece (#163); "diamond hands" (#39) stays on the recipe code: its words fly on accumulated speed and trigger on contact, which the format does not express yet.
  • Gallery: Stack it, a hero (pending the owner's approval; its number comes at land time). Fizlet's bricks, by their real names, Board UI colours (the brick catalog's roles) and sizes measured on this build, burst out over the stage; a hand stacks kernel, input, sprite, fx and hud onto the pad (each lands with a slam, dust in its colour and its bytes); the stack stretches into the bands of an app window and becomes a shooter, which plays and gets its stars. Then it is your turn: tap or drag bricks onto the pad, press FINISHED, and the stack becomes its own app (input, pad, steer: a shooter; timeline, camera: a movie; grid, rules, match, board-page, presence: a board game; the kernel alone: hello), rated on what it does and what it weighs (a star each for: it runs, a real app, something shows on it, no dead weight, ≤ 12 KB of bricks; no kernel, no app). The bricks are real Board UI keys (tap, Enter or Space stacks one), the rating is spoken. Built on the kernel alone (its dust, blasts and pop words are one small pool in the scene; fx in your stack turns hits into blasts). Live chunk 9,706 B gzip (≤ 9,728), loader 1,932 B; measured in Chromium 153: 0 frames a second once still (it settles after its ~10 s story), 0 off screen, Recall exact, nothing loads under reduced motion (the poster, a still composition). site/demos/stack/, poster site/gallery/stages/stack-it.html; tests tests/stack.mjs (Chromium: intro, tap and drag, FINISHED, rating, no kernel, REBUILD, keyboard, 0 frames, Recall, reduced motion) and tests/stack.test.mjs (each brick's bytes and colour against the build, the poster, the stars).
  • Site test: a live scene's own keys (its pieces) are left to its own test in the page keys check.
  • Site: the roadmap marks E6 Performance wins and E7 Page interactions done. E6.weekly (the weekly perf run, #92) and E7.page-cost (the page-cost gate, #97) are ticked; with the win log (#135) and the CI split (#316) every E6 box is ticked. The engine's ROADMAP.md agrees (fe roadmap check).
  • @fzlt/core/announce (E14, BETA): game events read out through one polite live region, rate-limited. announce(engine, { words, gap, doc }) → { say, flush, destroy }: one [data-fz-announce] status region per page, made on the first word; words(event) turns ring events into sentences in render, coalesced by key (the latest score, not ten), at most one write per gap; destroy() removes the region. Measured gz is in npm run size (budget 614 B). Tests: tests/announce.test.mjs, tests/announce.mjs (Chromium).
  • @fzlt/core/actor, @fzlt/core/aim and @fzlt/core/view-dom (E11, ALPHA). actors({ cap, sides, x, y, a, events }): units, bots and shots as one fixed table of typed arrays (spawn, kill, hurt, heal, sweep, handles, side counts, tags, nearest), 908 B gz. aim({ x, y, a, vx, vy, board, mask, clear, foe }): lead, cones, line of sight and target picking, 691 B gz. viewDom(engine, actors, host, opts): an actor table as pooled DOM nodes, change-only through the ledger, settles when still, Recall removes every node, 882 B gz. All DOM-free or ledger-only, zero allocation per step; budgets 1,229 / 1,024 / 1,536 B. src/ACTORS.md: the migration note for DOM Battlefield onto them. Tests: tests/actor.test.mjs, tests/aim.test.mjs, tests/view-dom.test.mjs, tests/view-dom.mjs (Chromium).
  • Page-cost gate (npm run perf:page, CI perf job). Each page in tests/perf/page-budgets.json is loaded live and poster-only (module scripts removed but the site chrome), at desktop and mobile (4× CPU), best of 3; it fails when the live page adds more than CLS 0, a tap on page text +8 / +24 ms or idle CPU +3 / +10 points. Waits count frames, never wall time; the tap is timed in the page at sub-ms resolution. Writes page-cost-results.json; on GitHub Actions every result, each run's idle CPU, rAF calls a second by script and layout-shift sources are annotations. Unit tests: tests/page-cost.test.mjs.
    • Measured in CI (six runs, best of 3 each): home desktop idle is +7.0 to +10.7 points against +3, all of it the layers story's 30 fps autoplay (layers.js 30 rAF/s; poster page 0). Every CLS and tap measure and home mobile pass in the last four runs (the first two runs showed mobile at 30 rAF/s and desktop CLS 0.0008, before the per-script annotations; not seen since).
    • One named exception (exceptions in page-budgets.json): home desktop idle, tracked as G20 (#139, the story on compositor animations). It is reported as a warning on every run and fails past its ceiling, +12 (the highest run, +10.7, plus about a point of runner spread). The budget stays +3. An exception must name a roadmap task, link its tracking issue, say why and record its measured runs; CLS can't be excepted (tested).
  • CI: the perf job runs weekly too (Mondays 06:17 UTC, schedule: in ci.yml; every other job skips scheduled runs). Each run uploads perf-results.json, kept 90 days. Each result line (and each over-budget line) is also a GitHub annotation, readable through the API without the artifact, and the machine line carries the load average at the start and end of the run.
  • Perf budgets are measured (tests/perf/budgets.json, no longer provisional): the demo's from the medians of 3 CI perf runs (p50 16.7 ms, 0% dropped, layerize 1.49 ms, FCP 320 ms, heap 3.55 MB, 4 minor GCs; load ≤ 1.15), Blitz's from 3 local runs (load 17–26, noted). Ceilings tighten: demo p50 25 → 20 ms, p95 67 → 34, p99 117 → 34, dropped 45 → 5%, layerize 4 → 3 ms, FCP 2,000 → 700 ms, heap 8 → 7 MB, minor GC 10 → 8. Each run, and the rule from median to ceiling, is in the file.
  • PERF-LOG.md: five more measured wins (roadmap E6, G9), each with its merged PR's numbers: the layers story's CLS 0.002 → 0 (#129, #123); the Battlefield landing hero 91.7 → 49.4 % main thread busy on a 4× phone (dom-battlefield#21); the fps cap's slot from the frame's start, that hero 22.6 → 27.8 rAF/s of the 30 it asks for (#122); presence's WebSocket send 22 → 0 young GCs per 400k (#104); fizlet.com's two stylesheets 19,831 → 13,975 B gzip (#105). A win may name another repo (repo: a game site running Fizlet, with that repo's version), and Unreleased is a version. tests/site.mjs now checks the served stylesheets are minified (the CSS win had no test).
  • Site: the roadmap ticks E6.ci-split (CI split into shards, #316) and E8.match (a released game on @fzlt/core/match, #276). From fe roadmap sync; the engine's ROADMAP.md agrees (fe roadmap check).
  • @fzlt/core/terrain: the default steep colour is the first band darkened, not black. Without steepColor, terrainView made the steep colour as an rgb() string, and the shade ramp parses #rrggbb, so every default steep face drew black. Now the default is the first band × 0.8 as #rrggbb, as the option's doc meant. A view that sets steepColor is unchanged. Size: the terrain module 5,511 → 5,566 B gz (+55 B, inside the 5,568 B budget). Tests: tests/terrain.test.mjs (a slope with no steepColor: its steep faces take the band × 0.8 and no face is black; fails on the old code).

Every release