-
-
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
cleanup how component id
attr is set
#16561
Conversation
} | ||
|
||
if (seen.indexOf('id') === -1) { | ||
operations.setAttribute('id', PrimitiveReference.create(component.elementId), true, null); |
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.
id
was being set differently than when attributeBindings
doesn't exist https://github.com/emberjs/ember.js/pull/16561/files#diff-1d6263d5fa618e89a735e9df0fe95f81L327
4280e9f
to
bbc29ca
Compare
@@ -73,27 +73,26 @@ function applyAttributeBindings( | |||
component: Component, | |||
operations: ElementOperations | |||
) { | |||
let seen: string[] = []; | |||
let seen: Set<String> = new Set(); |
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.
I doubt Set to be actually faster for less than < 10 attributes and most elements don't have that many.
We should definitely try to test this.
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.
such thought crossed my mind too, so reverting this changes :P
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.
Can you add a test and label as a bugfix? I'm not sure what you are fixing here.
id
attr is setid
attr is set
id
attr is setid
attr is set
not fixing here anything just avoiding calling |
The changes here seem good, but I did want to point out that |
there is asymmetry how
id
attributes are set, this fixes it