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

enable templates read a property from a function #15482

Closed
wants to merge 2 commits into from

Conversation

bekzod
Copy link
Contributor

@bekzod bekzod commented Jul 9, 2017

issue: #14739
broken test: #14729

@locks locks self-assigned this Jul 9, 2017
@bekzod bekzod force-pushed the show-me-function branch 3 times, most recently from 8489fc6 to 10b0ddf Compare July 9, 2017 19:49
Copy link
Contributor

@krisselden krisselden left a comment

Choose a reason for hiding this comment

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

Needs a test. Also, was this a regression?

@@ -220,7 +220,7 @@ export class NestedPropertyReference extends PropertyReference {
return parentValue.length;
}

if (typeof parentValue === 'object' && parentValue) {
if ((typeof parentValue === 'object' || typeof parentValue === 'function') && parentValue) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Falsy check should have been !== null and it needs to stay together with the object check. Same with the following. Don't put the function check in between it's confusing it's either an object that isn't null or a function

@locks
Copy link
Contributor

locks commented Jul 14, 2017

@krisselden according to the original issue, this was working on 2.9.

@bekzod bekzod force-pushed the show-me-function branch 2 times, most recently from 8975738 to af58855 Compare July 14, 2017 11:46
@bekzod bekzod changed the title enable templates read a property from a function [BUGFIX release] enable templates read a property from a function Jul 18, 2017

this.assertStableRerender();

this.runTask(() => set(func, 'aProp', 'still a property on a function'));
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a new feature, the regression was rendering a prop on a function not using Ember.set() to update a prop on a function. https://ember-twiddle.com/c35628b179d00989b7469f84f1d08558?openFiles=controllers.application.js%2C I tried several versions of ember, props on functions were rendered as constant.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I don't think the watchKey and watchPath is needed for glimmer, just tagForProperty

Since this is a regression, it has to be back ported eventually to LTS, can you please separate out the set(func, 'aProp', ...) updating and the tagForProperty into a separate commit? I don't mind adding that capability, just don't want to do it casually in a bug fix for an LTS regression.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure will do


this.assertStableRerender();

this.runTask(() => set(func, 'aProp', 'still a property on a function'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I don't think the watchKey and watchPath is needed for glimmer, just tagForProperty

Since this is a regression, it has to be back ported eventually to LTS, can you please separate out the set(func, 'aProp', ...) updating and the tagForProperty into a separate commit? I don't mind adding that capability, just don't want to do it casually in a bug fix for an LTS regression.

@bekzod bekzod force-pushed the show-me-function branch 2 times, most recently from 49fb515 to 93f9648 Compare July 19, 2017 07:37
@krisselden
Copy link
Contributor

I updated this to be focused on just the functionality that regressed. https://github.com/emberjs/ember.js/compare/pr-15482

@bekzod bekzod changed the title [BUGFIX release] enable templates read a property from a function enable templates read a property from a function Jul 22, 2017
@bekzod bekzod force-pushed the show-me-function branch 2 times, most recently from ee67b02 to e915f22 Compare July 22, 2017 15:45
@locks
Copy link
Contributor

locks commented Aug 18, 2017

@bekzod can you resolve the conflict?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants