The new storage implementation is sufficiently large a change that it
warrants a period of testing. To facilitate testing the new and old
implementations side by side we slightly abuse cargo's feature flags and
add a storage-v2 feature which enables the new storage and disables the
old storage.
Note that this commit doesn't use `--all-features` when building the
workspace in scripts/ci/build-test. This will be rectified in a later
commit once the storage-v2 feature is integrated into the other crates
in the workspace.
Signed-off-by: Alex Good <alex@memoryandthought.me>
Weave the original TypeScript code into the C ports of the WASM API's
sync tests.
Fix misnomers in the WASM API's basic and sync unit tests.
Fix misspellings in the WASM API's basic and sync unit tests.
Add symbolic last index specification to `AMlist{Delete,Get,Increment}()`.
Add symbolic last index specification to `AMlistPut{Bool,Bytes,Counter,
F64,Int,Null,Object,Str,Timestamp,Uint}()`.
Prevent `doc::utils::to_str(NULL)` from segfaulting.
Fix some documentation content bugs.
Fix some documentation formatting bugs.
as `AMgetChangeByHash()`.
Add the `AM_CHANGE_HASH_SIZE` macro define constant for
`AMgetChangeByHash()`.
Replace the literal `32` with the `automerge::types::HASH_SIZE` constant.
Expose `automerge::AutoCommit::splice()` as `AMsplice()`.
Add the `automerge::error::AutomergeError::InvalidValueType` variant for
`AMsplice()`.
Add push functionality to `AMspliceText()`.
Fix some documentation content bugs.
Fix some documentation formatting bugs.
Rename `AMdup()` to `AMclone()` to match the WASM API.
Rename `AMgetActor()` to `AMgetActorId()` to match the WASM API.
Rename `AMsetActor()` to `AMsetActorId()` to match the WASM API.
renamed source files.
Defer `BTreeMap` creation until necessary for `AMresult::Changes`.
Add `AMvalueEqual()` to enable direct comparison of two `AMvalue` structs regardless of their respective variants.
quickstart example up to the library as `AMresultStack` so that it can
appear in the README.md and be used to simplify the unit tests.
Promoted `free_results()` to `AMfreeStack()` and `push()` to `AMpush()`.
Added `AMpop()` because no stack should be without one.
`automerge::AutoCommit::get_at()`.
Add `AMmapRange()` to expose `automerge::AutoCommit::map_range()` and
`automerge::AutoCommit::map_range_at()`.
Add `AMmapItems` for `AMlistRange()`.
Add `AMmapItem` for `AMmapItems`.
`automerge::AutoCommit::get_at()`.
Add `AMlistRange()` to expose `automerge::AutoCommit::list_range()` and
`automerge::AutoCommit::list_range_at()`.
Add `AMlistItems` for `AMlistRange()`.
Add `AMlistItem` for `AMlistItems`.
fork()`.
Add `AMobjValues()` to expose `automerge::AutoCommit::values()` and
`automerge::AutoCommit::values_at()`.
Add `AMobjIdActorId()`, `AMobjIdCounter()`, and `AMobjIdIndex()` to expose `automerge::ObjId::Id` fields.
Change `AMactorId` to reference an `automerge::ActorId` instead of
owning one for `AMobjIdActorId()`.
Add `AMactorIdCmp()` for `AMobjIdActorId()` comparison.
Add `AMobjItems` for `AMobjValues()`.
Add `AMobjItem` for `AMobjItems`.
Add `AMobjIdEqual()` for property comparison.
Rename `to_doc!()` to `to_doc_mut!()` and `to_doc_const!()` to `to_doc!()`
for consistency with the Rust standard library.
`unicode-idents` distributes some data tables from unicode.org which
require an additional license. This doesn't affect our licensing because
we don't distribute the data files - just the generated code. Explicitly
allow the Unicode-DFS-2016 license for unicode-idents.
The ordering of opids in the successor and predecessors of an op is
relevant when encoding because inconsistent ordering changes the
hashgraph. This means we must maintain the invariant that opids are
encoded in ascending lamport order. We have been maintaining this
invariant in the encoding implementation - however, this is not ideal
because it requires allocating for every op in the change when we commit
a transaction.
Add `types::OpIds` and use it in place of `Vec<OpId>` for `Op::succ` and
`Op::pred`. `OpIds` maintains the invariant that the IDs it contains
must be ordered with respect to some comparator function - which is
always `OpSetMetadata::lamport_cmp`. Remove the sorting of opids in
SuccEncoder::append.
Makes SuccEncoder sort successors in Lamport clock order.
Such an ordering is expected by automerge js when loading documents,
otherwise some documents fail to load with a "operation IDs are not in
ascending order" error.
There is easy confusion when calling parents with the id of a scalar,
wanting it to get the parent object first but that is not implemented.
To get the parent object of a scalar id would mean searching every
object for the OpId which may get too expensive when lots of objects are
around, this may be reconsidered later but the result would still be
useful to indicate when the id doesn't exist in the document vs has no
parents.
The test `CMakeLists.txt` brings in cmocka but we don't actually need to
build the tests to get the docs. This just makes the cmake docs script
tell cmake not to build docs.