-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Feature: support for a static register method #5572
Description
At #4030 @acywatson incorporated an experimental static method called transform. In his words:
The fix I'm proposing here is to introduce a method to nodes that allows them to declare a transform on themselves, rather than registering it through the register API. This allows us to keep this logic encapsulated at the node level, rather than moving it to the plugin, and it should otherwise function the same.
Which has led me to think... Why not do the same with the other registersX functions?
A register method could be used that works just like the mergeRegister function in React.
This could eliminate the need for some plugins tightly tied to a particular node, such as ImagePlugin or TablePlugin. It would also not be necessary to check within the plugin if said node is registered or throw an error if not.
related: #2739