import React from 'react';
import ReactDOM from 'react-dom';

import createStore from './shared/create';
import { render as renderDevtools } from './client/devtools';

// dependencies of external source. these resolve via webpack aliases
// as assigned in merge-configs.js
import middleware from 'middleware';
import createRootClientComponent from 'rootClientComponent';

const dest = document.getElementById('content');

const store = createStore(middleware, window.__data);
const devComponent = renderDevtools();

// There is probably no need to be asynchronous here
createRootClientComponent(store, __PROVIDERS__, { devComponent })
  .then((root) => {
    ReactDOM.render(root, dest);

    if (process.env.NODE_ENV !== 'production') {
      window.React = React; // enable debugger
      if (!dest || !dest.firstChild || !dest.firstChild.attributes || !dest.firstChild.attributes['data-react-checksum']) {
        console.warn('WARNING: Server-side React render was discarded. Make sure that your initial render does not contain any client-side code.');
      }
    }

    return devComponent ? createRootClientComponent(store, __PROVIDERS__, { devComponent }) : {};
  })
  .catch((err) => {
    console.error(err, err.stack);
  });

@@ -1067,107 +1067,8 @@
    %7D
-%0A%0A    return devComponent ? createRootClientComponent(store, __PROVIDERS__, %7B devComponent %7D) : %7B%7D;
 %0A  %7D

remove vestigial devComponent recreate