Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing logical collection pointers #393

Merged
merged 30 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cd15621
moved Branch, BranchPtr to branch.rs
Horusiath Feb 11, 2024
877499a
introduced RootRefs
Horusiath Feb 15, 2024
4ab1faf
exposed Root and Nested types
Horusiath Feb 16, 2024
73d2626
Working YArray on ywasm
Horusiath Feb 22, 2024
7afa7b9
ywasm: YDoc and YTransaction methods
Horusiath Feb 22, 2024
c1f1ce4
ywasm: working YArray
Horusiath Feb 24, 2024
fb8073c
ywasm: prepared UndoManager
Horusiath Feb 24, 2024
6c38c3d
ywasm: prepared WeakLink
Horusiath Feb 24, 2024
3e98907
ywasm: flattened YDoc
Horusiath Feb 24, 2024
d33f946
ywasm: make YDoc compilable through wasm-interpreter
Horusiath Feb 29, 2024
064444c
ywasm: support YWeakLink
Horusiath Feb 29, 2024
5d24059
ywasm: support YMap
Horusiath Feb 29, 2024
ddf8a8a
ywasm: support YText
Horusiath Feb 29, 2024
5b1f1d8
ywasm: support XML types
Horusiath Mar 2, 2024
d45b345
ywasm: support for snapshots and sticky indexes
Horusiath Mar 3, 2024
7d60a01
ywasm: first batch of fixes
Horusiath Mar 7, 2024
9054653
ywasm: second batch of fixes
Horusiath Mar 7, 2024
56c8963
ywasm: third batch of fixes
Horusiath Mar 8, 2024
7f137df
ywasm: fourth batch of fixes
Horusiath Mar 8, 2024
b07878e
ywasm: fixed remaining tests
Horusiath Mar 8, 2024
19cdcd8
exposed logical IDs in ywasm API
Horusiath Mar 8, 2024
9b70f79
added documentation
Horusiath Mar 8, 2024
e732534
fixed doc.rs example
Horusiath Mar 8, 2024
7d50569
updated yffi tests
Horusiath Mar 8, 2024
9ed4e5d
added BranchID to yffi
Horusiath Mar 8, 2024
80dbfba
yffi: fixed one test
Horusiath Mar 8, 2024
10e6f1c
yffi: fixed event target resolution
Horusiath Mar 8, 2024
a105298
wtf 1
Horusiath Mar 8, 2024
00f8e48
added test for logical branches
Horusiath Mar 9, 2024
10f3b6d
fixed c ffi tests
Horusiath Mar 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Working YArray on ywasm
  • Loading branch information
Horusiath committed Feb 22, 2024
commit 73d2626d441bd98391783492e342c6302602c008
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion yrs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@
mod alt;
pub mod block;
mod block_store;
mod doc;
pub mod doc;
mod event;
mod id_set;
mod store;
Expand Down
6 changes: 6 additions & 0 deletions yrs/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,12 @@ impl<'a> From<&'a str> for Origin {
}
}

impl From<String> for Origin {
fn from(v: String) -> Self {
Origin(SmallVec::from(Vec::from(v)))
}
}

impl std::fmt::Debug for Origin {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
std::fmt::Display::fmt(self, f)
Expand Down
13 changes: 13 additions & 0 deletions yrs/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::types::weak::{LinkSource, WeakEvent, WeakRef};
use crate::types::xml::{XmlElementRef, XmlEvent, XmlTextEvent, XmlTextRef};
use crate::updates::decoder::{Decode, Decoder};
use crate::updates::encoder::{Encode, Encoder};
use serde::{Serialize, Serializer};
use std::collections::{HashMap, HashSet, VecDeque};
use std::convert::{TryFrom, TryInto};
use std::fmt::Formatter;
Expand Down Expand Up @@ -687,6 +688,18 @@ pub enum PathSegment {
Index(u32),
}

impl Serialize for PathSegment {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
match self {
PathSegment::Key(key) => serializer.serialize_str(&*key),
PathSegment::Index(i) => serializer.serialize_u32(*i),
}
}
}

pub(crate) struct ChangeSet<D> {
added: HashSet<ID>,
deleted: HashSet<ID>,
Expand Down
2 changes: 2 additions & 0 deletions ywasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ default = ["console_error_panic_hook"]
[dependencies]
yrs = { path = "../yrs", version = "0.17.3", features = ["weak"] }
wasm-bindgen = { version = "0.2" }
serde = { version = "1.0", features = ["derive"] }
gloo-utils = { version = "0.2.0", features = ["serde"] }

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
Expand Down
Loading