Merge pull request #220 from weaveworks/reduce-build-warnings

Reduce build warnings
This commit is contained in:
David
2015-06-12 08:53:13 +02:00
5 changed files with 15 additions and 9 deletions

View File

@@ -1,6 +1,8 @@
const _ = require('lodash');
const d3 = require('d3');
const debug = require('debug')('nodes-chart');
const React = require('react');
const timely = require('timely');
const Edge = require('./edge');
const Naming = require('../constants/naming');
@@ -163,7 +165,7 @@ const NodesChart = React.createClass({
const target = nodes[edge[1]];
if (!source || !target) {
console.error('Missing edge node', edge[0], source, edge[1], target);
debug('Missing edge node', edge[0], source, edge[1], target);
}
edges[edgeId] = {
@@ -188,9 +190,8 @@ const NodesChart = React.createClass({
const n = _.size(props.nodes);
const nodeScale = d3.scale.linear().range([0, nodeSize / Math.pow(n, 0.7)]);
const layoutId = 'layered node chart';
console.time(layoutId);
const graph = NodesLayout.doLayout(
const timedLayouter = timely(NodesLayout.doLayout);
const graph = timedLayouter(
nodes,
edges,
props.width,
@@ -198,7 +199,8 @@ const NodesChart = React.createClass({
nodeScale,
MARGINS
);
console.timeEnd(layoutId);
debug('graph layout took ' + timedLayouter.time + 'ms');
// adjust layout based on viewport

View File

@@ -1,4 +1,5 @@
const dagre = require('dagre');
const debug = require('debug')('nodes-layout');
const _ = require('lodash');
const MAX_NODES = 100;
@@ -9,7 +10,7 @@ const doLayout = function(nodes, edges, width, height, scale, margins) {
const g = new dagre.graphlib.Graph({});
if (_.size(nodes) > MAX_NODES) {
console.error('Too many nodes for graph layout engine. Limit: ' + MAX_NODES);
debug('Too many nodes for graph layout engine. Limit: ' + MAX_NODES);
return null;
}

View File

@@ -1,6 +1,7 @@
const EventEmitter = require('events').EventEmitter;
const _ = require('lodash');
const assign = require('object-assign');
const debug = require('debug')('app-store');
const AppDispatcher = require('../dispatcher/app-dispatcher');
const ActionTypes = require('../constants/action-types');
@@ -179,7 +180,7 @@ AppStore.registeredCallback = function(payload) {
break;
case ActionTypes.RECEIVE_NODES_DELTA:
console.log('RECEIVE_NODES_DELTA',
debug('RECEIVE_NODES_DELTA',
'remove', _.size(payload.delta.remove),
'update', _.size(payload.delta.update),
'add', _.size(payload.delta.add));

View File

@@ -8,6 +8,7 @@
"dependencies": {
"d3": "^3.5.5",
"dagre": "^0.7.2",
"debug": "^2.2.0",
"flux": "^2.0.3",
"font-awesome": "^4.3.0",
"keymirror": "^0.1.1",
@@ -18,7 +19,8 @@
"react": "^0.13.3",
"react-tap-event-plugin": "^0.1.7",
"react-tween-state": "0.0.5",
"reqwest": "~1.1.5"
"reqwest": "~1.1.5",
"timely": "^0.1.0"
},
"devDependencies": {
"autoprefixer-core": "^5.2.0",

View File

@@ -116,7 +116,7 @@ var appConfig = _.merge({}, config, {
},
plugins: config.plugins.concat(DEBUG ? [] : [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}}),
new webpack.optimize.AggressiveMergingPlugin()
]
)