Commit graph

76 commits

Author SHA1 Message Date
Andrew Jeffery
641fd11703
Change init to new and add defaults (#130)
Structs should use `new` for the constructor name and implement
`Default` where they can.
2021-05-14 21:35:09 +01:00
Andrew Jeffery
2aa35bc349
Add derive Arbitrary support behind cargo feature (#124) 2021-05-14 16:38:35 +01:00
Andrew Jeffery
3a8447c068
Remove automerge bench harness (#106)
This removes the default wrapper which throws errors with some cli
arguments, e.g. --save-baseline which is nice for being able to compare
versions!
2021-04-27 10:30:07 +01:00
Andrew Jeffery
d1934f2286 Add formatting config 2021-04-26 09:42:36 -07:00
Andrew Jeffery
aebfdc6572 Update patches with pending_changes 2021-04-24 14:25:31 -07:00
Everett Pompeii
fb59ce746d
Fix typo (#98)
Add `u` to `structure`.
2021-04-20 21:45:40 +01:00
Andrew Jeffery
fc45ff09a3
Allow change to return value from users closure (#84)
* Allow change to return value from users closure

* Add closure_result field to OptimisticChangeResult
2021-04-15 10:49:04 +01:00
Andrew Jeffery
9c5f7f8482
Change Increment operation to use i64 (#79) 2021-04-15 10:35:17 +01:00
Andrew Jeffery
d3d1b48c48 Cleanup box on frontend 2021-03-31 08:59:38 -07:00
Andrew Jeffery
d17554dfc4 Remove rc on backend 2021-03-31 08:59:38 -07:00
Andrew Jeffery
f9513cf970
Fix benchmarks using text (#74)
* Fix benchmarks using text

* CI: change --all to --all-targets

--all is a deprecated alias to --workspace where we also want to build
all targets: benches, tests, examples etc.
2021-03-31 10:41:08 +01:00
Andrew Jeffery
239fe59090
Use grapheme clusters in Text instead of char (#72)
* Use grapheme clusters in Text instead of char

char is not what users typically expect as a 'letter' so we should use
grapheme clusters instead. These can't always be represented as single
rust char types so the Text now stores a Vec of single grapheme Strings.

* Add test for grapheme clusters in text

* Use debug_assert_eq instead of debug_assert
2021-03-28 21:32:03 +01:00
Andrew Jeffery
776aef660a
Fix alignment error on wasm32 (#71)
* Add failing alignment test case

* Add wasm-pack test to ci

* Box im_rc::Vector contents to satisfy alignment

This makes the frontend not have alignment issues on 32 bit
architectures (e.g. wasm32-unknown-unknown). The box provides a
consistent alignment for the Vector.
2021-03-28 21:28:18 +01:00
Andrew Jeffery
921e9859b2
Fix issue in RleDecoder with null runs (#63)
* Add test to check save and load works on failing input

We loop 100 times due to it being a flaky test, likely due to an
iteration order issue in hashmaps.

* Update printing diff of changes

* Add new case for save then load

* Add another failing test case for save_load

* Update test case

* Update test case to not use empty strings in keys

* Specify to decode into usize in rle decoder

The `decoder.read` call was previously inferring to use isize since the
`self.count` variable is that type. This meant that for a list of null
values >= 64 in length it would read it as negative and so enter an
infinite loop of reading nulls, even if there were other values to read.

This changes the read to use usize but introduces the issue of usize
potentially being bigger than isize. This should be very unlikely for
what it is currently used for though so I'll defer this to later work.

* Add a test case to check the repeated nulls issue in rle

* Update tests

* Specify reading rle len as i64 instead of isize
2021-03-26 13:57:08 +00:00
Andrew Jeffery
2cc7b60ccb
Update uuid (#52)
This enables it to work for wasm32.
2021-03-18 12:38:05 +00:00
Andrew Jeffery
429b3ebf06
Nostd time (#51)
* frontend: Add std feature

* frontend: Add new_with_timestamper

This allows using the frontend in contexts where SystemTime isn't
available.
2021-03-17 11:55:31 +00:00
Alex Good
c103b0638e Ritual abasement at the altar of clippy 2021-03-02 19:35:00 +00:00
Alex Good
4f4674a4a1 Implement cursors in frontend 2021-03-02 16:07:52 +00:00
Alex Good
52c008788b Run rustfmt 2021-02-15 15:42:59 +00:00
Alex Good
29f29581e6 Fix build error and remove cargo cache from Travis 2021-02-15 15:36:04 +00:00
Alex Good
26dfc7ea40 Implement cursor logic in backend 2021-02-12 12:03:10 -05:00
Alex Good
2d31952d77 Implement encoding and decoding of cursor operations 2021-02-12 12:03:10 -05:00
Orion Henry
d4a60dafc1 Merge branch 'main' of github.com:automerge/automerge-rs into main 2021-01-29 17:56:14 -05:00
Orion Henry
c135b02a48 full document compression 2021-01-29 17:55:59 -05:00
Alex Good
24dcd9c1e6 Add automerge change CLI op 2021-01-29 14:27:51 +00:00
Alex Good
ae4b9f8f94 Add some benchmarks and make some performance related tweaks 2021-01-25 13:49:38 +00:00
Alex Good
20bbe7c8b0 Run cargo fmt 2021-01-20 15:48:04 +00:00
Alex Good
8142d42796 Add first crdt benchmark and some frontend optimisations 2021-01-20 15:18:47 +00:00
Alex Good
8516476db2 Fix handling of Unchanged diffs in StateTreeValue::new_from_diff 2021-01-19 14:55:54 +00:00
Alex Good
56750f68d1 Fix inserts at beginning of a text object 2021-01-19 14:20:09 +00:00
Alex Good
c45d055ce3 Fix clippy 2021-01-16 17:55:30 +00:00
Alex Good
497372db99 Immutable frontend rewrite 2021-01-16 17:40:47 +00:00
Martin Kleppmann
5ec8408398 Replace all-zeros UUID with '_root'
Corresponding to automerge/automerge@10ec271cbd
2021-01-12 14:45:32 -05:00
Scott Trinh
b943c41e7d
cli: Add import command (#21)
* cli: wip Add import command

* cli: wip Save bytes to out file

* cli: Update `export` for reader/writer interface

* cli: Update import for reader/writer interface

* cli: Add `atty` to check if stdin/out is a TTY

* cli: Require file path if not streaming in or out

* cli: Align naming of the binary changes file, whether in or out

* cli: Small documentation fixes

* cli: Allow specifying an input file for import

* cli: Add `duct` crate for testing

* cli: comment-out println that was showing up in output files

* cli: Add basic CLI tests for import, export, and import -> export

* cli: EOF NL

* cli: Remove a few redundant calls to clone

* cli: Move duct to dev-dependencies

* Remove debug message
2020-06-08 20:01:55 +01:00
Alex Good
f5195fc25f run clippy 2020-06-04 00:35:46 +01:00
Alex Good
d7560d88ed Start making errors more descriptive 2020-06-04 00:32:18 +01:00
Alex Good
2cf2835e76 Make Patch::clock keys ActorID rather than String 2020-05-30 01:44:00 +01:00
Alex Good
62345c2b5f Make Patch::actor an ActorID, not a string 2020-05-30 01:24:26 +01:00
Alex Good
a36a364443 Rename automerge_protocol::Value -> ScalarValue 2020-05-29 21:04:29 +01:00
Alex Good
baba6a75b6 rustfmt 2020-05-26 16:20:26 +01:00
Alex Good
03a786d608 Fix a few small bugs 2020-05-26 16:17:06 +01:00
Alex Good
baaebef6d1 Merge branch 'master' into two-level-objtype 2020-05-25 18:47:46 +01:00
Orion Henry
ab71d01487 internal types impl COPY 2020-05-25 09:43:28 -04:00
Alex Good
a589689bdb Fix clippy 2020-05-24 11:19:05 +01:00
Alex Good
2443cdf860 Remove objtype wrapper for diffs 2020-05-24 11:06:23 +01:00
Alex Good
40c8f8f9b3 Move ObjType to two level hierarchy 2020-05-24 10:22:18 +01:00
Orion Henry
25393130e8 Merge remote-tracking branch 'origin/master' into bin_change 2020-05-22 19:11:52 -04:00
Orion Henry
48dfd6f29a ActorID is now bytes 2020-05-22 19:00:39 -04:00
Orion Henry
87b44cf977 ChangeRequest->Request 2020-05-22 16:11:26 -04:00
Alex Good
2567efcc70 Port apply local patch tests 2020-05-22 15:11:42 +01:00