Clean up and smaller bundle.js

This commit is contained in:
Jori Lallo
2016-06-05 14:38:14 -07:00
parent 2a84d1fc67
commit 6303bc9279
7 changed files with 5 additions and 26 deletions

View File

@@ -96,11 +96,6 @@
"react-router": "^2.0.0",
"react-router-redux": "^4.0.4",
"rebass": "^0.2.6",
"redux": "^3.3.1",
"redux-actions": "^0.9.1",
"redux-logger": "^2.6.1",
"redux-persist": "3.0.3",
"redux-thunk": "^2.0.1",
"safestart": "^0.8.0",
"sass-loader": "^3.2.0",
"sequelize": "^3.21.0",

View File

@@ -1,7 +1,6 @@
import React from 'react';
import { observer } from 'mobx-react';
import moment from 'moment';
import marked from 'marked';
import { Link } from 'react-router';
import PublishingInfo from 'components/PublishingInfo';

View File

@@ -4,12 +4,7 @@ import { Provider } from 'react-redux';
import Router from 'react-router/lib/Router';
import Route from 'react-router/lib/Route';
import IndexRoute from 'react-router/lib/IndexRoute';
import { createStore, applyMiddleware } from 'redux';
import { routerMiddleware } from 'react-router-redux';
import thunkMiddleware from 'redux-thunk';
import createLogger from 'redux-logger';
import History from 'utils/History';
import DevTools from 'mobx-react-devtools';
import userStore from 'stores/UserStore';
@@ -22,13 +17,14 @@ import 'assets/styles/codemirror.css';
import Application from 'scenes/Application';
import Home from 'scenes/Home';
import Editor from 'scenes/Editor';
import Dashboard from 'scenes/Dashboard';
import Atlas from 'scenes/Atlas';
import DocumentScene from 'scenes/DocumentScene';
import DocumentEdit from 'scenes/DocumentEdit';
import SlackAuth from 'scenes/SlackAuth';
import DevTools from 'mobx-react-devtools';
function requireAuth(nextState, replace) {
if (!userStore.authenticated) {
replace({
@@ -46,7 +42,6 @@ render((
<Route path="/dashboard" component={ Dashboard } onEnter={ requireAuth } />
<Route path="/atlas/:id" component={ Atlas } onEnter={ requireAuth } />
<Route path="/atlas/:id/new" component={ Editor } onEnter={ requireAuth } />
<Route path="/documents/:id" component={ DocumentScene } onEnter={ requireAuth } />
<Route path="/documents/:id/edit" component={ DocumentEdit } onEnter={ requireAuth } />

View File

@@ -25,7 +25,6 @@ class DocumentEdit extends Component {
EditorLoader()
.then(({ Editor }) => {
console.log("loaded", Editor);
this.setState({ Editor });
});
}

View File

@@ -1,7 +1,6 @@
import { observable, action, computed, autorun } from 'mobx';
import { client } from 'utils/ApiClient';
import localforage from 'localforage';
import { convertToMarkdown } from 'utils/markdown';
import { browserHistory } from 'react-router'
const DOCUMENT_EDIT_SETTINGS = 'DOCUMENT_EDIT_SETTINGS';
@@ -24,15 +23,6 @@ const documentEditState = new class DocumentEditState {
@observable isFetching;
@observable isSaving;
/* Computed */
@computed get htmlPreview() {
// Only compute if preview is active
if (this.preview) {
return convertToMarkdown(this.text);
}
}
/* Actions */
@action fetchDocument = async () => {

View File

@@ -1,5 +1,6 @@
import React from 'react';
import { observer } from 'mobx-react';
import { convertToMarkdown } from 'utils/markdown';
import MarkdownEditor from 'components/MarkdownEditor';
import Preview from './Preview';
@@ -27,7 +28,7 @@ const Editor = observer((props) => {
<EditorPane
scrollTop={ props.scrollTop }
>
<Preview html={ store.htmlPreview } />
<Preview html={ store.text } />
</EditorPane>
) : null }
</div>

View File

@@ -9,7 +9,7 @@ const cx = classNames.bind(styles);
const Preview = (props) => {
return (
<div className={ styles.preview }>
<DocumentHtml html={ props.html } />
<DocumentHtml html={ props.html } />
</div>
);
};