-
-
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
[BUGFIX release] Rerender link on routing state change. #11561
Conversation
can you add a failing test? I want to be sure i understand the actual issue (in code-form) this aims to work around. |
Where are the tests for the link component? Can't seem to find them. |
I don't know off the top of my head, but maybe they dont exist in isolation. |
0_o there are integration tests here: and some more unitish tests here: |
Thanks @mixonic. Here you go for the test. Failing on master but passing here. |
Can you explain why the href computed dep key was not enough to update the href when the route changes? I am sure there is more internal detail that you tracked down when making this patch, so I'm hoping you can walk me through the 'why'... |
There is a special case for query-params only link-tos as you can see here https://github.com/juggy/ember.js/blob/query-params-links/packages/ember-routing-views/lib/views/link.js#L452-L463 As you can see, the targetRouteName changes every time the route changes. The problem here is that the willRender is not called, because this change happens even if the attrs of the LinkComponent do not change (which would trigger a rerender). Another solution to the problem would be to move this special case to the href computed property. That would remove the observer. |
1cce287
to
a8301e0
Compare
Test link-to with only query params provided
a8301e0
to
e189688
Compare
Removed the observer, moved the onlyQueryParamsSupplied logic to the href. |
this appears much more reasonable :) Still needs someone else to review. |
Looks good to me, can you prefix with |
[BUGFIX release] Rerender link on routing state change.
Properly update the route when the routing current state change. This primarily deals with query-params only routes as noted in issue #11533 .