Conversation
|
Are there some tests that can now be ran in both Glimmer and HTMLBars? |
|
@chadhietala Currently there aren't any in |
2aa209f to
55905e4
Compare
|
Looks good, will merge when we have a test in place |
55905e4 to
aa3aa94
Compare
|
I ported most of the existing element action tests. There are a few tests that I stubbed out and marked with |
aa3aa94 to
277e8ee
Compare
There was a problem hiding this comment.
I don't think testing of {{action 'foo' on='change'}} is an implementation detail. Changing the event that is listened to is public API that should be tested.
There was a problem hiding this comment.
I guess what I'm getting at here is the original test for this intercepts/inspects the slots inside of ActionManager.registeredActions. I think a better way to test this would be to set up an action for several events, test each one, and assert that it fires for the respective event.
|
I left a bunch of comments, but this is looking really good. I a bit confused about the way multiple actions are stored, why do we need multiple attributes on the element? |
|
@rwjblue The reason action data attributes are stored across multiple attributes in Glimmer is because they are assigned at render and we want to avoid reading attributes at render time. In HTMLBars the data attribute is read via |
|
As far as I understand it (haven't dug in too much):
In the existing HTMLBars case, we have the potential of using a single DOM operation whereas with this implementation for Glimmer we will always have two DOM operations. In the worst case with HTMLBars today, there are still only 2 operations. The primary difference between the two being that there is a Are we saying that two sets is better than a get and a set (and ignoring the somewhat unusual case of multiple action handlers being more optimized)? |
|
@rwjblue My understanding from the reading of this code ( ) is that agetAttribute and a setAttribute will always take place, per action.
The approach I took for the Glimmer implementation is make the operation write-only -- it never performs a |
You are correct, thank you for clarifying that!
Right, this is the heart of my question. If the operations are the same, why jump through extra hoops just to avoid reading from the DOM. I kinda assume that there is something fundamental that I am missing... |
277e8ee to
1a5d156
Compare
|
Yep, no problem. My comments RE avoiding the getAttribute first were most curiousity. I'll try to do another round of review tonight or tomorrow morning.... |
|
☔ The latest upstream changes (presumably dde51f6) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@zackthehuman can you rebase? also the just use master's package.json, when you rebase master is 'ours' |
Port existing element actions code into Glimmer.
1a5d156 to
bad93ea
Compare
|
@rwjblue did you have any outstanding concerns or can I merge this? |
Port existing element actions code into Glimmer.