How to prevent re-generating the whole bullets tree's DOM when indent a bullet

  • I am developing an outline note-taking tool base on ProseMirror, and I found that when I indent or outdent a bullet, ProseMirror’s view would re-generate the whole bullets tree’s DOM. This seems to be too heavy for just an indent/outdent operation, they are frequently used features, in addidtion, some of those bullets’ content take much more CPU resource, such as a bullet shows a searching result of bullets, or a bullet with a statistics component in it, etc.

  • So I would like to ask is there a safe way to prevent ProseMirror from re-generating the whole bullets tree’s DOM when indent it.

No, there isn’t a way to do this. Generally, unless you have ridiculously huge lists or very expensive node views in the list, re-rendering is unlikely to be very expensive. So if the costly part is your node views, maybe try to introduce some kind of caching in those.

thanks marijn. I will try to build a cache for that