On gadget definition pages, the default settings currently get saved to the page. Even if the editor removes them from the JSON, they get re-added via a pre-save hook.
This is problematic for a couple of reasons:
- A number of optional settings have been added in last year or so (supportsUrlLoad, datas, actions, requiresES6). There are other live patches to add targets and namespaces. This doesn't scale. No other kind of JSON configuration file requires all keys to be present in the JSON – if a key is missing it should implicitly take the default value.
- When a new setting is added, it gets reflected in the page text the next time someone edits the page - creating misleading diffs.
- Although this should be very rare, when a default value is changed, the change does not affect any existing gadgets, only the new ones.
IMO we should stop adding the default settings via pre-save hook, unless explicitly entered by the user.