Adding a method for overriding Node/TextNode

Currently, there doesn’t appear to be any reasonable way to change which class is used for Node and TextNode without forking the editor repos and modifying them. This is useful to modify toJSON and fromJSON for example, or to add default attributes to everything in your schema that would otherwise be very repetitive (such as data-block-id, data-last-changed, etc). As an example for a hack day we modified the TextNode to encrypt and decrypt its contents as it was [de]serialized.

Is there a suggested way to change the behaviours of Node and TextNode? Something like a nodeClass to the NodeSpec which when present changes the node constructor for nodes of that type?

(Apologies for any duplicate spaces or letters, broken macbook keyboard)

No, this is simply not something the library supports. (Neither is changing the JSON format—you’ll want to use your own separate function to serialize to other formats.)

Adding repetitive attributes can be done by generating your schema spec programatically, I don’t see how extending Node helps with that.