We’re still working on and discussing the future of updating the registry without have to reset completely. At the moment, new entries into the registry should be added, but existing data doesn’t get overridden.
This has to do with the fact that, we have 3 ways to add data to the registry.
- in a plugin, through register.js
- in reaction.json in private/settings
- modify the database / do it thought the UI if available
So then, which one of those would you expect to be the source of truth? Which one overrides the other, when you don’t know which one was updated last. This is a major point of confusion and frustration for new and veteran reaction developers.
How it works now, and why
At the moment the settings and data in the database is considered the truth for the App. While your app is running in production. Any
fixture data is to be assumed to be a one time deal to set up that app from a fresh install. Fixture data is not used as a source while the app is running, only the values stored in the database. You can consider the fixture data to be the defaults for your app when you do a clean install.
In development, the roles fell like they should to be reversed. While testing you app you may edit registry entries in the
register.json files to see changes in real time; however, since this data is loaded only once, you’ll never see the change reflected anywhere in the app or database. This forces you do do a full reset every time you make a simple change, which is very time consuming.
Add the ability to selectively or globally, reset to data from your fixture files. Keep backups of settings to allow for reverting broken setting updates. This way, you get the best of both worlds. The ability update your local fixture data files and have the changes overwrite your database if you choose to.
Heres a diagram depicting this: