Skip to content

feat(gate): move the directly mounted scanner to Preact - #54

Merged
yujiym merged 1 commit into
mainfrom
feat/gate-preact
Nov 5, 2026
Merged

yujiym merged 1 commit into
mainfrom
feat/gate-preact

Conversation

@yujiym

@yujiym yujiym commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Why

Move fuda's frontends to Preact through the owner's void-preact adapter because they consider it the most promising structure and want fuda to dogfood their library.

This layer stacks on #53 and ports gate first. Gate keeps its direct index.html mount and Worker verification. The pages adapter arrives with dash because gate has no pages APIs to consume.

What changed

  • Replace gate's Solid renderer with exact Preact 11.1.1 and the Preact Vite preset. Keep React aliases disabled and retain the existing Vite+ override.
  • Add only the consumed Preact Scanner and a reusable act DOM helper. Share the existing camera loop, labels, and prop types through renderer-independent UI subpaths.
  • Keep busy and reader buffers in refs, install the reader and autofocus with layout timing, and keep camera callbacks current without reopening the camera. Read the input ref when submission immediately follows typing.
  • Port Scanner coverage and add gate lifecycle and verdict tests. Update the architecture overview and README.
  • Fix two existing production styling defects found in the browser. Gate supplied no verdict color tokens, and Tailwind missed the shared Scanner's utilities. Restore the documented verdict colors and Scanner layout, including the Check button's sizing.

Scope

Gate and its consumed shared UI only. Dash and app continue using Solid. There are no changes to API contracts, e2e assertions, deployment configuration, or ADR 0015. The new runtime and preset are older than the three-day release window, so no additional age exemption is needed.

Blast Radius

Both renderers consume the shared Scanner labels and camera module. The camera lifetime itself is unchanged from #53. Full workspace checks and all unchanged e2e cases cover coexistence. The gate, Vite+, preset, Prefresh, and prerender Vite imports have identical module identity; the workspace retains its two existing YAML peer contexts of Vite+ core 0.3.0. Existing peer-version warnings remain.

Verification

All commands use mise x node@24 -- corepack pnpm.

  • install --frozen-lockfile, check, test, fallow:audit, and e2e all exit 0.
  • check reports all 855 files formatted and no lint or type issues in 1,026 files.
  • test passes 2,442 Vitest tests and 70 Solidity tests. Gate has 50 tests and ui-preact has 10.
  • fallow:audit reports zero new dead code, complexity, or duplication findings.
  • e2e passes all 19 unchanged cases. The seven unchanged gate cases also pass separately against its production Worker and the built local API Worker.
  • Chromium captures the first scan on the initial DOM commit before the next paint in both reader-only and autofocus modes. A QR canvas camera exercises real video playback, the real lazy jsQR decoder, verdict delivery, and stream teardown with no page errors.
  • The production startup JS grows by 948 bytes gzipped. Both complete clients were measured from their manifests with identical per-response gzip level 9 compression, repeated five times. This is a static byte count, not a speed claim.

Local logs, saved client outputs, scripts, screenshots, and measurement details are under artifacts/2026-11-05-preact-migration/gate/ in the main checkout. Generated local void.lock.json values were restored.

Deploy and manual checks

No deployment was performed. All local servers and browser tabs were stopped. WebKit is not installed at /tmp/fuda-pw, so its check is skipped. A real camera and NETUM reader remain owner checks.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
@yujiym
yujiym changed the base branch from refactor/scanner-camera to main November 5, 2026 14:11
@yujiym
yujiym merged commit dc89e35 into main Nov 5, 2026
22 checks passed
@yujiym
yujiym deleted the feat/gate-preact branch November 5, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant