-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Description
Description:
Advantages:
- Single-property components are inflexible in that you cannot add a new property to the schema without having it be a breaking change. I was looking at Alphatest addition #2297, and I couldn't add a new prop without a breaking change.
- Less confusing having to guess if a component is single-property or multi-property, for example, is it
hand-controls="hand: left"orhand-controls="left"(some controllers are single-prop, some are multi)? Is itgltf-model="src: #model"orgltf-model="#model"(some loaders are single-prop, some are multi). It's been inconsistent so I've seen people make mistakes including myself - Less documentation about schemas in the component API (https://aframe.io/docs/0.5.0/core/component.html#single-property-schema is a bit awkward to explain)
- Reduced API surface/branching in the component API (e.g., if you do this, then it's single prop, if you specify this, it's multi prop)
- Can delete a lot of code where we check isSingleProp in a lot of places in the core component code
If we do this, then we'd need to introduce a default property for cases such as position, rotation, scale that designates if the component value is used in single-prop mode:
schema: {
position: {type: 'vec3', default: true}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels