Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ember 2.9-beta2] Missing render revalidation in production build #14298

Closed
kanongil opened this issue Sep 15, 2016 · 9 comments
Closed

[Ember 2.9-beta2] Missing render revalidation in production build #14298

kanongil opened this issue Sep 15, 2016 · 9 comments

Comments

@kanongil
Copy link
Contributor

I tried to update my app to v2.9.0-beta2 in which I encountered a rendering regression, where some of my UI failed to update after an initial render, deferring it until another part of the UI needed revalidation.

While I did expect some corner cases to have issues, I did not expect it to only appear when using the production builds, as this does!

I have spent some time to isolate the cause, and I ended up with this code on top of a brand new ember init project:

app/templates/application.hbs

Value: {{value}}

app/controllers/application.js

import Ember from 'ember';

export default Ember.Controller.extend({
    object: Ember.Object.create({ value: 'fail' }),
    value: Ember.computed.readOnly('object.value'),

    init() {
        this._super(...arguments);
        Ember.run.later(() => {
            this.set('object.value', 'ok');
        }, 200);
    },
});
  • Rendered value using debug build: ok.
  • Rendered value using production build: fail.

Notes:

  • If I render {{object.value}} instead, it renders correctly in both cases.
  • this.get('value') always gets the correct value.
  • I have tried to replicate this in a jsbin, but it always renders correctly, even using the minified builds.
  • This also fails on the latest canary build.
@rwjblue
Copy link
Member

rwjblue commented Sep 15, 2016

Thank you for the detailed error report! Would you mind creating a repo with a test that passes with ember test and fails with ember test --environment=production? That would make it much easier for others to jump in and help debug...

@kanongil
Copy link
Contributor Author

Yes, here you go: https://github.com/kanongil/render-fail

@rwjblue
Copy link
Member

rwjblue commented Sep 15, 2016

Awesome, thank you!

rwjblue added a commit that referenced this issue Sep 20, 2016
[BUGFIX beta] Fixes #14298 rendering aliased paths
rwjblue pushed a commit that referenced this issue Sep 20, 2016
When dirtying an object, other objects with aliases
that path through this object should dirty as well.

(cherry picked from commit 1cb8975)
@ToMoCoop
Copy link

ToMoCoop commented Sep 21, 2016

@rwjblue @kanongil I have a feeling that the removal/move of:

 AliasedProperty.prototype.willWatch = function (obj, keyName) {        
 -    _emberMetalDependent_keys.addDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj));        
 -  };      
 -      
 -  AliasedProperty.prototype.didUnwatch = function (obj, keyName) {        
 -    _emberMetalDependent_keys.removeDependentKeys(this, obj, keyName, _emberMetalMeta.meta(obj));     
 -  };

has caused some issues.

Our bower upgraded automatically from a working v2.9.0-beta.2 to v2.9.0-beta.3,, and a src binding against an image tag stopped working. I'd love to create some re-create some steps here, but it's an enormous app and hard to dig out, but basically switching back to beta2 in bower solves the issue.

Seen as this is largely the only change in the bower shim for beta3 (components/ember@1721af7), I think this may cause issues.

I can't be of more help atm, but something to look out for, should others start reporting issues with bindings, specifically image src bindings.

@ToMoCoop
Copy link

That said, this also may be that we're still on -beta2 in npm though too, so this may throw it.

@rwjblue
Copy link
Member

rwjblue commented Sep 21, 2016

There is a separate issue open for img src issues (I don't think it's related to this change).

@ToMoCoop
Copy link

@rwjblue Ok, can you point me to it?

@rwjblue
Copy link
Member

rwjblue commented Sep 21, 2016

#14323

@ToMoCoop
Copy link

Perfect, thanks!

webark pushed a commit to webark/ember.js that referenced this issue Oct 6, 2016
When dirtying an object, other objects with aliases
that path through this object should dirty as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants