Move initTopNav to DOMContentLoaded
What does this MR do?
For the top nav redesign, the call to initTopNav
which bootstraps the top Menu dropdown was originally placed in deferredInitialisation
. Based on the title of the commit message which introduced this pattern, it's possible that initTopNav
should belong in the DOMContentLoaded
callback since it's a frequently used above-the-fold component.
Pros to moving this to DOMContentLoaded:
- It's no longer dependent on the critical path before it. In this MR it was identified that an unrelated JavaScript error could prevent the top nav from being loaded.
- It should be ready sooner.
- It is
async
so it shouldn't block anything else from loading.
Cons to moving this:
- It might kick off network requests/processes which could consume resources while the rest of
DOMContentLoaded
tries to load.
Screenshots (strongly suggested)
- To test, you'll want to enable the
:combined_menu
feature flag
Still works |
---|