-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Conversation
8489fc6
to
10b0ddf
Compare
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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
@krisselden according to the original issue, this was working on 2.9. |
8975738
to
af58855
Compare
|
||
this.assertStableRerender(); | ||
|
||
this.runTask(() => set(func, 'aProp', 'still a property on a function')); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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')); |
There was a problem hiding this comment.
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.
49fb515
to
93f9648
Compare
I updated this to be focused on just the functionality that regressed. https://github.com/emberjs/ember.js/compare/pr-15482 |
ee67b02
to
e915f22
Compare
@bekzod can you resolve the conflict? |
e915f22
to
326dc3d
Compare
326dc3d
to
a1ee4ab
Compare
issue: #14739
broken test: #14729