From 10decf95f633a76d60898589bb4fa4a16eea8497 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 13 Jul 2017 00:48:31 +0100 Subject: [PATCH] replace imports of `q` with bluebird update `package.json` ``` find src test -name '*.js' | xargs perl -i -pe 'if (/require\(.[qQ].\)/) { $_ = "import Promise from '\''bluebird'\'';\n"; }' find src test -name '*.js' | xargs perl -i -pe 'if (/import [qQ] /) { $_ = "import Promise from '\''bluebird'\'';\n"; }' ``` --- package.json | 2 +- src/VectorConferenceHandler.js | 2 +- src/components/structures/RoomDirectory.js | 2 +- src/components/views/context_menus/RoomTileContextMenu.js | 2 +- src/components/views/settings/Notifications.js | 2 +- src/vector/index.js | 2 +- src/vector/platform/ElectronPlatform.js | 2 +- src/vector/platform/WebPlatform.js | 2 +- src/vector/rageshake.js | 2 +- src/vector/submit-rageshake.js | 2 +- test/app-tests/joining.js | 2 +- test/app-tests/loading.js | 2 +- test/test-utils.js | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 83d9bd16..06cd786b 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "dependencies": { "babel-polyfill": "^6.5.0", "babel-runtime": "^6.11.6", + "bluebird": "^3.5.0", "browser-request": "^0.3.3", "classnames": "^2.1.2", "draft-js": "^0.8.1", @@ -69,7 +70,6 @@ "matrix-react-sdk": "0.9.7", "modernizr": "^3.1.0", "pako": "^1.0.5", - "q": "^1.4.1", "react": "^15.4.0", "react-dnd": "^2.1.4", "react-dnd-html5-backend": "^2.1.2", diff --git a/src/VectorConferenceHandler.js b/src/VectorConferenceHandler.js index f34a7b73..807fbba0 100644 --- a/src/VectorConferenceHandler.js +++ b/src/VectorConferenceHandler.js @@ -16,7 +16,7 @@ limitations under the License. "use strict"; -var q = require("q"); +import Promise from 'bluebird'; var Matrix = require("matrix-js-sdk"); var Room = Matrix.Room; var CallHandler = require('matrix-react-sdk/lib/CallHandler'); diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index e7d68c39..f487bbd1 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -28,7 +28,7 @@ var linkify = require('linkifyjs'); var linkifyString = require('linkifyjs/string'); var linkifyMatrix = require('matrix-react-sdk/lib/linkify-matrix'); var sanitizeHtml = require('sanitize-html'); -var q = require('q'); +import Promise from 'bluebird'; import { _t } from 'matrix-react-sdk/lib/languageHandler'; diff --git a/src/components/views/context_menus/RoomTileContextMenu.js b/src/components/views/context_menus/RoomTileContextMenu.js index a7b19689..f4c369e0 100644 --- a/src/components/views/context_menus/RoomTileContextMenu.js +++ b/src/components/views/context_menus/RoomTileContextMenu.js @@ -17,7 +17,7 @@ limitations under the License. 'use strict'; -import q from 'q'; +import Promise from 'bluebird'; import React from 'react'; import classNames from 'classnames'; import sdk from 'matrix-react-sdk'; diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index 1b8de52d..12f77ba7 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -17,7 +17,7 @@ limitations under the License. 'use strict'; var React = require('react'); import { _t, _tJsx } from 'matrix-react-sdk/lib/languageHandler'; -var q = require("q"); +import Promise from 'bluebird'; var sdk = require('matrix-react-sdk'); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); var UserSettingsStore = require('matrix-react-sdk/lib/UserSettingsStore'); diff --git a/src/vector/index.js b/src/vector/index.js index 81d329c0..fa640c59 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -65,7 +65,7 @@ var sdk = require("matrix-react-sdk"); const PlatformPeg = require("matrix-react-sdk/lib/PlatformPeg"); sdk.loadSkin(require('../component-index')); var VectorConferenceHandler = require('../VectorConferenceHandler'); -var q = require('q'); +import Promise from 'bluebird'; var request = require('browser-request'); import * as UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore'; import * as languageHandler from 'matrix-react-sdk/lib/languageHandler'; diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 4f0ffae7..809abccd 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -20,7 +20,7 @@ limitations under the License. import VectorBasePlatform, {updateCheckStatusEnum} from './VectorBasePlatform'; import dis from 'matrix-react-sdk/lib/dispatcher'; import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import q from 'q'; +import Promise from 'bluebird'; import {remote, ipcRenderer} from 'electron'; import rageshake from '../rageshake'; diff --git a/src/vector/platform/WebPlatform.js b/src/vector/platform/WebPlatform.js index ae1e54b3..5946a57a 100644 --- a/src/vector/platform/WebPlatform.js +++ b/src/vector/platform/WebPlatform.js @@ -21,7 +21,7 @@ import VectorBasePlatform, {updateCheckStatusEnum} from './VectorBasePlatform'; import request from 'browser-request'; import dis from 'matrix-react-sdk/lib/dispatcher.js'; import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import q from 'q'; +import Promise from 'bluebird'; import url from 'url'; import UAParser from 'ua-parser-js'; diff --git a/src/vector/rageshake.js b/src/vector/rageshake.js index 07726f68..05f00d65 100644 --- a/src/vector/rageshake.js +++ b/src/vector/rageshake.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import q from "q"; +import Promise from 'bluebird'; // This module contains all the code needed to log the console, persist it to // disk and submit bug reports. Rationale is as follows: diff --git a/src/vector/submit-rageshake.js b/src/vector/submit-rageshake.js index c6c551c6..04fe69f6 100644 --- a/src/vector/submit-rageshake.js +++ b/src/vector/submit-rageshake.js @@ -15,7 +15,7 @@ limitations under the License. */ import pako from 'pako'; -import q from "q"; +import Promise from 'bluebird'; import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg'; diff --git a/test/app-tests/joining.js b/test/app-tests/joining.js index 11fd3d48..2f7c6070 100644 --- a/test/app-tests/joining.js +++ b/test/app-tests/joining.js @@ -33,7 +33,7 @@ var React = require('react'); var ReactDOM = require('react-dom'); var ReactTestUtils = require('react-addons-test-utils'); var expect = require('expect'); -var q = require('q'); +import Promise from 'bluebird'; var test_utils = require('../test-utils'); var MockHttpBackend = require('matrix-mock-request'); diff --git a/test/app-tests/loading.js b/test/app-tests/loading.js index d01836a3..d517c05f 100644 --- a/test/app-tests/loading.js +++ b/test/app-tests/loading.js @@ -22,7 +22,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import ReactTestUtils from 'react-addons-test-utils'; import expect from 'expect'; -import q from 'q'; +import Promise from 'bluebird'; import jssdk from 'matrix-js-sdk'; diff --git a/test/test-utils.js b/test/test-utils.js index cda9a017..88ac9d99 100644 --- a/test/test-utils.js +++ b/test/test-utils.js @@ -1,6 +1,6 @@ "use strict"; -var q = require('q'); +import Promise from 'bluebird'; /** * Perform common actions before each test case, e.g. printing the test case