Repository navigation
v0.11.0
Minor changes
-
3024eb1: Rust crates: a compact graph in
kgdiff-core, read through methods, and two more ways to build
one. Breaking for Rust callers; no output changes by a byte.- Memory.
normalizeof 100k nodes and 300k edges now adds 42 MiB of resident memory
instead of 150 MiB (RFC 0002 §7: under 50 MB), and the graph retains 23 MB of heap instead of
100 MB. Edges are rows of positions into the nodes and into one table of predicates and labels;
their structural keys are written when asked for. Nodes keep what few of them have
(aliases,replaces,replacedBy, a position) apart. normalize_inputbuilds the graph from Rust values (GraphInput,NodeInput,
EdgeInput, the members ofgraph.v1.json; attribute values stayjs::Value) — the graph
normalize(&input.to_value(), …)gives, with the samegraph_to_jsonbytes, hash and issues,
checked on every graph of the conformance corpus (RFC 0003, part 3).normalize_jsonbuilds it from JSON text, element by element, without a tree of the whole
document.- Breaking:
KGraph,KGNodeandKGEdgehave no public fields. Read them through methods:
graph.nodes(),node(id),node_at(i),node_index(id),contains_node(id),
node_count(),edges()(EdgeRefs),edge(key),edge_at(i),edge_index(key),
contains_edge(key),edge_count(),meta(),edge_identity(),issues();node.id(),
label(),types(),aliases(),attrs(),is_deprecated(),replaces(),replaced_by(),
is_implicit(),position();edge.key(),id(),source(),target(),predicate(),
label(),attrs(), andEdgeRef::to_edge()for an edge on its own.outgoingand
incomingyieldEdgeRefs instead of&Arc<KGEdge>. AKGNodeorKGEdgecan no longer be
built field by field: build graphs withnormalize_input.
@kgdiff/cli - Memory.
-
47a78d8: Breaking. The TypeScript compute code that kgdiff's Rust engine (
@kgdiff/compute) replaced is removed (RFC 0002, phase 5): about 13,000 lines of source. The asynchronous functions that compute are unchanged, and the read path (normalize,hashGraph,diffFromJSON,applyDelta,formatHunk,layoutFromJSON, …) stays in TypeScript, synchronous.@kgdiff/core:log2, deprecated in the previous change, is removed (useMath.log2). The TypeScript matching, classification, hunks, delta emission and similarity are removed;diff,matchNodesandtextSimilarityrun on@kgdiff/compute.@kgdiff/formats: the TypeScript parsers are removed, and with them the dependency onn3.parseGraph,detectFormat,compactIri,FORMAT_EXTENSIONSand the types stay; the package remains deprecated in favour of@kgdiff/compute.@kgdiff/layout: the TypeScript layout engine is removed, and with it the dependencies ond3-forceandd3-quadtree.
@kgdiff/core·@kgdiff/formats·@kgdiff/layout -
01a57e9: Breaking. Computing runs on kgdiff's Rust engine in WebAssembly (
@kgdiff/compute) everywhere, and the functions that compute are asynchronous (RFC 0002, phase 5). The results are the kgdiff CLI's, byte for byte.@kgdiff/core:diff,matchNodesandtextSimilarityreturn promises.log2is deprecated (useMath.log2).@kgdiff/formatsis deprecated in favour of@kgdiff/compute:parseGraph,detectFormatandcompactIrireturn promises and run its parsers.@kgdiff/layout:layoutDiffandextendLayoutreturn promises; newlayoutGraph,layoutDiffOnandlayoutAfter, to keep one map across versions. Positions are the Rust engine's, which are 0.10's for the same input (the conformance corpus checked the two engines against each other on every case through 0.10); layouts are now written as version 2 documents.@kgdiff/compute:diffSyncanddiffAndLayoutSyncread the engine's diff back withoutdiffFromJSON's consistency checks (it was written by the same build; documents from elsewhere are still checked), and keep the node positions of the graphs, so a diff of graphs with positions is still laid out anchored on them, and the issues found normalizing them. Graphs may be given asKGraphs: as in 0.10, two with the same edge identity are compared with it when the options name none, andmatchNodesreads each with its own.@kgdiff/viewer: the compute module and the standalone add-on run on@kgdiff/compute. The add-on inlines the layout-only module, so single-file reports expand collapsed groups offline; an expansion asked for while it compiles waits for it.load()in the standalone viewer needs@kgdiff/computein the import map. The viewer bundle has no WebAssembly.
Migrating: put
awaitin front of each changed call, orawait init()of@kgdiff/computeonce and use its*Syncfunctions. Pages with a Content Security Policy need'wasm-unsafe-eval'to compute. The read path (normalize,hashGraph,diffFromJSON,applyDelta,formatHunk,layoutFromJSON, …) stays synchronous. See docs/guide/migrating-to-0.11.md.@kgdiff/core·@kgdiff/formats·@kgdiff/layout·@kgdiff/viewer·@kgdiff/compute -
de02790:
@kgdiff/computeis published: kgdiff's Rust engine as three WebAssembly modules, each loaded only when asked for (RFC 0002, §7).computediffs, matches and normalizes graphs,formatsreads graph files, andlayoutlays diffs out on typed arrays, small enough to be inlined in an HTML report;@kgdiff/compute/layoutloads that one alone.init()loads them (init({ modules: ['layout'] })only some), thendiffSync,matchNodesSync,textSimilaritySync,parseGraphSync,detectFormatSync,layoutDiffSync,extendLayoutSync,layoutGraphSync,layoutDiffOnSyncandlayoutAfterSyncgive the objects of@kgdiff/core,@kgdiff/formatsand@kgdiff/layout;diff,parseGraph,layoutDiffand the others load their module themselves.jsonis the same on JSON text, byte for byte what the kgdiff CLI writes. The other packages do not use it yet.@kgdiff/compute
Every package is at 0.11.0: @kgdiff/cli · @kgdiff/core · @kgdiff/formats · @kgdiff/layout · @kgdiff/scene · @kgdiff/renderer · @kgdiff/viewer · @kgdiff/g6 · @kgdiff/compute.
GitHub Action: uses: iiwish/kgdiff@v0.11.0.