Implicit property type change from string to object from 1.5.0 to 1.6.0
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 4.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
- A-Frame Version: 1.5.0 to 1.6.0
- Platform / Device: all
- Reproducible Code Snippet or URL:
Before 1.6 I could do
AFRAME.registerComponent('componentname', {
events: {
released: function (evt) {
console.log('This event was received!', evt);
console.log( this.el.getAttribute('componentname') );
}
}
});
but now in 1.6 I must do
AFRAME.registerComponent('componentname', {
schema: { type: 'string' },
events: {
released: function (evt) {
console.log('This event was received!', evt);
console.log( this.el.getAttribute('componentname') );
}
}
});
In 1.5 the output of e.g componentname="test" would be "test" but now it is {} unless the string type is forced via the schema.
Example https://glitch.com/edit/#!/aframe-16-implicit-component-type with output in the console.
This is not particularly a problem but it lead to unexpected behaviors for me. I briefly checked the change log and couldn't find it as a change. Is this expected? Documented?
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
Reproduce the 1.5.0 and 1.6.0 behavior using the provided Glitch example, focusing on registerComponent, schema handling, and getAttribute. The issue names no source file or test, so first locate the component registration and property parsing entry points. Done means determining whether the change is intentional and, if not, restoring the expected value or documenting the required schema behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100