<commit_before>import React from 'react'
import { Router, browserHistory, applyRouterMiddleware } from 'react-router'
import useScroll from 'react-router-scroll/lib/useScroll'
import { syncHistoryWithStore } from 'react-router-redux'

import { Provider } from 'react-redux'
import getRoutes from 'core/app/routes'
import createStore from 'core/app/redux/createStore'

import { ApolloProvider } from 'react-apollo'
import createApolloClient from 'core/app/apollo/createApolloClient'
import { getNetworkInterface, authorizationMiddleware } from 'core/app/apollo/transport'

import config from 'core/config'

const networkInterface = getNetworkInterface(`http://${config.apiHost}:${config.apiPort}/graphql`, {})
networkInterface.use(authorizationMiddleware)

const client = createApolloClient({
  networkInterface,

  // skip force fetching fires too early during initialization, let's check the data in the cache first
  ssrForceFetchDelay: 100
})

// Rehydrate the client using the initial state passed from the server
const initialState = window.__APOLLO_STATE__
const store = createStore(client, initialState);
const routes = getRoutes(store)
const history = syncHistoryWithStore(browserHistory, store);

const Root = (props) => (
  <ApolloProvider store={store} client={client}>
    <Router
      {...props}
      history={history}
      routes={routes}
      render={applyRouterMiddleware(useScroll())}
    />
  </ApolloProvider><commit_msg>add more delay to leverage caching<commit_after>import React from 'react'
import { Router, browserHistory, applyRouterMiddleware } from 'react-router'
import useScroll from 'react-router-scroll/lib/useScroll'
import { syncHistoryWithStore } from 'react-router-redux'

import { Provider } from 'react-redux'
import getRoutes from 'core/app/routes'
import createStore from 'core/app/redux/createStore'

import { ApolloProvider } from 'react-apollo'
import createApolloClient from 'core/app/apollo/createApolloClient'
import { getNetworkInterface, authorizationMiddleware } from 'core/app/apollo/transport'

import config from 'core/config'

const networkInterface = getNetworkInterface(`http://${config.apiHost}:${config.apiPort}/graphql`, {})
networkInterface.use(authorizationMiddleware)

const client = createApolloClient({
  networkInterface,

  // skip force fetching fires too early during initialization, let's check the data in the cache first
  ssrForceFetchDelay: 500
})

// Rehydrate the client using the initial state passed from the server
const initialState = window.__APOLLO_STATE__
const store = createStore(client, initialState);
const routes = getRoutes(store)
const history = syncHistoryWithStore(browserHistory, store);

const Root = (props) => (
  <ApolloProvider store={store} client={client}>
    <Router
      {...props}
      history={history}
      routes={routes}
      render={applyRouterMiddleware(useScroll())}
    />
  </ApolloProvider>
{'fraction_non_alphanumeric': 0.10244070127191475, 'fraction_numerical': 0.002062564455139223, 'mean_word_length': 5.524663677130045, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '868798', 'n_tokens_mistral': 822, 'n_tokens_neox': 808, 'n_words': 224}