From 9d09ec73cb9494db3de62fb49651f1420cf23c92 Mon Sep 17 00:00:00 2001 From: Ben Lowery Date: Tue, 7 Mar 2017 15:37:23 -0500 Subject: [PATCH] Build: Async Load Happy Chat, CSS Reload, Network detection (take 2) This reverts commit 10088690b64fe17c1f65f4e29f10ab833c79482a. --- client/boot/index.js | 4 ++-- client/layout/index.jsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/boot/index.js b/client/boot/index.js index 0a67855932d5e..62ebe30f6cf42 100644 --- a/client/boot/index.js +++ b/client/boot/index.js @@ -203,11 +203,11 @@ function reduxStoreReady( reduxStore ) { } if ( config.isEnabled( 'network-connection' ) ) { - require( 'lib/network-connection' ).init( reduxStore ); + asyncRequire( 'lib/network-connection', netConn => netConn.init( reduxStore ) ); } if ( config.isEnabled( 'css-hot-reload' ) ) { - require( 'lib/css-hot-reload' )(); + asyncRequire( 'lib/css-hot-reload', cssHotReload => cssHotReload() ); } // Render Layout only for non-isomorphic sections. diff --git a/client/layout/index.jsx b/client/layout/index.jsx index 7f118a87844ca..263183b01c1d0 100644 --- a/client/layout/index.jsx +++ b/client/layout/index.jsx @@ -10,7 +10,8 @@ var React = require( 'react' ), /** * Internal dependencies */ -var MasterbarLoggedIn = require( 'layout/masterbar/logged-in' ), +var AsyncLoad = require( 'components/async-load' ), + MasterbarLoggedIn = require( 'layout/masterbar/logged-in' ), MasterbarLoggedOut = require( 'layout/masterbar/logged-out' ), observe = require( 'lib/mixins/data-observe' ), GlobalNotices = require( 'components/global-notices' ), @@ -29,8 +30,7 @@ var MasterbarLoggedIn = require( 'layout/masterbar/logged-in' ), QueryPreferences = require( 'components/data/query-preferences' ), KeyboardShortcutsMenu, Layout, - SupportUser, - Happychat = require( 'components/happychat' ); + SupportUser; import { isOffline } from 'state/application/selectors'; import { hasSidebar } from 'state/ui/selectors'; @@ -171,7 +171,7 @@ Layout = React.createClass( { isEnabled={ translator.isEnabled() } isActive={ translator.isActivated() }/> { this.renderPreview() } - { config.isEnabled( 'happychat' ) && this.props.chatIsOpen && } + { config.isEnabled( 'happychat' ) && this.props.chatIsOpen && } ); }