Commit graph

499 commits

Author SHA1 Message Date
Orion Henry
9ff0c60ccb add cra example code 2022-01-28 18:05:33 -05:00
Orion Henry
cfa1067c19 rework wasm function to use js types more directly 2022-01-28 17:07:59 -05:00
Orion Henry
3393a60e59 clippy lint 2022-01-20 14:17:11 -08:00
Orion Henry
7b3db2f15a clippy lint 2022-01-20 14:17:11 -08:00
Orion Henry
54fec3e438 lamport compare was backward on actorids and so was value resolution 2022-01-20 14:17:11 -08:00
Andrew Jeffery
0388c46480 Remove unused is_empty function on optrees 2022-01-19 15:16:02 -08:00
Andrew Jeffery
429426a693 Fix removal and rollback
Credit to @orionz
2022-01-19 15:16:02 -08:00
Andrew Jeffery
2015428452 Detect object type before getting length 2022-01-19 15:16:02 -08:00
Andrew Jeffery
812c7df3a7 Add length tests to props tests 2022-01-19 15:16:02 -08:00
Andrew Jeffery
5867c8d131 Fixup CI 2022-01-19 15:11:04 -08:00
Andrew Jeffery
0ccf36fe49 Add test and doc update for setting scalarvalues 2022-01-19 15:11:04 -08:00
Orion Henry
a12af10ee1 optimize js 2022-01-19 18:08:15 -05:00
Orion Henry
faf3e2cae4 update todo 2022-01-18 12:45:10 -05:00
Orion Henry
8b2f0238f3 create sub op tree at a time when we know the type 2022-01-18 09:11:46 -08:00
Orion Henry
acbf394290 cleanup some dead code 2022-01-14 06:27:42 -08:00
Orion Henry
b30a2b9cc1 give Counter its own type 2022-01-14 06:27:42 -08:00
Orion Henry
d50062b769 move values into the counter type - remove need for vis_window 2022-01-14 06:27:42 -08:00
Orion Henry
e59d24f68b return values are sorted - add counter del test 2022-01-14 06:27:42 -08:00
Orion Henry
642a7ce316 update todo list 2022-01-11 17:54:23 -05:00
Orion Henry
067df1f894 break sync, interop, and value code into their own files 2022-01-09 08:05:00 -08:00
Orion Henry
fdab61e213 derive default 2022-01-09 08:05:00 -08:00
Orion Henry
557bfe1cc9 update todo 2022-01-09 08:05:00 -08:00
Orion Henry
a2e6778730 fmt 2022-01-09 08:05:00 -08:00
Orion Henry
04c7e9184d port over all the sync tests to the wasm api 2022-01-09 08:05:00 -08:00
Orion Henry
b67098d5e1 convert automerge-js to use import/export 2022-01-09 08:05:00 -08:00
Orion Henry
45ee5ddbd9 add import/export 2022-01-09 08:05:00 -08:00
Orion Henry
d2a7cc5f75 get sync tests working 2022-01-09 08:05:00 -08:00
Alex Good
1f0a1e4071 Correctly sort actor IDs when encoding changes
This is a port of a fix previously merged into `main`.

The javascript implementation of automerge sorts actor IDs
lexicographically when encoding changes. We were sorting actor IDs in
the order the appear in the change we're encoding. This meant that the
index that we assigned to operations in the encoded change was different
to that which the javascript implementation assigns, resulting in
mismatched head errors as the hashes we created did not match the
javascript implementation.

This change fixes the issue by sorting actor IDs lexicographically. We
make a pass over the operations in the change before encoding to collect
the actor IDs and sort them. This means we no longer need to pass a
mutable `Vec<ActorId>` to the various encode functions, which cleans
things up a little.
2022-01-04 15:28:03 -08:00
Orion Henry
ef89520d7c more tests for wasm 2022-01-03 14:59:46 -05:00
Orion Henry
96a8357e36 add hasher for exid 2022-01-03 14:59:34 -05:00
Orion Henry
4c4484b897 fix bug in wasm 2022-01-03 12:58:08 -05:00
Alex Good
dc8140cb0b fmt 🙄 2022-01-01 20:17:38 +00:00
Orion Henry
3046cbab35
Replace the OpID API with an object ID
Rather than returning an OpID for every mutation, we now return an
`Option<ObjId>`. This is `Some` only when a `make*` operation was
applied. This `ObjID` is an opaque type which can be used with any
document.
2022-01-01 20:15:02 +00:00
Alex Good
de5332af05 Run the js_test in CI
We add a script for running the js tests in `scripts/ci/js_tests`. This
script can also be run locally. We move the `automerge-js` package to
below the `automerge-wasm` crate as it is specifically testing the wasm
interface. We also add an action to the github actions workflow for CI
to run the js tests.
2021-12-30 17:30:38 -05:00
Orion Henry
6932bdff08 package.json can run on windows now 2021-12-29 14:16:15 -05:00
Alex Good
7087cbdf69 Add CI to README 2021-12-24 10:18:16 -08:00
Alex Good
e98eca3a08 Add github action 2021-12-24 10:18:16 -08:00
Alex Good
4e043e06c2 Add script to run all the CI steps 2021-12-24 10:18:16 -08:00
Alex Good
fa936b5a28 Add script to run clippy 2021-12-24 10:18:16 -08:00
Alex Good
001c9befcc Add script to run cargo fmt 2021-12-24 10:18:16 -08:00
Alex Good
05a7d24f77 Add script to run tests 2021-12-24 10:18:16 -08:00
Alex Good
216b4eed82 Add deny.toml and a script for calling cargo deny
In order to get cargo deny to pass we also update a few dependencies and
add licenses
2021-12-24 10:18:16 -08:00
Orion Henry
9d0caab6b6 import the uuid tests 2021-12-22 15:36:57 -05:00
Orion Henry
4c90b5f822 get js text tests working 2021-12-22 15:08:31 -05:00
Andrew Jeffery
7f115964f1 Unwrap text set in benchmark 2021-12-22 10:35:42 +00:00
Orion Henry
e275334e72 remove dead code and pubs we don't need 2021-12-21 12:23:55 -05:00
Orion Henry
780298b72c docs, tests, code cleanup 2021-12-21 09:23:34 -08:00
Orion Henry
8eb147333c use value_at() in the js wrapper 2021-12-21 09:23:34 -08:00
Orion Henry
265ce823da implement all the query_at(), add tests, was, cut dead code 2021-12-21 09:23:34 -08:00
Alex Good
6a63d30a56 Add some rust tests
This commit adds a bunch of testing infrastructure as well as most of
the tests from the `legacy_tests.js` file in the js codebase that seem
applicable to this codebase.
2021-12-20 17:54:40 -08:00