Repository navigation
Version comparison: diff in core, CLI and a compare mode in the viewer - #3
Merged
Merged
Conversation
diff(old, new) matches global components by qualified name, falling back to kind and local name when the target namespace changed, and reports fine-grained changes with their impact (breaking, non-breaking, info), possible renames and summaries per kind, namespace and file. The CLI's diff command writes the diff as JSON, Markdown or HTML.
Two schema sets can be loaded side by side (two drop zones on the open page, or ?bundle=<new>&compare=<old>). The changes overview has counts per kind, namespace and file, a filterable list kept in the link and Markdown, HTML and JSON downloads; each changed component gets a page with both versions side by side. Diagrams and content trees mark added (+, green), removed (−, red, struck through) and changed (~, amber) boxes, lines and arrows, in both themes.
MathiasVDA
force-pushed
the
version-diff
branch
from
October 21, 2026 17:42
de02c0b to
3e361b6
Compare
MathiasVDA
force-pushed
the
viewer-mvp
branch
from
October 21, 2026 17:42
bfe988b to
d1c3dd3
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.
Requested by Mathias · project thread
Plan step 3: version comparison. Stacked on #2 (
viewer-mvp).Core (
crates/core/src/diff.rs,report.rs)diff(old, new, &DiffOptions) -> SchemaDiff(serde,DIFF_FORMAT = 1, wasm-safe).…/3.2→…/3.3); the namespace map is derived and used to compare references.match_local_names,docs,renamesoptions.CLI
schema-explorer diff <old> <new> [-o file] [--format json|md|html] [--strict-namespaces] [--no-docs] [--titles OLD NEW] [--fail-on-breaking]. Each side is files, directories or a bundle; commas join several paths.Viewer
?bundle=<new>&compare=<old>; share links keepcompare.+, removed red−struck through, changed amber~, for boxes, lines and arrows; removed children/attributes appear as struck-through lines. Light and dark themes.Results
tWeightTons→tWeightTonnes).Tests
Hand-written v1/v2 pair in
crates/core/tests/data/diff(namespace change included) with 10 unit tests; fixture tests (skipped withoutSCHEMA_FIXTURES) for railML 3.1→3.2, 3.2→3.3 and TAF.Known gaps
Identity constraints (key/keyref/unique) are not compared; groups referenced in content models are compared on their own, not expanded; moves between two compositors of the same kind path are not detected.
Generated by Claude Code