Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is my attempt at refactoring this addon so that it is fully compatible with FastBoot. While the addon does now play nicely with fastboot after moving
buildChildLinkView
to thedidInsertElement
hook (which is not executed on the server), it did not give us full rendering parity between the server and client. This results in a bit of an undesirable side effect where the link wrappers initially render in the browser as not active, and then the active state "pops in" once the client-side ember app loads and takes over.To solve this, instead of relying on jQuery or the DOM in general being available to query for matching link elements, I refactored this into 2 co-dependent components
active-link
(which is the link itself now, and merely extendsEmber.LinkComponent
), andactive-link-container
(which is the wrapper<li>
element). The childactive-link
components now walk up the component tree looking for ancestoractive-link-container
components that they register themselves to, which is how thechildLinkViews
array is built.