       if @props.footer
         React.DOM.div {className: 'modal-footer'}, @props.footer
 
+initializationPromise = null
 AppComponent = React.createClass
   displayName: 'AppComponent'
   getInitialState: ->
+    initializationPromise.finally =>
+      @setState initializationState: initializationPromise.inspect()
     modal: null
+    initializationState: initializationPromise.inspect()
   mixins: [Router.Navigation]
   componentWillMount: ->
     modalModel.onValue (modals) =>

    appComponent = @

    modal = @state.modal
    if @props.bodyWrapper
      body = @props.bodyWrapper null, @props.activeRouteHandler()
    else
      body = @props.activeRouteHandler()
    React.DOM.div {className: 'lead'},
      React.DOM.div {className: 'nav-bar'},
        Router.Link {to: 'notebook', className: 'title'}, 'lead'

      Router.NotFoundRoute {handler: NotFoundComponent}

  # TODO handle errors, timeouts
  initializationPromise = Modules.init_modules(module_names)

  React.renderComponent routesComponent, target
  initializationPromise.done()

exports.raw_cell_url = (value) ->
  # TODO don't require appComponent
