aframevr / aframevr/aframe

Mixins included in selector/selectorAll schema property type results

Open
#3,264 4 comments 1 reaction 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:

I've been caught by this before, and I've had it come up for super-hands users (wmurphyrd/aframe-super-hands-component#116, possibly also wmurphyrd/aframe-super-hands-component#60).

Mixins can be returned from the query selection performed with the selector type schema properties, and any code expecting an entity and trying to call entity methods will cause errors. Attribute selectors can be particularly likely to cause this issue (but they are incredibly useful in A-Frame to select by component).

If there aren't any use cases where receiving mixins in the result is an expected behavior, then perhaps adding a step to filter mixins (or modifying the selector to exclude mixins) before passing the result on to the component could save a lot of head scratching.

If you're interested, I could prepare a PR

  • A-Frame Version: all
  • Platform / Device: all

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

Trace the selector and selectorAll schema-property query path, focusing on attribute selectors and how mixins enter the results. Reproduce the behavior with a mixin and an entity, then verify that the component receives entities without breaking valid selector results.

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.