Breaking up deeply nested step objects


#1

Thanks so much for all your work on ProseMirror!

We use Firebase to implement a collaborative ProseMirror editor by writing and storing individual steps. Firebase has a technical limitation that objects cannot be nested more than 32 levels deep. This becomes a problem when we want to (for example) store a step that represents pasting in a 6-level deep ordered list.

I was wondering if anyone had bumped into this before or had advice on best path forward.

We could flatten/unflatten nested objects on write/read - but this feels intensive and it would be painful to migrate all of our existing step data.

Is there any clever way to split up a step into smaller (less deeply nested) pieces?

Any suggestions would be welcome. Thanks!


#2

No, that’s not something you can do. If you’re dealing with a crappy tool like this, serializing your data as doubly json-encoded strings seems like the best approach.