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

[BUGFIX release] Fix classNames clobbering issue with AttrProxy. #12073

Merged
merged 1 commit into from
Aug 13, 2015

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 13, 2015

Specifying classNames as a hash argument was previously stomping the concatenated property on the already created view when processing attrs in the AttrsProxy.

This PR prevents us from stomping on any concatenatedProperties or mergedProperties while propagating attrs to this.


Fixes #12008
Fixes #12039
Fixes #12044
Fixes #12047
Fixes #12063

Specifying `classNames` as a hash argument was previously stomping the
concatenated property on the already created view when processing
`attrs` in the `AttrsProxy`.

This PR prevents us from stomping on any `concatenatedProperties` or
`mergedProperties` while propagating `attrs` to `this`.
@mixonic
Copy link
Sponsor Member

mixonic commented Aug 13, 2015

kicked sauce

rwjblue added a commit that referenced this pull request Aug 13, 2015
[BUGFIX release] Fix classNames clobbering issue with AttrProxy.
@rwjblue rwjblue merged commit e7b807c into emberjs:master Aug 13, 2015
@rwjblue rwjblue deleted the fix-classNames branch August 13, 2015 02:56
@perlun
Copy link

perlun commented Aug 13, 2015

Good stuff @rwjblue, thanks!

rwjblue added a commit to rwjblue/ember.js that referenced this pull request Aug 14, 2015
When `_propagateAttrsToThis` is invoked it iterates all properties that
are present in `this.attrs` and calls `this.set(attrName, attrValue)`.
This is normally exactly what you expect. However, in the case of
`concatenatedProperties` and `mergedProperties` this `set`ing causes the
concatenated / merged property to be completely clobbered.

The fix introduced in emberjs#12073 adds a very simple work around for the
internally known items (just hard coding things like `classNames`,
`classNameBindings`, `attributeBindings`, and `actions`). This was
obviously a very naive check, and leaves any external usages of
`concatenatedProperties` in components/views completely hosed.

---

The changes here introduces a __avoidPropagating property that we can
use to prevent `concatenatedProperties` and `mergedProperties` from
being set inside `_propagateAttrsToThis`. To avoid introducing this cost
for every component created (when only classes can define new
concatenated / merged properties) we are storing the
`__avoidPropagating` on the constructor itself.
rwjblue added a commit that referenced this pull request Aug 24, 2015
When `_propagateAttrsToThis` is invoked it iterates all properties that
are present in `this.attrs` and calls `this.set(attrName, attrValue)`.
This is normally exactly what you expect. However, in the case of
`concatenatedProperties` and `mergedProperties` this `set`ing causes the
concatenated / merged property to be completely clobbered.

The fix introduced in #12073 adds a very simple work around for the
internally known items (just hard coding things like `classNames`,
`classNameBindings`, `attributeBindings`, and `actions`). This was
obviously a very naive check, and leaves any external usages of
`concatenatedProperties` in components/views completely hosed.

---

The changes here introduces a __avoidPropagating property that we can
use to prevent `concatenatedProperties` and `mergedProperties` from
being set inside `_propagateAttrsToThis`. To avoid introducing this cost
for every component created (when only classes can define new
concatenated / merged properties) we are storing the
`__avoidPropagating` on the constructor itself.

(cherry picked from commit 98d7cf3)
rwjblue added a commit that referenced this pull request Aug 24, 2015
When `_propagateAttrsToThis` is invoked it iterates all properties that
are present in `this.attrs` and calls `this.set(attrName, attrValue)`.
This is normally exactly what you expect. However, in the case of
`concatenatedProperties` and `mergedProperties` this `set`ing causes the
concatenated / merged property to be completely clobbered.

The fix introduced in #12073 adds a very simple work around for the
internally known items (just hard coding things like `classNames`,
`classNameBindings`, `attributeBindings`, and `actions`). This was
obviously a very naive check, and leaves any external usages of
`concatenatedProperties` in components/views completely hosed.

---

The changes here introduces a __avoidPropagating property that we can
use to prevent `concatenatedProperties` and `mergedProperties` from
being set inside `_propagateAttrsToThis`. To avoid introducing this cost
for every component created (when only classes can define new
concatenated / merged properties) we are storing the
`__avoidPropagating` on the constructor itself.

(cherry picked from commit 98d7cf3)
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.

3 participants