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
Stabilize: load-from-file #62
Comments
I'd argue that ron (Rusty Object Notation) is a (subjectively) better, prettier choice! |
Thanks for the input. I am not so sure about ron. As the name suggests, I think it is meant to be intuitive for a rust programmer. But a rust programmer can create the animation from rust code. The use-case for having an asset file (as I understood it), was that it could be easier for non-programmers to edit the animation. And I think YAML is more common and intuitive for everybody, including non-programmers. But I take the feedback nevertheless. Maybe we can add support for ron on top of yaml, and let the user choose which format they want. |
@flipbit03 I just added But to be honest, In my own opinion, I think YAML is clearly superior, at least in this context. I am of course open to suggestions on how the Here is a quick comparison: Simple animationyaml3 lines, no parenthesis, no commas mode: Repeat
frame_duration: 100
frames: [0, 1, 2, 3, 4] ron5 lines, parenthesis, commas, more indentation and
More complex animationyaml8 lines, no commas, no parenthesis, no square brackets, only one level of indentation mode:
RepeatFrom: 1
frame_duration: 80
frames:
- index: 0
- index: 1
- index: 2
duration: 120 ron9 lines, commas, more parenthesis, square brackets, two indentation levels, and
|
I kinda of agree with your point. Although I don't think having both can hurt and that could enable more diversity. That is, unless the cost of implementing or maintaining this extra format becomes a hurdle. By the way, the "implicit_some" feature of Ron can make those Some()'s go away. Have a good one, and thank you for the reply/post/comparisons! |
@jcornaz I forgot to mention that for some people, editing the Ron's can be easier if they are RON is definitely a good candidate, specially if you are coming from a straight JSON world where everything needs "quoting" on the key side, and also no comments. I'm happy that we get to support both authoring styles 🙏 💯 |
The cargo feature
unstable-load-from-file
allows loading animation from YAML or RON files.Eventually, this should be stabilized. The present issue is there to track what needs to be considered/done before stabilizing the feature.
It is also open to gathering comments and thoughts about the current state of the API.
Tasks
load-from-file
gate)from_(yaml|ron)_(str|bytes)
.serde::Deserialize
is enough to let the user choose the format and library of their choice. Not to mention that most users would not use it directly anyway as they would use the asset loader instead.Open questions
.animation.(yaml|yml|ron)
a good choice?The text was updated successfully, but these errors were encountered: