Comments (2)
It turns out that Enum attributes require us to store the name of the Enum
that the EnumItem
we're referring to is a part of. This makes sense, in hindsight, but it means that supporting these is going to be potentially complex since we have to start tagging enums with their names in some capacity.
My thoughts are that we modify the Enum
type in rbx_types
to also hold an Option<String>
(or something akin to that) and then rbx_binary
and rbx_xml
(and other consumers) can fill that in if necessary. Then when serializing enums, we would raise an error if it didn't a name. It feels appropriately simple and doesn't require us to pull reflection info into anywhere new.
from rbx-dom.
Okay I have bad news: Serde's derive macro is not powerful enough to accomplish what I was hoping to above. This means we'll have to implement a potentially complex serializer and deserializer for Enums if we use the existing struct.
My main concern is that Rojo users rely upon the serde format for enums to be stable, so the easy solutions are out the window: if we represent Enum as a struct instead of a newtype, it breaks the serde format.
It's also possible I have massively overcomplicated things so I'm interested to hear others thoughts on it.
from rbx-dom.
Related Issues (20)
- rbx_reflector is inconsistent with storing default values for properties HOT 1
- rbx_reflector does not read Studio saving the default place file correctly sometimes
- Releases should be more automated HOT 1
- rbx_dom_lua should be a Wally package HOT 1
- Memory leak in SharedString HOT 10
- `TerrainMaterials` should implement `FromStr`
- Support for `SecurityCapabilities` tag in XML files HOT 1
- rbx-dom doesn't care about select properties important for correctness and least surprise HOT 7
- `Model.WorldPivotData` needs a custom property setter/getter HOT 2
- Failed to deserialize Configuration.AttributesSerialize HOT 1
- Property write failure warning should include the instance's full name
- Humanoid instances should be serialized last in files
- Serve still incorrectly changes WorldPivotData HOT 1
- Defining the Archivable property on an instance causes binary serializer to write false for Archivable properties on all other instances of the same class HOT 4
- `WriteUnknown` behavior in rbx_xml does not respect serialization of known properties
- Small Inconsistency with float & double in Attributes encoding HOT 2
- Documenting the CollisionGroupData property format
- `PhysicalProperties` fail to deserialize in non-human-readable format
- `Model.WorldPivotData` does not need a custom setter/getter and should instead alias to `Model.WorldPivot`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rbx-dom.