mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
Replaced pure-render-mixin with redux connect
* does the same shallowEqual optimization
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import _ from 'lodash';
|
||||
import d3 from 'd3';
|
||||
import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { Motion, spring } from 'react-motion';
|
||||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
import reactMixin from 'react-mixin';
|
||||
import { Map as makeMap } from 'immutable';
|
||||
|
||||
import Edge from './edge';
|
||||
@@ -29,7 +28,7 @@ const buildPath = (points, layoutPrecision) => {
|
||||
return extracted;
|
||||
};
|
||||
|
||||
export default class EdgeContainer extends React.Component {
|
||||
class EdgeContainer extends React.Component {
|
||||
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
@@ -96,4 +95,4 @@ export default class EdgeContainer extends React.Component {
|
||||
|
||||
}
|
||||
|
||||
reactMixin.onClass(EdgeContainer, PureRenderMixin);
|
||||
export default connect()(EdgeContainer);
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import _ from 'lodash';
|
||||
import React from 'react';
|
||||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
import reactMixin from 'react-mixin';
|
||||
import { connect } from 'react-redux';
|
||||
import d3 from 'd3';
|
||||
import { Motion, spring } from 'react-motion';
|
||||
|
||||
import Node from './node';
|
||||
|
||||
export default class NodeContainer extends React.Component {
|
||||
class NodeContainer extends React.Component {
|
||||
render() {
|
||||
const { dx, dy, focused, layoutPrecision, zoomScale } = this.props;
|
||||
const animConfig = [80, 20]; // stiffness, damping
|
||||
@@ -30,4 +29,4 @@ export default class NodeContainer extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
reactMixin.onClass(NodeContainer, PureRenderMixin);
|
||||
export default connect()(NodeContainer);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import React from 'react';
|
||||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
import reactMixin from 'react-mixin';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import NodesChartEdges from './nodes-chart-edges';
|
||||
import NodesChartNodes from './nodes-chart-nodes';
|
||||
|
||||
export default class NodesChartElements extends React.Component {
|
||||
class NodesChartElements extends React.Component {
|
||||
render() {
|
||||
const props = this.props;
|
||||
return (
|
||||
@@ -20,4 +19,4 @@ export default class NodesChartElements extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
reactMixin.onClass(NodesChartElements, PureRenderMixin);
|
||||
export default connect()(NodesChartElements);
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import React from 'react';
|
||||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
import reactMixin from 'react-mixin';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import NodeDetails from './node-details';
|
||||
import { DETAILS_PANEL_WIDTH as WIDTH, DETAILS_PANEL_OFFSET as OFFSET,
|
||||
DETAILS_PANEL_MARGINS as MARGINS } from '../constants/styles';
|
||||
|
||||
export default class DetailsCard extends React.Component {
|
||||
class DetailsCard extends React.Component {
|
||||
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
@@ -54,4 +53,4 @@ export default class DetailsCard extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
reactMixin.onClass(DetailsCard, PureRenderMixin);
|
||||
export default connect()(DetailsCard);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import React from 'react';
|
||||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
import reactMixin from 'react-mixin';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
export default class ShowMore extends React.Component {
|
||||
class ShowMore extends React.Component {
|
||||
|
||||
constructor(props, context) {
|
||||
super(props, context);
|
||||
@@ -31,4 +30,4 @@ export default class ShowMore extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
reactMixin.onClass(ShowMore, PureRenderMixin);
|
||||
export default connect()(ShowMore);
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
"moment": "2.12.0",
|
||||
"page": "1.7.0",
|
||||
"react": "^15.0.1",
|
||||
"react-addons-pure-render-mixin": "^15.0.1",
|
||||
"react-dom": "^15.0.1",
|
||||
"react-mixin": "^3.0.3",
|
||||
"react-motion": "0.3.1",
|
||||
"react-redux": "4.4.5",
|
||||
"redux": "3.5.1",
|
||||
|
||||
Reference in New Issue
Block a user