Code Monkey home page Code Monkey logo

Comments (3)

extremeheat avatar extremeheat commented on June 3, 2024

If it's a burden in the future, the exit plan is simple, we can just delete the yaml.

Couple of problems I wanted to solve with the new format:

  • make it more condensed (less whitespace) for easier scrolling and readability
  • make it easier to write and maintain - minus the comments, the protocol.json is about 7k loc vs 2.5k for the yaml
  • add comments (one of most important imo)
  • make it easy to generate docs and type definitions (this should bring more meaning)
  • we can extend later on if needed

The yml isn't really designed for others to parse, it's designed to be turned to JSON before being used anywhere, npx protodef-yaml input.yml output.json. Like a file for a preprocessor instead of a compiler. We don't need to put the yaml in mc-data as the intended users are humans. For updating the code we can ask people to use the generator here, the only problem I had was was how (or if) to deal with older versions.

As it currently stands I think the yml files are simple enough to read and write and I use them as protocol documentation also. So hopefully it's not too big of a burden, but we can wait and see how adoption goes.

For this project, being able to quickly comment things out and back in in the yml makes it alot easier to debug as there's not really a good wiki.vg for bedrock.

Especially for big packets, having things like or statements is a nice feature, part of why people usually just write up the protocol in code:
https://github.com/PrismarineJS/bedrock-protocol/blob/master/data/latest/types.yaml#L444
https://github.com/PrismarineJS/bedrock-protocol/blob/master/data/1.16.201/protocol.json#L1163

from bedrock-protocol.

rom1504 avatar rom1504 commented on June 3, 2024

ok, I think it adds some complexity I'm not sure we can't afford, but I can see your points. Let's keep it for now and revisit in the future

from bedrock-protocol.

rom1504 avatar rom1504 commented on June 3, 2024

Let's close this for now

from bedrock-protocol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.