Commit graph

172 commits

Author SHA1 Message Date
Andrew Jeffery
8b3938c2e7
Rename UncompressedChange to Change (#173)
It wasn't really uncompressed as we have compressed and uncompressed
changes in the backend. It is just not encoded into the binary format.
The module separation (protocol vs backend) should help with the
distinction.
2021-06-16 11:50:26 +01:00
dependabot[bot]
599c619a4d
Bump glob-parent from 5.1.1 to 5.1.2 in /automerge-backend-wasm (#166)
Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-16 09:59:04 +01:00
Orion Henry
ad3c75ff09 Remove unneeded wasm-opt 2021-06-12 15:01:38 -07:00
Orion Henry
647b8d2af2 fix deflate column decode order 2021-06-12 15:01:38 -07:00
Orion Henry
72d15bfe99 a few things broke in the merge 2021-05-24 16:27:05 -04:00
Andrew Jeffery
8876667a55 Set console_error_panic_hook when initing a backend 2021-05-24 13:19:39 -07:00
Vedant Roy
e694370733 Fix inverted bool + return correct data + remove serde 2021-05-24 13:15:20 -07:00
Vedant Roy
2c51761d01 Implement getAddedChanges 2021-05-24 13:15:20 -07:00
Alex Good
9bbaf7cbd5 Merge branch 'main' into implement-new-sequence-patch-format 2021-05-17 13:03:57 +01:00
Andrew Jeffery
5637956895 Add custom RootDiff type
This ensures that the patch starts with the right diff type statically
and will give an error to js during deserialization.
2021-05-16 14:02:57 +01:00
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
d36149e3ce Update js hash 2021-05-12 16:16:05 +01:00
dependabot[bot]
560a1c3381
Bump lodash from 4.17.20 to 4.17.21 in /automerge-backend-wasm (#119)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 10:21:33 +01:00
Andrew Jeffery
765c5287d7
Add event handler logic (#116)
* Add event handlers

Remove partialeq from Backend since I'm not sure of its relevance or
correctness anyway and complicates things with the event handlers.

* Add docs and use id

* Remove partialeq

* Add docs for enum variants

* Check index on remove_handler

* Pass functions through rather than making field pub
2021-05-11 10:15:37 +01:00
Andrew Jeffery
38b285e26e Update commit hash for interop testing 2021-05-05 21:53:40 +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
6cd2a5f6e4 Cleanup wasm lib and make SyncState somewhat opaque to js
This introduces a JsSyncState struct to give js as a handle to a real
syncstate which we want to keep in the wasm memory region to avoid lots
of serde stuff.

Some methods (getters and setters) are needed on this struct as the js
tests look inside but these are not technically specified for end users.

Also, now we can keep it mostly opaque we don't need the custom
serializer, yay!
2021-04-24 14:25:31 -07:00
Andrew Jeffery
de06c92ab7 Bump interop hash and swap sent_hashes set for map in js
In Js we don't have nice hashsets so we use an object, in Rust we can
actually use a hashset so we now need to do a conversion.
2021-04-24 14:25:31 -07:00
Andrew Jeffery
b3a7eff559 Use hashset for sent_hashes in js types 2021-04-24 14:25:31 -07:00
Andrew Jeffery
0e9ee417b9 Bump js_tests commit hash 2021-04-24 14:25:31 -07:00
Andrew Jeffery
e3de7d970a Only store hashes in sync_state rather than the actual changes 2021-04-24 14:25:31 -07:00
Andrew Jeffery
4c7e0c9167 Mutate the SyncState rather than consuming and returning 2021-04-24 14:25:31 -07:00
Andrew Jeffery
90cbbc7cab Fix ordering of receive_sync_message arguments 2021-04-24 14:25:31 -07:00
Andrew Jeffery
d1df9202c7 js_tests: Update commit hash to use sync-protocol-3 branch 2021-04-24 14:25:31 -07:00
Andrew Jeffery
ffea77f985 Add actual binary types 2021-04-24 14:25:31 -07:00
Andrew Jeffery
d61f1e1c6e Remove our_need and fix default SyncState 2021-04-24 14:25:31 -07:00
Andrew Jeffery
6c93315d74 Make a new types module and add BinaryChange to get uint8array 2021-04-24 14:25:31 -07:00
Andrew Jeffery
0a377a858b Catch up with js changes 2021-04-24 14:25:31 -07:00
Andrew Jeffery
f30a14d8f0 Add custom serializer just to get None to map to null 2021-04-24 14:25:31 -07:00
Andrew Jeffery
85f53685e2 Move to binary representation of changes in api 2021-04-24 14:25:31 -07:00
Andrew Jeffery
fd9e01fd9e Remove unwraps from wasm backend 2021-04-24 14:25:31 -07:00
Andrew Jeffery
68ddb2504e Improve js interop 2021-04-24 14:25:31 -07:00
Andrew Jeffery
646f88c2d2 Reorder receive_sync_message returns in js 2021-04-24 14:25:31 -07:00
Andrew Jeffery
e1bdf34471 More borrowing 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
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
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
Martin Kleppmann
38214ca21e
Merge pull request #65 from automerge/implement-compression
Implement compression
2021-04-02 17:47:39 +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
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
477fbf20db
backend-wasm: Make yarn release work again (#59) 2021-03-23 16:56:16 +00:00
Alex Good
c103b0638e Ritual abasement at the altar of clippy 2021-03-02 19:35:00 +00:00