Attaching custom props to schema's spec

We used to have our own custom props added to the Schema’s spec (actually to all specs: nodes, marks, and the Schema.) for custom behavior or attributes that are needed per schema. E.g. we use it to define schema upgrade utils functions, define our custom menu-bar order rules per schema etc.

With the current model (release 1.18.2) it seems like the spec prop is hardcoded on Schema construction to keep just a subset of the incoming spec: the OrderedMap of the nodes and marks, and the topNode prop, but it drops any other props that might be a part of the schema’s spec given in the constructor. Is there a good reason why we don’t keep any additional attributes of the spec? Is there a better/more-correct place to store additional schema spec props?

This patch should help with that.

Thanks. Couple of questions:

  1. Shouldn’t the Schema.spec definition should insert [key: string]: any in line 524 to allow the extra keys?
  2. When will this patch be released?

I’ve tagged prosemirror-model 1.18.3. This isn’t really something that was an intended use, so I don’t really want to complicate the type for it.