Force plugins to run once

I have a couple situations where I’d like to force all existing plugins to run once, just like they would when the document state is changed.

One situation is on the initial document load. My spell check plugin doesn’t mark misspelled words until plugins get to run, so the document initially appears to have no misspelled words, but they just haven’t been checked yet.

Another instance involves menus, similar to the ones used in the footnote example. When embedded content in the editor loads asynchronously it shifts the document, but this is not a state change so the menus stay where they were initially positioned.

My workaround has been to track when these events complete and then add an empty paragraph to the end of the document, then remove it with an existing plugin, but I was wondering if there was a simpler way to force all the plugins to run. I have a vague memory from using ProseMirror a few years ago when I updated the time attribute on the state, but I don’t see how to do that in the docs.


That should just be the initial state creation. Why doesn’t running the necessary logic in the plugin state init function or the view plugin constructor work?