Ember.js: 3.5.0 rendering reggression

Created on 10 Oct 2018  路  4Comments  路  Source: emberjs/ember.js

Found a weird rendering engine regression in 3.5.0 release. The issue is that the DOM isn't updated properly on state change on the component.

I have this in my component's template.hbs:

{{#if isSubmitting}}
  <div class="spinner"></div>
{{/if}}

and in component.js:

isSubmitting: reads('model.isSubmitting')

isSubmitting goes from initial false value to true and to false again but in ember 3.5.0 the last state change isn't reflected in the DOM - the spinner stays visible. Here are two short videos proving the component has the correct state but there's a rendering issue in the 3.5.0 version:

The only difference between the two videos is that I've run:

yarn add [email protected]; 
ember deploy;

In the video, there's a v($0) function in the global scope that does this:

window.v = (el) => owner.lookup('-view-registry:main')[el.id];

... so I'm actually checking the state of that component instance.

Few things that might be relevant here:

  • the issue is only happening on production build
  • the component I'm talking about is rendered as a contextual component whereas model is a contextual property -> I'm suspecting this is pretty important
  • I've tried the 3.6.0-beta.1 build but it's completely broken, cannot even run the app
  • I have {"jquery-integration": false} in my optional-features.json
  • [email protected], [email protected], [email protected]

Anybody has an idea what might have happened in the last release?

Has Reproduction Needs Bug Verification

Most helpful comment

@rwjblue I've tracked it down. It has something to do with using {defineProperty} from '@ember/object' in production build. Here's a minimal repo reproducing the bug.

This is the output after clicking "boom" when I run it in development:

A: 1,2,3
B: 1,2,3

.. and after ember build --environment=production:

A: 1,2,3
B: 1,2

It works as expected in [email protected].

All 4 comments

Hmm, nothing jumps out at me here. Can you tell me more about your setup? What do the components look like (ts or js, decorators, etc)? Do you have any deprecations/assertions in the debug build? Might be hard to debug this without a reproduction that we can dig into (and creating a repro may help us identify what is wrong), would you mind trying to re-recreate the issue in a demo repo?

@rwjblue I've tracked it down. It has something to do with using {defineProperty} from '@ember/object' in production build. Here's a minimal repo reproducing the bug.

This is the output after clicking "boom" when I run it in development:

A: 1,2,3
B: 1,2,3

.. and after ember build --environment=production:

A: 1,2,3
B: 1,2

It works as expected in [email protected].

Is there any progress on this issue? This bug prevents us from upgrading to Ember 3.5.1.

I think this is a dup of #17243 and is fixed by #17487 (landed in 3.8 beta)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zidjian257 picture zidjian257  路  30Comments

MelSumner picture MelSumner  路  33Comments

wycats picture wycats  路  47Comments

Yelinz picture Yelinz  路  47Comments

rlivsey picture rlivsey  路  34Comments