Commit graph

712 commits

Author SHA1 Message Date
Martin Kleppmann
7ae0edb283 Remove getChangesForActor from wasm backend
This function no longer exists in the JS backend
2021-04-02 09:00:07 -07:00
Gregory
f6b3964733 backend: remove unecessary draining of changes to apply. 2021-04-01 09:19:32 -07: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
02e1a6b6cc Simplify if statement to remove unreachable case
If `op_by_id` contains `succ` then we can get the index straight away,
else we can do the original work. This means we don't need an `else`
case for a third situation as in reality there isn't one.
2021-03-30 09:01:03 -07: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
3f5a781c71
Simplify while stack not empty (#68) 2021-03-28 21:28:37 +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
2f46719ec7
Add nightly to travis config (#69) 2021-03-28 21:26:07 +01:00
Alex Good
82cf04ae49 Implement compression 2021-03-27 16:52:43 +00:00
Tyler Samples
ec87f411aa
Fix types in wasm/README.md (#66) 2021-03-27 11:12:50 +00:00
Andrew Jeffery
1e36b62272
Check the checksum in the document on decoding (#62) 2021-03-26 13:59:03 +00: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
69048791e1
Add nix config (#61)
* Add nix config

* Update flake-utils input
2021-03-24 18:15:18 +00:00
Andrew Jeffery
485356ca6c
Update travis config (#60)
* travis: Add building wasm backend

* Specify defaults for os and dist

* Update travis badge
2021-03-23 21:25:43 +00:00
Andrew Jeffery
477fbf20db
backend-wasm: Make yarn release work again (#59) 2021-03-23 16:56:16 +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
Orion Henry
59fc360f58 Merge branch 'main' of github.com:automerge/automerge-rs into main 2021-02-19 14:05:25 -05:00
Orion Henry
37f8778a81 reorg file for new package 2021-02-18 16:41:20 -05: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
93d45c381d Run rustfmt 2021-02-15 15:04:05 +00:00
saki-osive
5f26ec0c5f Refactored javascript into JavaScript 2021-02-12 12:03:59 -05:00
Alex Good
33328796cd Remove mutable reference to actors in OpSet::finalize_diffs 2021-02-12 12:03:10 -05:00
Alex Good
08f324f7e6 Merge ref encoding/decoding and value encoding/decoding 2021-02-12 12:03:10 -05:00
Alex Good
9bfcaea477 Run rustfmt 2021-02-12 12:03:10 -05: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
Alex Good
8f9d66d4f2 Add CursorDiff and serde impls 2021-02-12 12:03:10 -05:00
Alex Good
0b99082c67 Add Cursor data type and serde impls for it 2021-02-12 12:03:10 -05:00
Matt Ho
3e72cf6df0 added cdylib to produce dynamic library 2021-02-12 11:56:24 -05:00
Orion Henry
6350a8726d trying new ways to package the wasm 2021-02-12 11:49:49 -05:00
Orion Henry
ef38e6d7da getting some WASM errors trying to access crypto in the browser - switching to SmallRng with a 0 seed for now - deterministic distribution of nodes in the skip list should be fine 2021-02-12 11:49:06 -05:00
Orion Henry
f8b6228488 remove js wrapper code and move all module wrapper logic into rust 2021-02-04 16:23:15 -05:00
Alex Good
b0fc259892 Run clippy and cargo fmt 2021-02-03 16:39:38 +00:00
Orion Henry
740315cdc4 added get_last_local_change() 2021-02-02 15:17:48 -05:00
Orion Henry
78024fd000 add automerge_get_heads() and automerge_error() 2021-02-02 14:33:00 -05:00
Alex Good
98015f5a9c Better formatting for cli docs 2021-02-01 18:24:21 +00:00
Orion Henry
f79f632d35 remove raw string literal from c test program 2021-02-01 12:22:11 -05:00
Matt Ho
0c44edd919
fixed typos (#43) 2021-02-01 10:57:11 +00:00
Alex Good
a28ae6edb6 Fix dependency encoding in document format 2021-01-31 15:59:51 +00:00
Alex Good
c34f771693 Add color to CLI 2021-01-30 17:56:54 +00:00
Alex Good
6affcae4d1 Document change command 2021-01-30 12:47:11 +00:00
Orion Henry
db2d540cae zero length error 2021-01-29 17:59:57 -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