Repository navigation
snapshot-diff: a standalone crate for text snapshot diffs (sc-8792) - #20
Merged
Merged
Conversation
VisualCIdocspring/visualci · build #115 · 293 unchanged · no changes This PR vs base: 5 changed since #108, across 2 builds Updated as builds change. Agents can review with VisualCI's MCP tools. |
…tion, ignore rules, JSON changes by path and unified diffs, moved out of visualci-core into a standalone crate (regex, serde, serde_json, similar; schemars optional) that visualci-core re-exports as snapshot_text; release.yml publishes it to crates.io once per version; workspace 0.2.10
ndbroadbent
force-pushed
the
snapshot-diff
branch
from
December 2, 2026 05:29
9066173 to
4db3b15
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sc-8792 (replanned). Instead of publishing visualci-core, the part another project can genuinely reuse becomes its own crate, snapshot-diff 0.1.0: normalized diffs for text, JSON and HTML snapshots. Laravel Rust's snapshot testing will use it.
Why publish it: no crate on crates.io normalizes text snapshots before diffing them. snapshot-diff does all of this in one crate:
$.items[*].id, and regular expressions);items[3].price: 10 → 12);What stays out: the image diff. Talira had nothing listed, so I searched crates.io directly and found blazediff (a pixelmatch-compatible perceptual diff with anti-aliasing detection and an overlay, actively maintained), dify, image-compare and dssim. A standalone image diff is better served by those (Laravel Rust's visual testing chose blazediff), so vci-diff-1 stays inside VisualCI. The README points to blazediff.
The change:
crates/visualci-core/src/snapshot_text.rsmoves, unchanged, tocrates/snapshot-diff/src/lib.rs, with crate docs and a tested example.IgnoreRulesderivesJsonSchemabehind an optionalschemarsfeature.schemars) and re-exports it asvisualci_core::snapshot_text, so nothing else in the workspace changes. visualci-core drops its own regex dependency.CARGO_REGISTRY_TOKENsecret. A new crates.io token for snapshot-diff is needed (1Password stubcrates-io-snapshot-diff-token). Until it's set, the job only warns.Checked on docspring-dev:
cargo publish --dry-run -p snapshot-diffverifies 0.1.0;Review: no screenshots change.