-
Notifications
You must be signed in to change notification settings - Fork 22
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
Upgrade to yrs 0.13+ #106
Comments
It'd be also nice to upgrade lib0 and pyo3 dependencies to their latest versions. |
@Waidhoferj thoughts? |
I'd recommend keeping it Pythonic. The binding should abstract away the Rust implementation so that it is easier to use in Python. I considered doing this by having each element ( |
Isn't it in contradiction with @Horusiath's comment? |
We wouldn't expose the |
@davidbrochart I think we may talk about two different docs - Also re. @Waidhoferj for clarification:
In Yrs, y-types don't hold strong reference to document store, only weak ones. You'd need an extra field with reference somewhere in ypy to make it strong. |
I have come up with a first implementation for |
I've made some more progress and I believe I have a working approach for |
I have looked a bit into how an upgrade to yrs 0.13+ could look like (mainly because I want
XMLFragement
support).Apparently transactions are now required in more places and the previous quite Pythonic Python API is no longer easily achievable.
E.g. previously:
would no longer work as
text.__len__
needs access to a read transaction now.I wanted to gather some thoughts about how the API design should go forward. Here are two alternatives that came to mind:
1. Trying to keep it Pythonic
This would store a reference to the transaction in
YText
and would then pass it internally toyrs::types::text::Text.len
etc.Not sure if that's a good idea, as the
YText
objects would need to be invalidated when outside the transaction block which may come as a surprise.2. Embrace the Rust interface
This will not be Pythonic, removing e.g.
__getitem__
and__iter__
implementations but doesn't hide the complexity and may be an easy forward.Any other ideas or thoughts?
The text was updated successfully, but these errors were encountered: