Add the ability to "remove" plugin data

Right now, it seems like the only way to “clear” plugin data on a node is to set it to an empty string. This works fine for standalone nodes, but for instance or instance children, we lose the ability to inherit plugin data from the main component. It would be really helpful if we had an API like:

node.removePluginData("myField");

That would remove plugin data so that we could inherit from the main component

1 Like

@Blair1 What do you want to achieve? Currently you are not able to clear plugin data on instance node itself as it awlays inherits from the main component. To clear plugin data on instance node, you would have to clear the relevant field on main component.

I’m looking to clear the data on the instance so that it inherits from the main component. For example, if I had a setup like this:

component.getPluginData("colorToken"); // returns "blue"
instance.getPluginData("colorToken");  // returns "red"

I would want to “clear” the data on instance so that I get the following:

component.getPluginData("colorToken"); // returns "blue"
instance.getPluginData("colorToken");  // returns "blue" (inherited from component)

Right now, the only thing I seem to be able to do is set the field to an empty string, which doesn’t preserve inheritence:

component.getPluginData("colorToken"); // returns "blue"
instance.getPluginData("colorToken");  // returns ""

As far as I can test, It should preserve inheritence when you set the filed to an empty string on instance.