<commit_before>import React from 'react'
// Redux stuff
import thunk from 'redux-thunk'
import {createStore, applyMiddleware, compose} from 'redux'
import {routerMiddleware} from 'react-router-redux'
// Application
import rootReducer from 'reducers'
import {Root} from 'components'
import {Routing, history} from 'routing'

/**
 * Configure application store with middlewares.
 * @param  {Object} initialState - preloadedState
 * @return {Object} - configured store
 */
export const configureStore = initialState => {
  let thunkApplied = applyMiddleware(thunk)
  let routerMiddlewareApplied = applyMiddleware(routerMiddleware(history))
  let enhancers

  if (process.env.NODE_ENV === 'development') {
    // FIXME: remove duplication
    const {composeWithDevTools} = require('redux-devtools-extension')
    enhancers = composeWithDevTools(thunkApplied, routerMiddlewareApplied)
  } else {
    enhancers = compose(thunkApplied, routerMiddlewareApplied)
  }

  return createStore(rootReducer, initialState, enhancers)
}
export const configureRootComponent = store => {
  const propsRoot = {
    routes: Routing,
    history,
    store
  }

  return <Root {...propsRoot} />
}
<commit_msg>fix(src/common/index): fix configuration of Root component in SSR<commit_after>import React from 'react'
// Redux stuff
import thunk from 'redux-thunk'
import {createStore, applyMiddleware, compose} from 'redux'
import {routerMiddleware} from 'react-router-redux'
// Application
import rootReducer from 'reducers'
import {Root} from 'components'
import {Routing, history} from 'routing'

/**
 * Configure application store with middlewares.
 * @param  {Object} initialState - preloadedState
 * @return {Object} - configured store
 */
export const configureStore = initialState => {
  const thunkApplied = applyMiddleware(thunk)
  const routerMiddlewareApplied = applyMiddleware(routerMiddleware(history))
  let enhancers

  if (process.env.NODE_ENV === 'development') {
    // FIXME: remove duplication
    const {composeWithDevTools} = require('redux-devtools-extension')
    enhancers = composeWithDevTools(thunkApplied, routerMiddlewareApplied)
  } else {
    enhancers = compose(thunkApplied, routerMiddlewareApplied)
  }

  return createStore(rootReducer, initialState, enhancers)
}
/* eslint-disable */
export const configureRootComponent = ({store, SSR}) => {
  // stupid eslint thinks that if function returns JSX, than it's a component
  // "Eslint, I don't want a component, I want a function!"
  const propsRoot = {
    routes: Routing,
    history,
    store,
    SSR
  }

  return <Root {...propsRoot} />
}
/* eslint-enable */

{'fraction_non_alphanumeric': 0.10468214693566806, 'fraction_numerical': 0.0, 'mean_word_length': 4.639484978540772, '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': '3584391', 'n_tokens_mistral': 773, 'n_tokens_neox': 758, 'n_words': 217}