closes: COREFE-385
Most pages use this and keeping it as its own chunk was causes webpack
to split out a lot of things (like @instructure/ui-view) into their
own chunks where it would be really more efficient to load them in
the main bundle once
By lazy-loading the actual tray contents, we don’t add that much
size to the main js bundle
and by only doing require.include(…) we don’t actually execute this
on pages that Don’t `js_bundle :navigation_header` like the login screen
Also by only running the jsx for stuff inside the tray if the tray
is open we can speed up the render functions
Test plan:
* the global nav should work the same as before
* simulate a “slow 3g connection”,
* click the “account”, “profile”, “help”, “courses” global nav buttons:
* you should see a spinner as each
of the global nav trays open while it is loading the JS for that tray
Change-Id: I0640668a61ba7c21669f2e43daf4873d5b0ac1b0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/214719
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>