I've taken a shot at updating Hoplite with prefix support. There is more to do on this PR (like tests), but I wanted to get some early feedback on this general approach.
This still loads everything once per prefix (and outputs multiple reports), but I think that is fine for this iteration, and we can consider a "load once and extract prefixes multiple times" improvement in a subsequent PR.
Also, I did not implement this as a Preprocessoras in this post because I don't want the dependency on the prefix to exist at ConfigLoaderBuilder time, but only at load time. This should make it easier to later just do the loading once, instead of once per prefix.
@sksamuel Good catch -- I don't think I had understood the code properly when I made those changes. I've pushed a new version of the branch that does not change PropertySourceLoader at all. And also:
I've taken a shot at updating Hoplite with prefix support. There is more to do on this PR (like tests), but I wanted to get some early feedback on this general approach.
This still loads everything once per prefix (and outputs multiple reports), but I think that is fine for this iteration, and we can consider a "load once and extract prefixes multiple times" improvement in a subsequent PR.
Also, I did not implement this as a
Preprocessor
as in this post because I don't want the dependency on the prefix to exist atConfigLoaderBuilder
time, but only at load time. This should make it easier to later just do the loading once, instead of once per prefix.This would resolve https://github.com/sksamuel/hoplite/issues/386.