Commit graph

842 commits

Author SHA1 Message Date
Alex Good
bbf729e1d6
@automerge/automerge 2.0.0 2022-11-22 12:13:42 +00:00
Orion Henry
ca25ed0ca0
automerge-wasm: Use a SequenceTree in the OpObserver
Generating patches to text objects (a la the edit-trace benchmark) was
very slow due to appending to the back of a Vec. Use the SequenceTree
(effectively a B-tree) instead so as to speed up sequence patch
generation.
2022-11-22 12:13:42 +00:00
Alex Good
03b3da203d
@automerge/automerge-wasm 0.1.16 2022-11-22 00:02:28 +00:00
Alex Good
e713c35d21
Fix some typescript errors 2022-11-21 18:26:28 +00:00
Jason Kankiewicz
a7656b999b
Add AMobjObjType() (#454)
automerge-c: Add AmobjObjType()
2022-11-07 23:10:53 +00:00
Alex Good
05093071ce
rust/automerge-test: add From<f64> for RealizedObject 2022-11-07 12:08:12 +00:00
Alex Good
bcab3b6e47 Move automerge/tests::helpers to crate automerge-test
The assert_doc and assert_obj macros in automerge/tests::helpers are
useful for writing tests for any application working with automerge
documents. Typically however, you only want these utilities in tests so
rather than packaging them in the main `automerge` crate move them to a
new crate (in the spirit of `tokio_test`)
2022-11-06 19:52:21 +00:00
Alex Good
b53584bec0
Ritual obeisance before the altar of clippy 2022-11-05 22:48:43 +00:00
Orion Henry
91f313bb83 revert compiler flags to max opt 2022-11-04 18:02:32 +00:00
tosti007
6bbed76f0f Update uuid dependency to v1.2.1 2022-11-01 11:39:24 +00:00
Alex Good
bba4fe2c36
@automerge/automerge@2.0.0-beta.4 2022-10-28 11:31:51 +01:00
Alex Good
61aaa52718 Allow changing a cloned document
The logic for `clone` which was updated to support cloning a viewed
document inadverantly left the heads of the cloned document state in
place, which meant that cloned documents could not be `change`d. Set
state.heads to undefined when cloning to allow changing them.
2022-10-27 19:20:41 +01:00
Alex Good
20d543d28d
@automerge/automerge@2.0.0-beta.3 2022-10-26 14:14:01 +01:00
Alex Good
5adb6952e9
@automerge/automerge@2.0.0-beta.2 and @automerge/automerge-wasm@0.1.15 2022-10-26 14:03:12 +01:00
Orion Henry
3705212747
js: Add Automerge.clone(_, heads) and Automerge.view
Sometimes you need a cheap copy of a document at a given set of heads
just so you can see what has changed. Cloning the document to do this is
quite expensive when you don't need a writable copy. Add automerge.view
to allow a cheap read only copy of a document at a given set of heads
and add an additional heads argument to clone for when you do want a
writable copy.
2022-10-26 14:01:11 +01:00
Orion Henry
d7d2916acb tiny change that might remove a bloom filter false positive error 2022-10-21 15:15:30 -05:00
Alex Good
3482e06b15
javascript 2.0.0-beta1 2022-10-18 19:43:46 +01:00
Orion Henry
59289f67b1 consolidate inserts and deletes more aggressivly into a single splice 2022-10-18 13:29:56 +01:00
Alex Good
a4a3dd9ed3
Fix docs CI 2022-10-18 13:08:08 +01:00
Alex Good
ac6eeb8711
Another attempt at fixing cmake build CI 2022-10-18 12:46:22 +01:00
Alex Good
20adff0071
Fix cmake CI
The cmake CI seemed to reference a few nonexistent targets for docs and
tests. Remove the doc generation step and point the test CI script at
the generated test program.
2022-10-18 11:56:37 +01:00
Alex Good
6bb611e4b3
Update CI to rust 1.64.0 2022-10-18 11:49:46 +01:00
Alex Good
e8309495ce
Update cargo deny to point at rust subdirectory 2022-10-18 11:28:56 +01:00
Orion Henry
4755c5bf5e
Merge pull request #444 from automerge/freeze
make freeze work recursively
2022-10-17 16:31:52 -07:00
Orion Henry
38205fbcc2 enableFreeze() instead of implicit freeze 2022-10-17 17:35:34 -05:00
Orion Henry
a2704bac4b Merge remote-tracking branch 'origin/main' into f2 2022-10-17 16:32:23 -05:00
Orion Henry
ac90f8f028 Merge remote-tracking branch 'origin/freeze' into f2 2022-10-17 16:21:35 -05:00
Orion Henry
c602e9e7ed update build to match directory restructuring 2022-10-17 16:20:25 -05:00
Alex Good
1c6da6f9a3
Add JS worker config to Vite app example
Vite apps which use SharedWorker of WebWorker require additional
configuration to get WebAssembly imports to work effectively, add these
to the example.
2022-10-17 01:09:13 +01:00
Alex Good
24dcf8270a
Add typedoc comments to the entire public JS API 2022-10-17 00:41:06 +01:00
Alex Good
e189ec9ca8
Add some READMEs to the javascript directory 2022-10-16 20:01:49 +01:00
Alex Good
96f15c6e00
Update main README to reflect new repo layout 2022-10-16 20:01:45 +01:00
Alex Good
8e131922e7
Move wrappers/javascript -> javascript
Continuing our theme of treating all languages equally, move
wrappers/javascript to javascrpit. Automerge libraries for new languages
should be built at this top level if possible.
2022-10-16 19:55:54 +01:00
Alex Good
dd3c6d1303
Move rust workspace into ./rust
After some discussion with PVH I realise that the repo structure in the
last reorg was very rust-centric. In an attempt to put each language on
a level footing move the rust code and project files into ./rust
2022-10-16 19:55:51 +01:00
Orion Henry
5ce3a556a9 weak_refs 2022-10-16 19:55:25 +01:00
Orion Henry
dd5edafa9d make freeze work recursively 2022-10-15 21:21:18 -05:00
Alex Good
cd2997e63f
@automerge/automerge@2.0.0-alpha.5 and @automerge/automerge-wasm@0.1.10 2022-10-13 23:13:09 +01:00
Orion Henry
f0f036eb89
add loadIncremental to js 2022-10-13 23:03:01 +01:00
Alex Good
ee0c3ef3ac javascript: Make getObjectId tolerate non object arguments
Fixes #433. `getObjectId` was previously throwing an error if passed
something which was not an object. In the process of fixing this I
simplified the logic of `getObjectId` by modifying automerge-wasm to not
set the OBJECT_ID hidden property on objects which are not maps, lists,
or text - it was previously setting this property on anything which was
a JS object, including `Date` and `Uint8Array`.
2022-10-13 21:37:37 +01:00
Orion Henry
e6d1828c12
Merge pull request #440 from automerge/repo-reorg
Repo reorg
2022-10-12 10:07:02 -07:00
Alex Good
4c17fd9c00
Update README
We're making this project the primary implementation of automerge.
Update the README to provide more context and signpost other resources.
2022-10-12 16:25:43 +01:00
Alex Good
660678d038
remove unneeded files 2022-10-12 16:25:43 +01:00
Alex Good
a7a4bd42f1
Move automerge-js -> wrappers/javascript
Whilst we only have one wrapper library, we anticipate more.
Furthermore, the naming of the `wrappers` directory makes it clear what
the role of the JS codebase is.
2022-10-12 16:25:43 +01:00
Alex Good
352a0127c7
Move all rust code into crates/*
For larger rust projects it's common to put all rust code in a directory
called `crates`. This helps in general by reducing the number of
directories in the top level but it's particularly helpful for us
because some directories _do not_ contain Rust code. In particular
`automerge-js`. Move rust code into `/crates` to make the repo easier
to navigate.
2022-10-12 16:25:38 +01:00
Alex Good
ed0da24020
Track whether a transaction is observed in types
With the `OpObserver` moving to the transaction rather than being passed
in to the `Transaction::commit` method we have needed to add a way to
get the observer back out of the transaction (via
`Transaction::observer` and `AutoCommit::observer`). This `Observer`
type is then used to handle patch generation logic. However, there are
cases where we might not want an `OpObserver` and in these cases we can
execute various things fast - so we need to have something like an
`Option<OpObserver>`. In order to track the presence or otherwise of the
observer at the type level introduce
`automerge::transaction::observation`, which is a type level `Option`.
This allows us to efficiently choose the right code paths whilst
maintaining correct types for `Transaction::observer` and
`AutoCommit::observer`
2022-10-12 16:11:23 +01:00
Orion Henry
3989cac405
Merge pull request #439 from automerge/type-patchcallback
Add TypeScript type for PatchCallback
2022-10-10 14:25:43 -07:00
Alex Good
2d072d81fb
Add TypeScript type for PatchCallback 2022-10-10 21:19:39 +01:00
Alex Good
430d842343
Update vite.config.js in Vite Example README 2022-10-10 14:14:38 +01:00
Alex Good
dff0fc2b21
Remove automerge-wasm devDependency
This dependency was added in a PR which is no longer relevant as we've
switched to depending directly on `@automerge/automerge-wasm` and
testing by running a local NPM registry.
2022-10-10 13:05:10 +01:00
Orion Henry
9e1fe65a64
Merge pull request #429 from automerge/actually-run-js-tests
Use the local automerge-wasm in automerge-js tests
2022-10-06 15:41:07 -07:00