Skip to content

Conversation

@ngokevin
Copy link
Member

Description:

Split from #3108. For performance and reducing bug potential from force refreshing all components when a state or mixin is added/removed. And to reduce API surface and favor more predictable APIs.

Changes proposed:

  • Remove state mixins.
  • Update tracked-controls to not use state mixins for toggling colors. I use event-set here, open to other ways (e.g., vanilla JS) to perhaps not have a dependency in the examples.

this.states.splice(stateIndex, 1);
this.mapStateMixins(state, bind(this.unregisterMixin, this));
this.emit('stateremoved', {state: state});
this.emit('stateremoved', state);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional? I assumed we want to discuss recommendations for an alternative state API outside of this PR, so breaking changes to the current API don't seem immediately useful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can save an object in case the API does stick around for a version or further even if an application is not using it. It's not looking like there'll be consensus resulting in removing this API at the moment.

@donmccurdy
Copy link
Member

One comment, otherwise LGTM

@dmarcos dmarcos merged commit a80d9c2 into aframevr:master Oct 16, 2017
ngokevin added a commit to chenzlabs/aframe that referenced this pull request Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants