3 ms·
> Consider using all config files as `app.config.js` , you can just return a JS object and done. It's kind of sad that you seem to think that JavaScript is the
by adwn 8y ago
> Consider using all config files as `app.config.js` , you can just return a JS object and done.
It's kind of sad that you seem to think that JavaScript is the only relevant language in existence.
- revskill 8y agoIt's because my projects are universal application, that's why Javascript. But JS is not the only choice. What i mean is, we want a programmable config file, not "static one"
- sly010 8y agoThis topic interests me. I am very interested to hear what the specific issues are with "non programmable" config files in your case. Generally I find that people often choose config languages because of syntax preference, where in reality they should be thinking if what they are trying to express is data or behavior? Ansible should have been just python. Yaml makes for an ugly programming language. Whereas python setup.py files should have been anything but python. It's a terrible source of metadata. There are cases of course where the distinction is not that obvious. Is your nginx config data or a program/behavior? How about your CI config?
- revskill 8y agoSome common use cases: - Compile config.js into config.json or config.yaml, use that config.js as an intermediate format to compile to real config. - Environment variables, or require 'other-module.js'
- giornogiovanna 8y agoYou've probably already seen this, but https://www.youtube.com/watch?v=0pX7-AG52BU https://www.youtube.com/watch?v=0pX7-AG52BU (a talk on configuration at Jane Street) goes over some of these issues at depth.