Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up[BUGFIX release-1-13] Ensure concatenatedProperties are not stomped. #12104
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Thanks for tracking this down, gents! |
stefanpenner
reviewed
Aug 14, 2015
View changes
packages/ember-views/lib/compat/attrs-proxy.js
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Updated with some tweaks suggested by @stefanpenner in chat. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@rwjblue Why |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rwjblue
Aug 14, 2015
Member
@stefanpenner explained it to me like this in chat:
Use dictionary for long lived dictionary's that will have many add / removes over time.
EmptyObject is like 10x faster than Object.create(null) (which is done by dictionary) and is better suited for this kind of thing because we aren't actually going to delete entries.
|
@stefanpenner explained it to me like this in chat: Use dictionary for long lived dictionary's that will have many add / removes over time. EmptyObject is like 10x faster than Object.create(null) (which is done by dictionary) and is better suited for this kind of thing because we aren't actually going to delete entries. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stefanpenner
Aug 14, 2015
Member
EmptyObject is like 10x faster than Object.create(null) (which is done by dictionary) and is better suited for this kind of thing because we aren't actually going to delete entries.
Dictionary is for things that will most likely be deleted from
dictionary could also use EmptyObject, but its also the deletion that makes it slow (although it would be less slow once moved to EmptyObject)
Dictionary is for things that will most likely be deleted from dictionary could also use EmptyObject, but its also the deletion that makes it slow (although it would be less slow once moved to EmptyObject) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rondale-sc
Aug 14, 2015
Contributor
|
|
added a commit
that referenced
this pull request
Aug 15, 2015
rwjblue
merged commit b53366a
into
emberjs:master
Aug 15, 2015
1 check passed
rwjblue
deleted the
rwjblue:fix-concatenated-properties
branch
Aug 15, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sukima
Aug 20, 2015
Contributor
Will this be part of a bug fix release on version 1.13? This is a show stopper as the expectation declared in the documentation is broken. Many people (including us) can not upgrade to 2.0 yet.
If not can we have a work around best practice to handle the broken behavior till we can upgrade to 2.0?
|
Will this be part of a bug fix release on version 1.13? This is a show stopper as the expectation declared in the documentation is broken. Many people (including us) can not upgrade to 2.0 yet. If not can we have a work around best practice to handle the broken behavior till we can upgrade to 2.0? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@sukima - Yes, we plan to release a 1.13.x version with this fix. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rondale-sc
Aug 20, 2015
Contributor
@sukima You can downgrade to 1.13.6 if you need immediate relief. If that is an option of course.
|
@sukima You can downgrade to 1.13.6 if you need immediate relief. If that is an option of course. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@rwjblue and @rondale-sc thank you! |
rwjblue commentedAug 14, 2015
When
_propagateAttrsToThisis invoked it iterates all properties that are present inthis.attrsand callsthis.set(attrName, attrValue). This is normally exactly what you expect. However, in the case ofconcatenatedPropertiesandmergedPropertiesthisseting 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, andactions). This was obviously a very naive check, and leaves any external usages ofconcatenatedPropertiesin components/views completely hosed.The changes here introduces a __avoidPropagating property that we can use to prevent
concatenatedPropertiesandmergedPropertiesfrom 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__avoidPropagatingon the constructor itself.One notable addon that has broken functionality is yapplabs/ember-modal-dialog#71.
Fixes #12099.
Implemented by @rondale-sc and @rwjblue.