Commit graph

735 commits

Author SHA1 Message Date
Andrew Jeffery
9cd146a464 Advance heads only needs slice 2021-04-24 14:25:31 -07:00
Andrew Jeffery
8b4632ae07 Use SyncHave::default 2021-04-24 14:25:31 -07:00
Andrew Jeffery
c5d3572670 Remove unwraps in sync 2021-04-24 14:25:31 -07:00
Andrew Jeffery
84bfb342c8 Swap some arguments in js interface
Still need to solve returning backend state from receive_sync_message in
correct order.
2021-04-24 14:25:31 -07:00
Andrew Jeffery
10e481ad0f Rename peer_state to sync_state 2021-04-24 14:25:31 -07:00
Andrew Jeffery
7c117ab3b1 Properly handle conversion to null for optional message 2021-04-24 14:25:31 -07:00
Andrew Jeffery
4b7bbe6710 Rename peer to sync 2021-04-24 14:25:31 -07:00
Andrew Jeffery
cd56799e1c Move all to sync 2021-04-24 14:25:31 -07:00
Andrew Jeffery
766b5621d4 Add more sync work 2021-04-24 14:25:31 -07:00
Andrew Jeffery
3eeb825138 Initial sync work 2021-04-24 14:25:31 -07:00
Andrew Jeffery
c9ba656c0c
CI: Use newer version of nodejs (#93) 2021-04-21 12:24:51 +01: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
Vedant Roy
e607d2e22b
add js interop testing (#91)
* add js interop testing

* checkout specific commit + fix bug in if stmt

* implement suggestions

* add to travis

* friendly error message + fix inverted if

* more intuitive order
2021-04-07 16:54:51 +01:00
Andrew Jeffery
137e6d2808 Fix clippy lints 2021-04-07 08:07:53 -07:00
Andrew Jeffery
342504714a Format 2021-04-07 08:07:53 -07:00
Andrew Jeffery
ef6589ea1a Ensure we return to the root build dir 2021-04-07 08:07:53 -07:00
Orion Henry
7e08bf131e testing travis ci 2021-04-07 10:57:14 -04:00
Orion Henry
ae56f0d12f explicitly use the static library 2021-04-03 12:31:13 -04:00
Martin Kleppmann
38214ca21e
Merge pull request #65 from automerge/implement-compression
Implement compression
2021-04-02 17:47:39 +01:00
Martin Kleppmann
f63fbe6156 Fix release build 2021-04-02 17:40:52 +01:00
Martin Kleppmann
78d0e4e9d3 Add getAllChanges to wasm backend
Fixes #81
2021-04-02 09:00:07 -07:00
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