<commit_before>import React, { Component } from 'react'
import { AppContainer } from 'react-hot-loader'
import { Provider } from 'react-redux'
import { BrowserRouter as Router, Match, Miss } from 'react-router'

// Store and Routes
import { store } from 'utilities/store'

// Views
// import Home from 'views/home'

// console.log(require('./views/home'));

const Home = () => {
	const home = require('./views/home')
	return (<div>hi <home /></div>)
}
// const Home = Promise.resolve(require('./views/home'))
// const Home = () => require.ensure([], (require) => require('./views/home'))

export default class Root extends Component {
	render() { return (
		<AppContainer>
			<Provider store={store}>
				<Router>
					<div>
						<Match exactly pattern="/" render={Home} />
						{/*<Miss component="">*/}
					</div><commit_msg>Updated Root to function w/ client-side async routes<commit_after>import React, { PureComponent } from 'react'
import { AppContainer } from 'react-hot-loader'
import { Provider } from 'react-redux'
import { BrowserRouter as Router, Match, Miss } from 'react-router'

// Store and Routes
import { store } from 'utilities/store'

export default class Root extends PureComponent {
	constructor() {
		super()

		this.views = {}
		this.viewReady = new Set()

		this.loadView = fileName => {
			if (this.viewReady.has(fileName)) {
				this.viewReady.delete(fileName)
				return this.views[fileName]
			}

			new Promise(resolve => require.ensure([], () => {
				resolve(require(`./views/${fileName}`))
			}))
			.then(View => this.views[fileName] = <View />)
			.then(() => this.viewReady.add(fileName))
			.then(() => this.forceUpdate())

			return <div />
		}
	}

	render() { return (
		<AppContainer>
			<Provider store={store}>
				<Router>
					<div>
						<Match exactly pattern="/" component={this.loadView.bind(this, 'home')} />
						<Match exactly pattern="/about" component={this.loadView.bind(this, 'about')} />
						<Miss component={this.loadView.bind(this, '404')} />
					</div>
{'fraction_non_alphanumeric': 0.1759167492566898, 'fraction_numerical': 0.0014866204162537165, 'mean_word_length': 3.567873303167421, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 32, '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': '2710739', 'n_tokens_mistral': 714, 'n_tokens_neox': 622, 'n_words': 158}