Eliminate single-property schemas.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 4.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
Supporting both single and multi prop schemas have made it so most A-Frame internal-related codepaths (and stuff like Inspector, aframe-react) need to branch and check to support both, often causing bugs.
Also causes API breakages when a component decides to go from single to multi prop.
We can eliminate single-prop schemas.
To support components such as visible or perhaps position, we can perhaps have components specify a designated "default property". Where if only a plain value is passed into setAttribute (e.g., true), it will set the designated property.
registerComponent('visible', {
schema: {
visible: {default: true, primary: true}
}
});
// setAttribute('visible', true);
// equivalent to setAttribute('visible', 'visible', true);
registerComponent('position', {
schema: {
position: {type: 'vec3', primary: true}
}
});
// setAttribute('position', '0 0 1');
// equivalent to setAttribute('visible', 'position', '0 0 1');
// or we can split to X / Y / Z...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the registerComponent schema handling and the setAttribute paths described in the issue, including consumers such as Inspector and aframe-react. Determine how single- and multi-property schemas currently branch, then define the intended primary-property behavior and compatibility requirements before implementation. Done means the schema model no longer needs separate single-property handling while the proposed plain-value usage remains supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100