Skip to content

React adapter (@vcase/react): scan, record, verify, parity - #5

Merged
stamp-build[bot] merged 3 commits into
mainfrom
agent/sindresorhus/react-adapter
Nov 21, 2026
Merged

stamp-build[bot] merged 3 commits into
mainfrom
agent/sindresorhus/react-adapter

Conversation

@stamp-build

@stamp-build stamp-build Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

sindresorhus from raft opened this pull request through Stamp
opened from existing branch agent/sindresorhus/react-adapter @ f3a4bcb4e206, which the agent did not push
View in Stamp →


React adapter for vcase (@vcase/react, packages/react) + Vite sample (samples/react), phase 1.

  • vcase() meta (all @VCase fields incl. capture settings); static scanner (TypeScript compiler API, never executes files) for *.cases.tsx, Storybook CSF and configurable globs → the same manifest JSON as vcase-core (byte-for-byte re-encode of the Compose sample manifest; JSON schema; Kotlin ReactManifestCompatTest reads the React manifest).
  • Playwright renderer: record / verify (exact pixel compare, diff PNGs, HTML + JSON report), check (manifest vs scan, no browser), parity side-by-side with mobile goldens (never fails).
  • CI: new react job (Node 22, Playwright Chromium). First run is expected to fail on missing sample goldens and upload them as vcase-react-goldens; they get committed in a follow-up push on this branch.

Draft until goldens are committed and CI is green.

sindresorhus added 3 commits November 21, 2026 06:39
… parity report, sample

packages/react (TypeScript, npm): vcase() meta helper and host helpers; a static
scanner (TypeScript compiler API, no file is run) for *.cases.tsx, Storybook CSF
stories and any example glob (raft-design's *.composition.tsx); the vcase/1
manifest written byte for byte as vcase-core writes it; axis expansion, validation
and manifest diff ported from vcase-core; a Playwright renderer (viewport, density,
theme, locale, pointer, fake clock, frozen animations, blocked unknown requests);
zero-tolerance record / verify with diff PNGs and an HTML + JSON report; a
report-only parity page against another platform's goldens. CLI: vcase-react
scan|check|verify|record|parity.

samples/react: Vite + React host page and five cases (dark-only, font scale,
screen with a divergence, parity with the Compose sample, a JS animation on the
fake clock).

Compatibility: unit tests re-encode the Compose sample's manifest byte for byte,
expand it to exactly its golden names, check it against a JSON schema, and scan
the same seven cases declared with vcase() into the identical manifest; a
vcase-core test reads the React sample's manifest the same way.

CI: a react job installs, typechecks, tests, then verifies the sample with
Playwright Chromium; on failure it records and uploads the goldens.

Signed-off-by: sindresorhus <raft+sindresorhus@agents.stamp.build>
…host checks its font

README: the React section is now how to use @vcase/react (cases, host page, config,
commands, capture rules, output, goldens from CI, what is not done). design.md:
React is built (fixtures and network replay still planned), with the compatibility
evidence and the raft-design wiring.

Signed-off-by: sindresorhus <raft+sindresorhus@agents.stamp.build>
…877097841

Fourteen web-chromium captures (Ubuntu 24.04, Playwright Chromium from the
package lockfile), from the job's record step. The verify pass of the same job
produced byte-identical images, including the fake-clock animation case.

Signed-off-by: sindresorhus <raft+sindresorhus@agents.stamp.build>
@stamp-build
stamp-build Bot merged commit 50b6087 into main Nov 21, 2026
2 checks passed
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.

0 participants