From 43c96f13bd8db77a12e3660b62168ad3659c3240 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Sun, 13 Sep 2015 00:38:58 +0100 Subject: [PATCH] [react14] remove import of addons Conflicts: src/flat-button.jsx --- docs/src/app/components/pages/components/menus.jsx | 3 +-- docs/src/app/components/pages/components/text-fields.jsx | 8 ++++++-- examples/browserify-gulp-example/src/app/app.jsx | 2 +- examples/webpack-example/src/app/app.jsx | 2 +- icon-builder/tpl/SvgIcon.js | 4 ++-- src/avatar.jsx | 2 +- src/buttons/flat-button-label.jsx | 2 +- src/dialog.jsx | 4 ++-- src/enhanced-button.jsx | 4 ++-- src/lists/list-divider.jsx | 2 +- src/lists/list-item.jsx | 4 ++-- src/lists/list.jsx | 4 ++-- src/menus/icon-menu.jsx | 4 ++-- src/menus/menu-divider.jsx | 2 +- src/menus/menu-item.jsx | 4 ++-- src/menus/menu.jsx | 4 ++-- src/mixins/controllable.js | 2 +- src/paper.jsx | 4 ++-- src/ripples/circle-ripple.jsx | 4 ++-- src/ripples/focus-ripple.jsx | 6 +++--- src/ripples/touch-ripple.jsx | 6 +++--- src/tabs/tabs.jsx | 2 +- src/transition-groups/scale-in-child.jsx | 4 ++-- src/transition-groups/scale-in.jsx | 6 +++--- src/transition-groups/slide-in-child.jsx | 2 +- src/transition-groups/slide-in.jsx | 4 ++-- src/utils/children.js | 4 ++-- src/utils/immutability-helper.js | 3 +-- test/checkbox-spec.js | 5 ++--- test/mixin-context-pure-spec.js | 6 +++--- 30 files changed, 57 insertions(+), 56 deletions(-) diff --git a/docs/src/app/components/pages/components/menus.jsx b/docs/src/app/components/pages/components/menus.jsx index 30c95c42690b1e..1b6cf5a61bbb83 100644 --- a/docs/src/app/components/pages/components/menus.jsx +++ b/docs/src/app/components/pages/components/menus.jsx @@ -1,5 +1,4 @@ -let React = require('react/addons'); -let ReactTransitionGroup = React.addons.TransitionGroup; +let React = require('react'); let Menu = require('menus/menu'); let MenuItem = require('menus/menu-item'); let MenuDivider = require('menus/menu-divider'); diff --git a/docs/src/app/components/pages/components/text-fields.jsx b/docs/src/app/components/pages/components/text-fields.jsx index ee163b1fee3782..e7abbd461d219f 100644 --- a/docs/src/app/components/pages/components/text-fields.jsx +++ b/docs/src/app/components/pages/components/text-fields.jsx @@ -1,4 +1,5 @@ -let React = require('react/addons'); +let React = require('react'); +const LinkedStateMixin = require('react/lib/LinkedStateMixin'); let { ClearFix, Mixins, SelectField, TextField, Styles } = require('material-ui'); let ComponentDoc = require('../../component-doc'); let { Colors } = Styles; @@ -8,7 +9,10 @@ let CodeExample = require('../../code-example/code-example'); let TextFieldsPage = React.createClass({ - mixins: [StyleResizable, React.addons.LinkedStateMixin], + mixins: [ + StyleResizable, + LinkedStateMixin, + ], getInitialState() { return { diff --git a/examples/browserify-gulp-example/src/app/app.jsx b/examples/browserify-gulp-example/src/app/app.jsx index 2a13276e192902..c49662e269db55 100644 --- a/examples/browserify-gulp-example/src/app/app.jsx +++ b/examples/browserify-gulp-example/src/app/app.jsx @@ -1,5 +1,5 @@ (function () { - let React = require('react/addons'); + const React = require('react'); let injectTapEventPlugin = require('react-tap-event-plugin'); let Main = require('./components/main.jsx'); // Our custom react component diff --git a/examples/webpack-example/src/app/app.jsx b/examples/webpack-example/src/app/app.jsx index 2a13276e192902..c49662e269db55 100644 --- a/examples/webpack-example/src/app/app.jsx +++ b/examples/webpack-example/src/app/app.jsx @@ -1,5 +1,5 @@ (function () { - let React = require('react/addons'); + const React = require('react'); let injectTapEventPlugin = require('react-tap-event-plugin'); let Main = require('./components/main.jsx'); // Our custom react component diff --git a/icon-builder/tpl/SvgIcon.js b/icon-builder/tpl/SvgIcon.js index 78311f39d91b81..d6635a32f54794 100644 --- a/icon-builder/tpl/SvgIcon.js +++ b/icon-builder/tpl/SvgIcon.js @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); const SvgIcon = {{{ muiRequireStmt }}}; const {{className}} = React.createClass({ diff --git a/src/avatar.jsx b/src/avatar.jsx index 9ff730642e5dfc..0cecb0d8b15e47 100644 --- a/src/avatar.jsx +++ b/src/avatar.jsx @@ -1,4 +1,4 @@ -const React = require('react/addons'); +const React = require('react'); const StylePropable = require('./mixins/style-propable'); const Colors = require('./styles/colors'); const DefaultRawTheme = require('./styles/raw-themes/light-raw-theme'); diff --git a/src/buttons/flat-button-label.jsx b/src/buttons/flat-button-label.jsx index 41160ddf7ca97a..f25a5419c004b5 100644 --- a/src/buttons/flat-button-label.jsx +++ b/src/buttons/flat-button-label.jsx @@ -1,4 +1,4 @@ -const React = require('react/addons'); +const React = require('react'); const ContextPure = require('../mixins/context-pure'); const Styles = require('../utils/styles'); const DefaultRawTheme = require('../styles/raw-themes/light-raw-theme'); diff --git a/src/dialog.jsx b/src/dialog.jsx index d389bd7abe0cac..764808dddb94d0 100644 --- a/src/dialog.jsx +++ b/src/dialog.jsx @@ -1,4 +1,4 @@ -const React = require('react/addons'); +const React = require('react'); const WindowListenable = require('./mixins/window-listenable'); const CssEvent = require('./utils/css-event'); const KeyCode = require('./utils/key-code'); @@ -10,7 +10,7 @@ const Paper = require('./paper'); const DefaultRawTheme = require('./styles/raw-themes/light-raw-theme'); const ThemeManager = require('./styles/theme-manager'); -const ReactTransitionGroup = React.addons.TransitionGroup; +const ReactTransitionGroup = require('react/lib/ReactTransitionGroup'); const TransitionItem = React.createClass({ mixins: [StylePropable], diff --git a/src/enhanced-button.jsx b/src/enhanced-button.jsx index a21b1f7a8e89da..6acc70dad7eb34 100644 --- a/src/enhanced-button.jsx +++ b/src/enhanced-button.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); const StylePropable = require('./mixins/style-propable'); const Colors = require('./styles/colors'); const Children = require('./utils/children'); diff --git a/src/lists/list-divider.jsx b/src/lists/list-divider.jsx index 73f39d844a9a50..4a1f74b16047ff 100644 --- a/src/lists/list-divider.jsx +++ b/src/lists/list-divider.jsx @@ -1,4 +1,4 @@ -const React = require('react/addons'); +const React = require('react'); const StylePropable = require('../mixins/style-propable'); const DefaultRawTheme = require('../styles/raw-themes/light-raw-theme'); const ThemeManager = require('../styles/theme-manager'); diff --git a/src/lists/list-item.jsx b/src/lists/list-item.jsx index 1c9098e8f874de..7e7f87789fe5fa 100644 --- a/src/lists/list-item.jsx +++ b/src/lists/list-item.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); const ColorManipulator = require('../utils/color-manipulator'); const StylePropable = require('../mixins/style-propable'); const Colors = require('../styles/colors'); diff --git a/src/lists/list.jsx b/src/lists/list.jsx index fb2a3e7a90c43b..3e5529e9ec6519 100644 --- a/src/lists/list.jsx +++ b/src/lists/list.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); const PropTypes = require('../utils/prop-types'); const StylePropable = require('../mixins/style-propable'); const Typography = require('../styles/typography'); diff --git a/src/menus/icon-menu.jsx b/src/menus/icon-menu.jsx index 2b02d4f1ed3dad..135b7ce886d71a 100644 --- a/src/menus/icon-menu.jsx +++ b/src/menus/icon-menu.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const ReactTransitionGroup = React.addons.TransitionGroup; +const React = require('react'); +const ReactTransitionGroup = require('react/lib/ReactTransitionGroup'); const ClickAwayable = require('../mixins/click-awayable'); const StylePropable = require('../mixins/style-propable'); const Events = require('../utils/events'); diff --git a/src/menus/menu-divider.jsx b/src/menus/menu-divider.jsx index 38eb4c814b26bc..8a30e79e4d0488 100644 --- a/src/menus/menu-divider.jsx +++ b/src/menus/menu-divider.jsx @@ -1,4 +1,4 @@ -const React = require('react/addons'); +const React = require('react'); const StylePropable = require('../mixins/style-propable'); const ListDivider = require('../lists/list-divider'); const DefaultRawTheme = require('../styles/raw-themes/light-raw-theme'); diff --git a/src/menus/menu-item.jsx b/src/menus/menu-item.jsx index 79e1a7a6d1c75f..ec871810d11dfe 100644 --- a/src/menus/menu-item.jsx +++ b/src/menus/menu-item.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); const StylePropable = require('../mixins/style-propable'); const Colors = require('../styles/colors'); const CheckIcon = require('../svg-icons/navigation/check'); diff --git a/src/menus/menu.jsx b/src/menus/menu.jsx index be228b35b28934..41837d711b8ca0 100644 --- a/src/menus/menu.jsx +++ b/src/menus/menu.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const update = React.addons.update; +const React = require('react'); +const update = require('react/lib/update'); const Controllable = require('../mixins/controllable'); const StylePropable = require('../mixins/style-propable'); const AutoPrefix = require('../styles/auto-prefix'); diff --git a/src/mixins/controllable.js b/src/mixins/controllable.js index e589d8411bbf3f..7ed614844ca946 100644 --- a/src/mixins/controllable.js +++ b/src/mixins/controllable.js @@ -1,4 +1,4 @@ -let React = require('react/addons'); +const React = require('react'); module.exports = { diff --git a/src/paper.jsx b/src/paper.jsx index 1b9ba80a5f4677..ea46ce76cc84f9 100644 --- a/src/paper.jsx +++ b/src/paper.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); const StylePropable = require('./mixins/style-propable'); const PropTypes = require('./utils/prop-types'); const Transitions = require('./styles/transitions'); diff --git a/src/ripples/circle-ripple.jsx b/src/ripples/circle-ripple.jsx index ee109769b79e27..f53ae1fcae6f42 100644 --- a/src/ripples/circle-ripple.jsx +++ b/src/ripples/circle-ripple.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); const StylePropable = require('../mixins/style-propable'); const AutoPrefix = require('../styles/auto-prefix'); const Transitions = require('../styles/transitions'); diff --git a/src/ripples/focus-ripple.jsx b/src/ripples/focus-ripple.jsx index 5950ee46ae473c..040289c59d3210 100644 --- a/src/ripples/focus-ripple.jsx +++ b/src/ripples/focus-ripple.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); const StylePropable = require('../mixins/style-propable'); const AutoPrefix = require('../styles/auto-prefix'); const Colors = require('../styles/colors'); @@ -117,7 +117,7 @@ const FocusRipple = React.createClass({ // For browsers that don't support endsWith() if (el.style.top.indexOf('px', el.style.top.length - 2) !== -1) { oldTop = parseInt(el.style.top); - } + } el.style.height = size + 'px'; el.style.top = (height / 2) - (size / 2 ) + oldTop + 'px'; }, diff --git a/src/ripples/touch-ripple.jsx b/src/ripples/touch-ripple.jsx index 56c03372ddbc77..404265ce869fb9 100644 --- a/src/ripples/touch-ripple.jsx +++ b/src/ripples/touch-ripple.jsx @@ -1,6 +1,6 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; -const ReactTransitionGroup = React.addons.TransitionGroup; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); +const ReactTransitionGroup = require('react/lib/ReactTransitionGroup'); const StylePropable = require('../mixins/style-propable'); const Dom = require('../utils/dom'); const ImmutabilityHelper = require('../utils/immutability-helper'); diff --git a/src/tabs/tabs.jsx b/src/tabs/tabs.jsx index 93b8032b32da7b..160dd7ce478522 100644 --- a/src/tabs/tabs.jsx +++ b/src/tabs/tabs.jsx @@ -1,4 +1,4 @@ -const React = require('react/addons'); +const React = require('react'); const TabTemplate = require('./tabTemplate'); const InkBar = require('../ink-bar'); const StylePropable = require('../mixins/style-propable'); diff --git a/src/transition-groups/scale-in-child.jsx b/src/transition-groups/scale-in-child.jsx index eea492d6209fb2..034533b57d94a5 100644 --- a/src/transition-groups/scale-in-child.jsx +++ b/src/transition-groups/scale-in-child.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); const StylePropable = require('../mixins/style-propable'); const AutoPrefix = require('../styles/auto-prefix'); const Transitions = require('../styles/transitions'); diff --git a/src/transition-groups/scale-in.jsx b/src/transition-groups/scale-in.jsx index e059139b61a2b1..5f93da32cf0dd5 100644 --- a/src/transition-groups/scale-in.jsx +++ b/src/transition-groups/scale-in.jsx @@ -1,6 +1,6 @@ -const React = require('react/addons'); -const PureRenderMixin = React.addons.PureRenderMixin; -const ReactTransitionGroup = React.addons.TransitionGroup; +const React = require('react'); +const PureRenderMixin = require('react/lib/ReactComponentWithPureRenderMixin'); +const ReactTransitionGroup = require('react/lib/ReactTransitionGroup'); const StylePropable = require('../mixins/style-propable'); const ScaleInChild = require('./scale-in-child'); diff --git a/src/transition-groups/slide-in-child.jsx b/src/transition-groups/slide-in-child.jsx index 3dc4033645fb05..966662777825c2 100644 --- a/src/transition-groups/slide-in-child.jsx +++ b/src/transition-groups/slide-in-child.jsx @@ -1,4 +1,4 @@ -const React = require('react/addons'); +const React = require('react'); const StylePropable = require('../mixins/style-propable'); const AutoPrefix = require('../styles/auto-prefix'); const Transitions = require('../styles/transitions'); diff --git a/src/transition-groups/slide-in.jsx b/src/transition-groups/slide-in.jsx index 999db3b1a6e53c..002ba5b6f35bfc 100644 --- a/src/transition-groups/slide-in.jsx +++ b/src/transition-groups/slide-in.jsx @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const ReactTransitionGroup = React.addons.TransitionGroup; +const React = require('react'); +const ReactTransitionGroup = require('react/lib/ReactTransitionGroup'); const StylePropable = require('../mixins/style-propable'); const SlideInChild = require('./slide-in-child'); diff --git a/src/utils/children.js b/src/utils/children.js index 223d118d8ca701..d3385fc2f7a032 100644 --- a/src/utils/children.js +++ b/src/utils/children.js @@ -1,5 +1,5 @@ -const React = require('react/addons'); -const createFragment = React.addons.createFragment; +const React = require('react'); +const createFragment = require('react/lib/ReactFragment').create; module.exports = { diff --git a/src/utils/immutability-helper.js b/src/utils/immutability-helper.js index 9a9eebb55ac704..3d2422c4ea28d2 100644 --- a/src/utils/immutability-helper.js +++ b/src/utils/immutability-helper.js @@ -1,5 +1,4 @@ -const React = require('react/addons'); -const update = React.addons.update; +const update = require('react/lib/update'); function mergeSingle(objA, objB) { if (!objA) return objB; diff --git a/test/checkbox-spec.js b/test/checkbox-spec.js index 2f2df381ee3528..528c00e4e16a5b 100644 --- a/test/checkbox-spec.js +++ b/test/checkbox-spec.js @@ -1,9 +1,8 @@ -import React from 'react/addons'; +import React from 'react'; +import TestUtils from 'react/lib/ReactTestUtils'; import Checkbox from 'checkbox'; import injectTheme from './fixtures/inject-theme'; -const TestUtils = React.addons.TestUtils; - describe('Checkbox', () => { const CHECKMARK_PATH = 'M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'; diff --git a/test/mixin-context-pure-spec.js b/test/mixin-context-pure-spec.js index e4aa9df189b4ff..3bb1c24e6700c5 100644 --- a/test/mixin-context-pure-spec.js +++ b/test/mixin-context-pure-spec.js @@ -1,10 +1,10 @@ -import React from 'react/addons'; +import React from 'react'; +import TestUtils from 'react/lib/ReactTestUtils'; +import update from 'react/lib/update'; import ContextPure from 'mixins/context-pure'; import ThemeManager from 'styles/theme-manager'; import DefaultRawTheme from 'styles/raw-themes/light-raw-theme'; -const TestUtils = React.addons.TestUtils; -const update = React.addons.update; const GrandChildComponent = React.createClass({ mixins: [ContextPure],