aframevr / aframevr/aframe

Implicit property type change from string to object from 1.5.0 to 1.6.0

Open
#5,541 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.