As a part of the work for hot-reload, we refactored the RuntimeConfigProvider such that it no longer was responsible for maintaining the state of the RuntimeConfig and no longer creates the file watcher or calls the functions for hot-reloads. Instead, the RuntimeConfigLoader holds the RuntimeConfig, does the instantiation of any file watchers, and maintains the hot-reload function.
However, as the RuntimeConfigProvider was previously responsible for holding the state of the RuntimeConfig, it was also responsible for mutating the RuntimeConfig that was acquired from the parse and load functions of the RuntimeConfigLoader. This leaves certain areas in the code where the RuntimeConfigProvider is modifying the RuntimeConfig, in particular when we call initialize in order to setup the RuntimeConfig in a Hosted scenario. Because of this, the RuntimeConfig that the RuntimeConfigLoader has is set to public accessibility.
We should change this to be private, which will require all of the code that modifies the RuntimeConfig outside of the RuntimeConfigLoader to be moved into the loader, so that no other classes have the ability to modify the RuntimeConfig.
As a part of the work for hot-reload, we refactored the
RuntimeConfigProvider
such that it no longer was responsible for maintaining the state of theRuntimeConfig
and no longer creates the file watcher or calls the functions for hot-reloads. Instead, theRuntimeConfigLoader
holds theRuntimeConfig
, does the instantiation of any file watchers, and maintains the hot-reload function.However, as the RuntimeConfigProvider was previously responsible for holding the state of the
RuntimeConfig
, it was also responsible for mutating theRuntimeConfig
that was acquired from the parse and load functions of theRuntimeConfigLoader
. This leaves certain areas in the code where theRuntimeConfigProvider
is modifying theRuntimeConfig
, in particular when we call initialize in order to setup theRuntimeConfig
in a Hosted scenario. Because of this, theRuntimeConfig
that theRuntimeConfigLoader
has is set to public accessibility.We should change this to be private, which will require all of the code that modifies the
RuntimeConfig
outside of theRuntimeConfigLoader
to be moved into the loader, so that no other classes have the ability to modify theRuntimeConfig
.