summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@codeispoetry.ru>2017-06-23 16:56:02 +0300
committerAndrej Mihajlov <and@codeispoetry.ru>2017-06-23 16:56:02 +0300
commit1c2cfddfb487770bcc19f11eedd490c3bebe175d (patch)
treec82d209e8e11d3c0a2d7338dbaa2db266d59b917
parent79f630bf805caa15d51c276dce70c131bd42162d (diff)
downloadmullvadvpn-1c2cfddfb487770bcc19f11eedd490c3bebe175d.tar.xz
mullvadvpn-1c2cfddfb487770bcc19f11eedd490c3bebe175d.zip
Migrate to React 15.6
-rw-r--r--app/components/Account.js3
-rw-r--r--app/components/AccountInput.js3
-rw-r--r--app/components/Connect.js3
-rw-r--r--app/components/CustomScrollbars.js3
-rw-r--r--app/components/Layout.js3
-rw-r--r--app/components/Login.js3
-rw-r--r--app/components/SelectLocation.js3
-rw-r--r--app/components/Settings.js3
-rw-r--r--app/components/Switch.js3
-rw-r--r--app/components/WindowChrome.js3
-rw-r--r--package.json6
-rw-r--r--test/components/AccountInput.spec.js14
-rw-r--r--yarn.lock34
13 files changed, 44 insertions, 40 deletions
diff --git a/app/components/Account.js b/app/components/Account.js
index fe38439e7a..7aaec4f2e6 100644
--- a/app/components/Account.js
+++ b/app/components/Account.js
@@ -1,5 +1,6 @@
import moment from 'moment';
-import React, { Component, PropTypes } from 'react';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
import { If, Then, Else } from 'react-if';
import { Layout, Container, Header } from './Layout';
import { formatAccount } from '../lib/formatters';
diff --git a/app/components/AccountInput.js b/app/components/AccountInput.js
index e933d52f79..3e6993a9bb 100644
--- a/app/components/AccountInput.js
+++ b/app/components/AccountInput.js
@@ -1,4 +1,5 @@
-import React, { Component, PropTypes } from 'react';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
import { formatAccount } from '../lib/formatters';
/**
diff --git a/app/components/Connect.js b/app/components/Connect.js
index 9904012b85..abbbb19db9 100644
--- a/app/components/Connect.js
+++ b/app/components/Connect.js
@@ -1,6 +1,7 @@
import assert from 'assert';
import moment from 'moment';
-import React, { Component, PropTypes } from 'react';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
import { If, Then, Else } from 'react-if';
import ReactMapboxGl, { Marker } from 'react-mapbox-gl';
import cheapRuler from 'cheap-ruler';
diff --git a/app/components/CustomScrollbars.js b/app/components/CustomScrollbars.js
index 605ec0024f..e74cbd7c65 100644
--- a/app/components/CustomScrollbars.js
+++ b/app/components/CustomScrollbars.js
@@ -1,4 +1,5 @@
-import React, { Component, PropTypes } from 'react';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
import { Scrollbars } from 'react-custom-scrollbars';
/**
diff --git a/app/components/Layout.js b/app/components/Layout.js
index 36d298b5b8..58af3d0813 100644
--- a/app/components/Layout.js
+++ b/app/components/Layout.js
@@ -1,4 +1,5 @@
-import React, { PropTypes, Component } from 'react';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
import HeaderBar from './HeaderBar';
/**
diff --git a/app/components/Login.js b/app/components/Login.js
index 2bcf40950e..72ef933082 100644
--- a/app/components/Login.js
+++ b/app/components/Login.js
@@ -1,4 +1,5 @@
-import React, { Component, PropTypes } from 'react';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
import { If, Then } from 'react-if';
import { Layout, Container, Header } from './Layout';
import AccountInput from './AccountInput';
diff --git a/app/components/SelectLocation.js b/app/components/SelectLocation.js
index eb4191518e..0dd52ab2bb 100644
--- a/app/components/SelectLocation.js
+++ b/app/components/SelectLocation.js
@@ -1,4 +1,5 @@
-import React, { Component, PropTypes } from 'react';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
import { If, Then } from 'react-if';
import { Layout, Container, Header } from './Layout';
import { servers } from '../config';
diff --git a/app/components/Settings.js b/app/components/Settings.js
index cc8dc24f25..eaec0355f2 100644
--- a/app/components/Settings.js
+++ b/app/components/Settings.js
@@ -1,5 +1,6 @@
import moment from 'moment';
-import React, { Component, PropTypes } from 'react';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
import { If, Then, Else } from 'react-if';
import { Layout, Container, Header } from './Layout';
import Switch from './Switch';
diff --git a/app/components/Switch.js b/app/components/Switch.js
index 7f19e275bb..4cb0ea34c3 100644
--- a/app/components/Switch.js
+++ b/app/components/Switch.js
@@ -1,4 +1,5 @@
-import React, { Component, PropTypes } from 'react';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
const CLICK_TIMEOUT = 1000;
const MOVE_THRESHOLD = 10;
diff --git a/app/components/WindowChrome.js b/app/components/WindowChrome.js
index e1df040d6c..16bdb70e28 100644
--- a/app/components/WindowChrome.js
+++ b/app/components/WindowChrome.js
@@ -1,4 +1,5 @@
-import React, { Component, PropTypes } from 'react';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
/**
* A component used to chip out arrow in the app header using CSS mask
diff --git a/package.json b/package.json
index 9b16195226..aad981e1b6 100644
--- a/package.json
+++ b/package.json
@@ -17,9 +17,10 @@
"jsonrpc-lite": "^1.2.3",
"mapbox-gl": "^0.36.0",
"moment": "^2.17.1",
- "react": "^15.4.2",
+ "prop-types": "^15.5.10",
+ "react": "^15.6.1",
"react-custom-scrollbars": "^4.0.2",
- "react-dom": "^15.4.2",
+ "react-dom": "^15.6.1",
"react-if": "^2.1.0",
"react-mapbox-gl": "^1.3.0",
"react-redux": "^5.0.2",
@@ -62,7 +63,6 @@
"jsdom": "^9.11.0",
"mocha": "^3.2.0",
"npm-run-all": "^4.0.1",
- "react-addons-test-utils": "^15.4.2",
"redux-mock-store": "^1.2.2",
"rimraf": "^2.5.4",
"sudo-prompt": "^7.0.0"
diff --git a/test/components/AccountInput.spec.js b/test/components/AccountInput.spec.js
index 180598d49e..0a6e15b12e 100644
--- a/test/components/AccountInput.spec.js
+++ b/test/components/AccountInput.spec.js
@@ -2,7 +2,7 @@ import { expect } from 'chai';
import { KeyType, createKeyEvent } from '../mocks/dom';
import React from 'react';
-import ReactTestUtils, { Simulate } from 'react-addons-test-utils';
+import ReactTestUtils, { Simulate } from 'react-dom/test-utils';
import AccountInput from '../../app/components/AccountInput';
describe('components/AccountInput', () => {
@@ -28,7 +28,7 @@ describe('components/AccountInput', () => {
const component = ReactTestUtils.renderIntoDocument(
<AccountInput onChange={ onChange } />
);
-
+
Simulate.keyDown(component._ref, createKeyEvent(KeyType._1));
});
@@ -120,7 +120,7 @@ describe('components/AccountInput', () => {
const component = ReactTestUtils.renderIntoDocument(
<AccountInput value="0000" />
);
-
+
component.setState({ selectionRange: [1, 3] }, () => {
Simulate.keyDown(component._ref, createKeyEvent(KeyType._1));
@@ -140,7 +140,7 @@ describe('components/AccountInput', () => {
for(let i = 0; i < 12; i++) {
Simulate.keyDown(component._ref, createKeyEvent(KeyType._1));
}
-
+
component.setState({}, () => {
expect(component.state.value).to.be.equal('111111111111');
expect(component.state.selectionRange).to.deep.equal([12, 12]);
@@ -152,10 +152,10 @@ describe('components/AccountInput', () => {
const component = ReactTestUtils.renderIntoDocument(
<AccountInput value="0000" />
);
-
+
component.setState({ selectionRange: [1, 1]}, () => {
Simulate.keyDown(component._ref, createKeyEvent(KeyType._1));
-
+
component.setState({}, () => {
expect(component.state.value).to.be.equal('01000');
expect(component.state.selectionRange).to.deep.equal([2, 2]);
@@ -168,7 +168,7 @@ describe('components/AccountInput', () => {
const component = ReactTestUtils.renderIntoDocument(
<AccountInput value="0000" />
);
-
+
component.setState({ selectionRange: [0, 0] }, () => {
Simulate.keyDown(component._ref, createKeyEvent(KeyType.Backspace));
diff --git a/yarn.lock b/yarn.lock
index 7a3a61d6c7..fb2ae50374 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1624,9 +1624,9 @@ create-error-class@^3.0.0:
dependencies:
capture-stack-trace "^1.0.0"
-create-react-class@^15.5.3:
- version "15.5.3"
- resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.5.3.tgz#fb0f7cae79339e9a179e194ef466efa3923820fe"
+create-react-class@^15.5.3, create-react-class@^15.6.0:
+ version "15.6.0"
+ resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.0.tgz#ab448497c26566e1e29413e883207d57cfe7bed4"
dependencies:
fbjs "^0.8.9"
loose-envify "^1.3.1"
@@ -2517,7 +2517,7 @@ fast-levenshtein@~2.0.4:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
-fbjs@^0.8.4, fbjs@^0.8.9:
+fbjs@^0.8.9:
version "0.8.12"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04"
dependencies:
@@ -4397,7 +4397,7 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"
-prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@~15.5.7:
+prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6:
version "15.5.10"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154"
dependencies:
@@ -4496,13 +4496,6 @@ rc@^1.0.1, rc@^1.1.2, rc@^1.1.6, rc@^1.1.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"
-react-addons-test-utils@^15.4.2:
- version "15.5.1"
- resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.5.1.tgz#e0d258cda2a122ad0dff69f838260d0c3958f5f7"
- dependencies:
- fbjs "^0.8.4"
- object-assign "^4.1.0"
-
react-custom-scrollbars@^4.0.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/react-custom-scrollbars/-/react-custom-scrollbars-4.1.2.tgz#0e60c4a46c4a61f9e4994a7663e2b9cbbc5187a3"
@@ -4511,14 +4504,14 @@ react-custom-scrollbars@^4.0.2:
prop-types "^15.5.10"
raf "^3.1.0"
-react-dom@^15.4.2:
- version "15.5.4"
- resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.5.4.tgz#ba0c28786fd52ed7e4f2135fe0288d462aef93da"
+react-dom@^15.6.1:
+ version "15.6.1"
+ resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.6.1.tgz#2cb0ed4191038e53c209eb3a79a23e2a4cf99470"
dependencies:
fbjs "^0.8.9"
loose-envify "^1.1.0"
object-assign "^4.1.0"
- prop-types "~15.5.7"
+ prop-types "^15.5.10"
react-if@^2.1.0:
version "2.1.0"
@@ -4575,14 +4568,15 @@ react-transition-group@^1.1.3:
prop-types "^15.5.6"
warning "^3.0.0"
-react@^15.4.2:
- version "15.5.4"
- resolved "https://registry.yarnpkg.com/react/-/react-15.5.4.tgz#fa83eb01506ab237cdc1c8c3b1cea8de012bf047"
+react@^15.6.1:
+ version "15.6.1"
+ resolved "https://registry.yarnpkg.com/react/-/react-15.6.1.tgz#baa8434ec6780bde997cdc380b79cd33b96393df"
dependencies:
+ create-react-class "^15.6.0"
fbjs "^0.8.9"
loose-envify "^1.1.0"
object-assign "^4.1.0"
- prop-types "^15.5.7"
+ prop-types "^15.5.10"
read-pkg-up@^1.0.1:
version "1.0.1"