aframevr / aframevr/aframe

Change in typed array behavior when setting component properties

Open
#3,479 4 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

A typed array is no longer passed correctly to a component when setting a property in version 0.8.

In version 0.7 for schema: { vert: {type: 'array', default: []} }

console.log(this.data.vert) resulted in:

Float32Array [ 0.058115072548389435, 1.987938124548116e-20, ...

if the incoming array was a typed array. In version 0.8 this same sequence results in :

Object [ 0.058115072548389435, 1.987938124548116e-20, ...

Will this be the default behavior going forward? Passing in typed arrays made the creation of buffer geometry more convenient.

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

Start by reproducing the component property assignment described for A-Frame 0.7 and 0.8, using the schema with vert typed as an array. Compare the resulting Float32Array and Object values, then determine the intended behavior before proposing a change; the issue does not name a source file or test, and no completion criteria are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.