Velocity icon indicating copy to clipboard operation
Velocity copied to clipboard

Use YAML for Velocity config

Open jacoballen1 opened this issue 4 years ago • 9 comments

Note: This issue is VERY early, and any code snippets shown are hypothetical, subject to change, and aren't guaranteed to work without other code modification (where applicable).

As the title states, this issue proposes the use of YAML over HOCON as the transition to completely use Configurate begins. While many may prefer the use of HOCON over the use of YAML, HOCON is currently limited on how sorting is done (by hashcode (thanks zml)). I believe that it is critical we maintain the order of config options to ease confusion on server admin/owner(s) and keep the same clean appearance that we are all used to.

I have experimented with both options, links to each are below, and believe that YAML is the best option on the market at the time of writing. With that being said, there is always the possibility of advancements in HOCON that will allow us to control the order of the config. Along with this, I do plan on writing an example converter for converting the TOML to YAML if necessary.

YAML HOCON

(comments are currently missing, but can be added as progression is made) YAML Config HOCON Config

jacoballen1 avatar Jan 20 '21 05:01 jacoballen1

Rather than a straight conversion of the existing TOML to YAML, I propose going with a setup like this as it fits in better with my goals for Velocity 2.0.0.

astei avatar Apr 23 '21 23:04 astei

Looks good, I only did a straight conversion for POC. however, what does “pc” stand for in this case? I see it is referenced in the type and later on in the file

jacoballen1 avatar Apr 23 '21 23:04 jacoballen1

"pc" stands for Java Edition.

astei avatar Apr 23 '21 23:04 astei

I understand that's a proof-of-concept, but for a proper implementation, Java Edition should probably be referenced as java-edition and Bedrock Edition as bedrock-edition. Bedrock has a PC implementation now, so calling the Java setting pc is more likely to confuse a few folks out there.

Camotoy avatar Apr 24 '21 02:04 Camotoy

@Camotoy Great idea. I may submit a PR for this (given tux hasn't already started working on it) and have that in mind.

jacoballen1 avatar Apr 24 '21 23:04 jacoballen1

@astei I was going through converting the config and happened to notice you didn't include the 'try' list in this iteration. Is this intentional or a mistake?

jacoballen1 avatar May 09 '21 01:05 jacoballen1

It's a mistake, but I want to revisit the try list and forced host configuration anyway.

astei avatar May 09 '21 01:05 astei

Why should someone switch from a very good config format like TOML to a bad config format like YAML? It is just a bad decision. Please keep TOML, it is so much better.

leytilera avatar Oct 08 '21 21:10 leytilera

TOML offers more simplicity than YAML but I don't see it being a big deal or making any difference here in particular.

If there is a noticeable benefit from changing it then I agree it should be changed but otherwise don't fix something that isn't broken?

Strahilchu avatar Nov 25 '21 15:11 Strahilchu