Nebo15 / confex

Useful helper to read and use application configuration from environment variables.
Other
304 stars 33 forks source link

RFC: Address compile/runtime issues in raised on Elixir Forum #29

Open AndrewDryga opened 6 years ago

AndrewDryga commented 6 years ago

Confex already provides you a way to have a compile-time config and delegate resolution of it's part to runtime. This delegation is already very explicit even though it has a downside - values with :system tuples can have interference with values set by other libraries.

So what are we trying to solve:

  1. Provide a way to separate compile and runtime configuration;
  2. It should be as simple as possible and require developers to minimize changes to adopt them. People should not look into multiple files to figure out where some variable came from;
  3. If it's not adopted, old way should keep working (probably issuing warnings);
  4. Releases (we should have them though, but it's a separate work).

What we should not solve here:

  1. Generalization of where runtime configuration lives (closer to code or in config files). Having it closer to code is always an option and if community thinks it's the way to go - it's more educational work rather than techical.

To further extend it:

This can be merged with some ideas from Jose RFC:

Some more points from discussion and my own experience:

Link to the discussion: https://elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302/73