automerge/javascript/test
Alex Good 1e33c9d9e0 Use Automerge::load instead of load_incremental if empty
Problem: when running the sync protocol for a new document the API
requires that the user create an empty document and then call
`receive_sync_message` on that document. This results in the OpObserver
for the new document being called with every single op in the document
history. For documents with a large history this can be extremely time
consuming, but the OpObserver doesn't need to know about all the hidden
states.

Solution: Modify `Automerge::load_with` and
`Automerge::apply_changes_with` to check if the document is empty before
applying changes. If the document _is_ empty then we don't call the
observer for every change, but instead use
`automerge::observe_current_state` to notify the observer of the new
state once all the changes have been applied.
2023-02-03 10:01:12 +00:00
..
legacy automerge-js: Add prettier 2022-12-22 17:33:14 +00:00
basic_test.ts Improve typescript types (#508) 2023-01-27 17:23:13 +00:00
extra_api_tests.ts automerge-js: Add backwards compatibility text layer 2023-01-10 12:52:21 +00:00
helpers.ts automerge-js: Add prettier 2022-12-22 17:33:14 +00:00
legacy_tests.ts Use Automerge::load instead of load_incremental if empty 2023-02-03 10:01:12 +00:00
stable_unstable_interop.ts Improve typescript types (#508) 2023-01-27 17:23:13 +00:00
sync_test.ts automerge-js: Add prettier 2022-12-22 17:33:14 +00:00
text_test.ts automerge-js: Add backwards compatibility text layer 2023-01-10 12:52:21 +00:00
text_v1.ts automerge-js: Add backwards compatibility text layer 2023-01-10 12:52:21 +00:00
uuid_test.ts automerge-js: Add prettier 2022-12-22 17:33:14 +00:00