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

Placeholder Issue, New Automerge Text vs RawText #42

Open
issackelly opened this issue Sep 26, 2023 · 2 comments
Open

Placeholder Issue, New Automerge Text vs RawText #42

issackelly opened this issue Sep 26, 2023 · 2 comments

Comments

@issackelly
Copy link

I think we want to migrate many types to RawText in Automerge 3.

What are they? How should that migration happen?

@alexjg
Copy link
Collaborator

alexjg commented Sep 27, 2023

Do you mean the RawString type from the javascript @automerge/automerge/next package? If so there would be nothing to do in this package I think. The equivalent of RawString in autosurgeon is String.

However, with the advent of automerge/next more people will be using Text (as in the RGA text CRDT in automerge) where previously they would have been using String and we might want to introduce equivalent functionality in autosurgeon. One way to do that would be to extend the autosurgeon attribute for strings like this:

#[dervive(Hydrate, Reconcile)]
struct Contact{
    #[autosurgeon(representation = "text")]
    name: String
}

In general I think we should be using newtypes which implement Hydrate/Reconcile to achieve this kind of thing but for string specifically this feels like it might be worth it given that it is so ubiquitous?

@issackelly
Copy link
Author

Yes that's exactly what I mean, thanks! Just trying to get ahead of that change and know what would need to be done and documented for automerge/next or automerge3 or whenever it lands.

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

2 participants