I’m implementing a select node in ProseMirror that allows users to pick from an array of items, but I’m unsure where this array should be stored. Each approach seems to have trade-offs:
- Node attributes: Every select node would need to update its attribute whenever the array changes, which feels inefficient.
- Plugin state: From my understanding, this would lose undo/redo functionality.
- Document attributes: Not sure if this is the right place for such data.
- External store (e.g., Zustand): The concern here is that ProseMirror’s plugin state should ideally represent the entire document state for full reproducibility, which wouldn’t be the case if some data lives outside.
What’s the best approach in terms of integration with ProseMirror’s architecture? Any insights would be greatly appreciated!