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

Is there support for nested data structures? #213

Open
paholg opened this issue Jan 7, 2025 · 2 comments
Open

Is there support for nested data structures? #213

paholg opened this issue Jan 7, 2025 · 2 comments

Comments

@paholg
Copy link

paholg commented Jan 7, 2025

Say I want to have an array of maps. In yrs, this looks very straightforward -- just create a MapPrelim and insert it into the array.

I can find no analog in yrb. I am curious if I'm missing something, or if this feature is not currently supported, is it planned? If not, I may take a crack at it if I have some spare time -- my intuition says that it shouldn't be too hard, but that could very wrong.

Finally, if I use a Y::Array of Hashs and wish to sync individual field updates, would you expect this to generally work well, and just be less efficient than if they were proper Y::Maps?

Thanks so much!

@eliias
Copy link
Collaborator

eliias commented Jan 7, 2025

Say I want to have an array of maps. In yrs, this looks very straightforward -- just create a MapPrelim and insert it into the array.

I can find no analog in yrb. I am curious if I'm missing something, or if this feature is not currently supported, is it planned? If not, I may take a crack at it if I have some spare time -- my intuition says that it shouldn't be too hard, but that could very wrong.

Finally, if I use a Y::Array of Hashs and wish to sync individual field updates, would you expect this to generally work well, and just be less efficient than if they were proper Y::Maps?

Thanks so much!

Hey,

those are all valid questions. I am currently not invested in developing yrb further, as there is no urgent need to extend it for any of my own projects, but I am always happy to help with contributions.

yrb is quite behind the most recent developments in yrs (yrb is basically just a wrapper around this rust lib), so it is possible that there are a bunch of features that are not working in yrb today. Historically, there were some limitations with simply mixing the various data-structures, so I think some of those restrictions might still be true. That said, there was and is pretty good support for nested JSON-like data in yrs (and therefore yrb), so some stuff might just work. You could try to take a look at the test cases, maybe you find some pattern there that would work for your use case.

I would love to see the yrs dep being bumped to the latest version, but there were some significant changes since I last checked. I am not saying this would result in a full rewrite of yrb, but there is definitely some work required to get it working.

@paholg
Copy link
Author

paholg commented Jan 7, 2025

Thanks for the quick reply!

It's unlikely that I'll be able to do much in the short-term, but updating yrb sounds like a fun project that I may be able to visit in the future.

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