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

How to get all the deltas from a given shared type? #104

Open
jannikbuschke opened this issue Aug 14, 2024 · 9 comments
Open

How to get all the deltas from a given shared type? #104

jannikbuschke opened this issue Aug 14, 2024 · 9 comments

Comments

@jannikbuschke
Copy link

Hello, thanks for this good looking project!

Given an XmlText, how to get all the deltas?
In yjs an YXmlText has a method toDelta() which seems to give a list of all the changes if I am not mistaken. I dont see such a method on the dotnet types? Is this missing or implemented somewhere else?

@SebastianStehle
Copy link
Collaborator

Hi, I think yrs just does not implement this method.

@Horusiath
Copy link
Collaborator

@jannikbuschke @SebastianStehle yrs has this method, it's called Text::diff.

@SebastianStehle
Copy link
Collaborator

Thank you, but I don't see it in yffi: https://github.com/y-crdt/y-crdt/blob/main/yffi/src/lib.rs

@Horusiath
Copy link
Collaborator

If that's the case, I'll try to add it to yffi before next release.

@jannikbuschke
Copy link
Author

I thought I found another way to accomplish my current thing, but actually the delta seems to be important for getting the embeds out of an XML Text. At least I did not yet found another way.

@jannikbuschke jannikbuschke reopened this Aug 22, 2024
@Horusiath
Copy link
Collaborator

Horusiath commented Aug 23, 2024

@SebastianStehle @jannikbuschke from what I've checked, yffi already has necessary API -> ytext_chunks. Atm. you cannot insert series of formatted text chunks using yffi, as it's a little bit more complicated, but we'll get there as well.

@Horusiath
Copy link
Collaborator

Horusiath commented Aug 25, 2024

Update: yffi v0.20 now allows to insert text deltas as well. Read release docs for changes and see tests (I've added quite a few of them) for example usage and new features.

@jannikbuschke
Copy link
Author

@SebastianStehle would love if this could be added to ydotnet 🙏

@SebastianStehle
Copy link
Collaborator

Sure. Not sure when I have time for that. A PR would also be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants