-
Notifications
You must be signed in to change notification settings - Fork 0
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
Switch to using js files for configuration rather than json #4
Comments
@fresheneesz how would this look? Would it be a JS file that could be loaded like a module and contained the configuration? What do you have in mind? This is definitely an interesting proposal. |
Yeah exactly. Something like this:
I don't have insight into how often JSON files are used in NodeOS in general - looks like maybe PalmTree itself doesn't care whether your config is in a JSON file or otherwise, but I think raw js files as configuration would be good to advocate for the project as a whole. |
@fresheneesz sounds like a cool idea! @piranna what do you think on the matter? Would this be a simple alteration? |
Sorry for radio silence, too much busy with work during last months and for the coming. In short: possible? yes, probably is already available since we are using |
How so? Isn't it just an extra
json5 looks great, but I still don't understand why pure JS is a bad choice for basic static config files. |
@fresheneesz The only assumption that I can make is that JSON can be parsed more efficiently than JS. If you would like comments, we can look into implementing json5? |
@lite20 Thanks for the thought, but parsing efficiency is not going to be a concern with config files. But sure, why not add in json5 if you're gonna use json. |
Sorry for the radio silence, during last months I have been very busy with several simultaneous jobs and no spare time. In fact, I'm writting this on the train going to PortAventura park a free weekend as late summer holidays.
KISS principle. If/when the need arises you can opt-in to use Javascript-based config files, nobody is preventing that, but by default, we'll only support stateless JSON config files. If you need more advanced features, use the project as a dependency and directly use its API. |
Static formats like XML and JSON will inevitably introduce complexity in other tools. JSON isn't composable (you can't import parts of your configuration from somewhere else). JSON doesn't have comments. JSON can't take advantage of symmetry in your configuration file. Read this: https://arp242.net/weblog/json_as_configuration_files-_please_dont
NodeOS is based around javascript. Why not just use pure javascript as your configuration files?
The text was updated successfully, but these errors were encountered: