From 50ba2671382a19618d26597a12b592a72403180e Mon Sep 17 00:00:00 2001 From: Vladimir Metnev Date: Tue, 5 Dec 2017 04:59:48 +0200 Subject: [PATCH] fix(client): log initial state fix(client): log initial state --- src/client/index.jsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/client/index.jsx b/src/client/index.jsx index b6079e7f..5cce2e9d 100644 --- a/src/client/index.jsx +++ b/src/client/index.jsx @@ -20,7 +20,7 @@ import 'semantic-ui-css/components/loader.css' import 'semantic-ui-css/components/reset.css' import 'semantic-ui-css/components/sidebar.css' import 'semantic-ui-css/components/site.css' -// Polyfills +// babel polyfill (ie 10-11) + fetch polyfill import 'babel-polyfill' import 'isomorphic-fetch' // Application @@ -29,19 +29,18 @@ import {hydrate} from 'react-dom' import {AsyncComponentProvider} from 'react-async-component' import asyncBootstrapper from 'react-async-bootstrapper' import {configureApp, configureRootComponent} from 'common/app' +import {AppContainer} from 'react-hot-loader' import type {GlobalState} from 'reducers' import type {i18nConfigObject} from 'types' if (process.env.NODE_ENV === 'production') { require('common/pwa') -} else if (process.env.NODE_ENV === 'development') { } const initialState: GlobalState = window.__INITIAL_STATE__ || {} const i18n: i18nConfigObject = window.__I18N__ || {} const asyncState: Object = window.__ASYNC_STATE__ || {} -// NOTE: V8 doesn't optimize `delete` -// delete window.__INITIAL_STATE__ + const {store, routes, history} = configureApp(initialState) const RootComponent = configureRootComponent({ store, @@ -51,12 +50,15 @@ const RootComponent = configureRootComponent({ }) const app = ( - - {RootComponent} - + + + {RootComponent} + + ) asyncBootstrapper(app).then(() => { + console.log('__INITIAL_STATE__:', initialState) hydrate(app, document.getElementById('app')) })