New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discuss: env var replacement in any config file #536
Comments
custom-environment-variables has usefulness in mapping environment variables to configs, and is a different concern from the issue of those mappings being static or dynamic. Can anyone explain why we should add templating to .json files when the functionality has been there in .js since day one? -Loren blah,blah: I think it opens unnecessary complexity. Once you add it to custom-environment-variables, someone is 100% sure to want it in other .json files. Then the discussion of your favorite templating format, with opinions from the Ruby and Java worlds. Maybe the format should be configurable? How about nested templating? Hey - let's add templating methods - looping, math, regex's. Sheesh - just use .js already. |
@lorenwest In that case what about completely removing env var support? |
Good question. The practical answer is that people are using it. Like anything - once you add it, it's very hard to remove. |
@lorenwest I don't get your arguments. Just choose one standard of templating and stick to it. Current IMHO According to:
Just remove it and release it as a next major version which is not backwards-compatible. That's what semantic versioning is for. |
Agreed. The I'm in favor of this change, and would recommend rolling it out in two major releases. The first release announces any usage as deprecated, and removing it in the following release. I would want at least a year (maybe two) of deprecation warnings before removing the functionality because it requires work to change from one mechanism to the other. |
@lorenwest That sounds reasonable! 😃 |
I'm not in favor of change. I think Also, removing |
@markstos But environment variables isolation is the main problem here. Why would you look for a file particular for environment variables? You rather look for a file with a specific environment configuration. Having Actually seeing how many overrides there are in |
The value of the I agree with @sarneeh that there are too many built-in file path overrides. I'd be in favor of reducing the number of built-in overrides, replacing it with the more powerful but not often used feature of using multiple values for As to the |
This is a continuation of discussion that originated in #535.
Currently, env var replacement is only allowed in
custom-environment-variables.*
.Sectioning off env var replacement to this file seems obtuse, and it's not clear what the benefits are.
I think most people using config for the first time would expect to be able to use env vars in any config file, like support was added for by the following downstream project:
https://docs.feathersjs.com/api/configuration.html
So, can anyone think of or explain the benefits of limiting env var replacement to
custom-environment-variables.*
? If not, I think it would more intuitive to replace env vars in any config.Of course, there is always the "nuclear" option of using
*.js
, but if that's the recommendation the benefit ofcustom-environment-variables.*
becomes unclear.The text was updated successfully, but these errors were encountered: