<commit_before>import React from 'react'
import {render} from 'react-dom'
// application styles
import 'styles/index.scss'
import 'semantic-ui-css/semantic.css'
// Redux
import {composeWithDevTools} from 'redux-devtools-extension'
import Perf from 'react-addons-perf'
import {routerMiddleware} from 'react-router-redux'
import {createStore, applyMiddleware} from 'redux'
import thunk from 'redux-thunk'

import {rootReducer} from './reducers'
import {Root} from 'components'
import {Routing, history} from './routing'
import config from 'config'

export const configureStore = (initialState) => {
    let middleware = applyMiddleware(routerMiddleware(history))
    let thunkApplied = applyMiddleware(thunk)

    if (process.env.NODE_ENV === 'development') {
        thunkApplied = composeWithDevTools(thunkApplied)
    }

    return createStore(rootReducer, thunkApplied, middleware, initialState)
}

export const configureRootComponent = (store) => {
    let propsRoot = {
        routes: Routing,
        history,
        store,
        key: Math.random()
    }

    return (<Root {...propsRoot}/>)
}


window.BASE_API = config.BASE_API

if (process.env.NODE_ENV === 'production') {
    require('./pwa')
} else if(process.env.NODE_ENV === 'development') {
    window.Perf = Perf
    // const {whyDidYouUpdate} = require('why-did-you-update')
    // whyDidYouUpdate(React)
}

const preloadedState = window.__PRELOADED_STATE__ || {}
delete window.__PRELOADED_STATE__

let store = configureStore(preloadedState)
let RootComponent = configureRootComponent(store)

render(RootComponent, document.getElementById('app'))

if (module.hot) {
    module.hot.accept()
}<commit_msg>uncomment why-did-you-update<commit_after>import React from 'react'
import {render} from 'react-dom'
// application styles
import 'styles/index.scss'
import 'semantic-ui-css/semantic.css'
// Redux
import {composeWithDevTools} from 'redux-devtools-extension'
import {whyDidYouUpdate} from 'why-did-you-update'
import Perf from 'react-addons-perf'
import {routerMiddleware} from 'react-router-redux'
import {createStore, applyMiddleware} from 'redux'
import thunk from 'redux-thunk'

import {rootReducer} from './reducers'
import {Root} from 'components'
import {Routing, history} from './routing'
import config from 'config'

export const configureStore = (initialState) => {
    let middleware = applyMiddleware(routerMiddleware(history))
    let thunkApplied = applyMiddleware(thunk)

    if (process.env.NODE_ENV === 'development') {
        thunkApplied = composeWithDevTools(thunkApplied)
    }

    return createStore(rootReducer, thunkApplied, middleware, initialState)
}

export const configureRootComponent = (store) => {
    let propsRoot = {
        routes: Routing,
        history,
        store,
        key: Math.random()
    }

    return (<Root {...propsRoot}/>)
}


window.BASE_API = config.BASE_API

if (process.env.NODE_ENV === 'production') {
    require('./pwa')
} else if(process.env.NODE_ENV === 'development') {
    window.Perf = Perf
    whyDidYouUpdate(React)
}

const preloadedState = window.__PRELOADED_STATE__ || {}
delete window.__PRELOADED_STATE__

let store = configureStore(preloadedState)
let RootComponent = configureRootComponent(store)

render(RootComponent, document.getElementById('app'))

if (module.hot) {
    module.hot.accept()
}
{'fraction_non_alphanumeric': 0.12320574162679426, 'fraction_numerical': 0.0, 'mean_word_length': 4.421393841166937, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2591118', 'n_tokens_mistral': 1047, 'n_tokens_neox': 1031, 'n_words': 240}