Rather than calling `.extendSchema()`, have `.updateSchema()` return the new schema fragment
Open
Nobody has claimed this yet.
code quality
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 4.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
Rather than having to know about and call extendSchema.
AFRAME.registerComponent('example', {
updateSchema: (data) {
var newSchema;
if (data.type !== this.data.type) {
newSchema = getNewSchema(data.type);
this.extendSchema(newSchema);
}
}
});
Just return the new schema fragment. This will reduce the public API by a bit:
AFRAME.registerComponent('example', {
updateSchema: (data) {
var newSchema;
if (data.type !== this.data.type) {
return getNewSchema(data.type);
}
return null;
}
});
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 at the AFRAME.registerComponent lifecycle and inspect how updateSchema and extendSchema are currently used. Trace the handling of the value returned by updateSchema, including the no-change case. Done means updateSchema can return a new schema fragment without requiring callers to invoke extendSchema directly, while existing component behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100