knadh / koanf

Simple, extremely lightweight, extensible, configuration management library for Go. Support for JSON, TOML, YAML, env, command line, file, S3 etc. Alternative to viper.
MIT License
2.71k stars 150 forks source link

Viper updates #300

Open sagikazarmark opened 3 months ago

sagikazarmark commented 3 months ago

Hey there!

I know this library has been around for some time, but I wanted to reach out from the Viper "team" to congratulate you on it. It keeps me on my toes to keep improving Viper.

I also wanted to reach out about an upcoming release (currently in alpha) that may render some of the information incorrect in the comparison:

Significantly bloats build sizes.

v1.20.0 is going to drop a lot of dependencies from the core, so I expect this will significantly improve. Also, the comparison is a bit apples to oranges: Viper supports searching files, hence multiple parsers are included by default. I suspect after the update binary sizes will be somewhere on the same scale.

Tightly couples config parsing with file extensions.

v1.20.0 is going to introduce a new encoding layer. It still has a concept of "format", but that can be anything.

various parses are hardcoded in the core. There are no primitives that can be extended.

See the above comment: the encoding layer can be completely replaced now.

Pulls a large number of https://github.com/spf13/viper/issues/707 into the core package. For instance, even if you do not use YAML or flags, the dependencies are still pulled as a result of the coupling.

Although there are still a number of third-party dependencies, this will also significantly improve with v1.20.0.


All of the other points remain valid I'm actively working towards v2 to improve the situation on those fronts as well.