Ember.js: Rendering aliases break when rendering a CP dependent on them

Created on 2 Dec 2016  ·  3Comments  ·  Source: emberjs/ember.js

Update: it doesn't have to do with yield, or attrs, it is just the order of rendering (ref consumption) and whether the CP is rendered (ref consumed). Updated fiddle: https://ember-twiddle.com/9f5a189ebe41a8191c1b280ce80592a1

Under Ember 2.10, when a component yields a property defined with computed.readOnly, under certain circumstances in production builds of Ember only, downstream usage are not updated when the property changes.

I worked with @krisselden to created an isolated reproduction of this issue:

https://ember-twiddle.com/868fbd21b0532d3dfa583ca43790dde7?openFiles=templates.application.hbs%2Ctemplates.components.consuming-comp.hbs

The reproduction demonstrates that the order that the attributes are passed into a consuming component determines which property fails to update. o_O

Bug Ember 2.10 Has Reproduction

Most helpful comment

@lukemelia this was fixed in 2.10.1 😄

All 3 comments

Kris' hypothesis in our discussion is that there is a race in how AliasProperty (which readOnly uses) adds its dependent key and the consumption of the property, and that something in the development build papers over the bug.

It seems to be that consuming the CP breaks rendering of the dependent keys if they are aliases https://ember-twiddle.com/9f5a189ebe41a8191c1b280ce80592a1

@lukemelia this was fixed in 2.10.1 😄

Was this page helpful?
0 / 5 - 0 ratings