diff --git a/client/package-lock.json b/client/package-lock.json index 1656a2c1..4ced60d9 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1264,12 +1264,6 @@ "resolved": "https://registry.npmjs.org/@types/base64-js/-/base64-js-1.3.0.tgz", "integrity": "sha512-ZmI0sZGAUNXUfMWboWwi4LcfpoVUYldyN6Oe0oJ5cCsHDU/LlRq8nQKPXhYLOx36QYSW9bNIb1vvRrD6K7Llgw==" }, - "@types/bluebird": { - "version": "3.5.36", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.36.tgz", - "integrity": "sha512-HBNx4lhkxN7bx6P0++W8E289foSu8kO8GCk2unhuVggO+cE7rh9DhZUyPhUxNRG9m+5B5BTKxZQ5ZP92x/mx9Q==", - "dev": true - }, "@types/body-parser": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.1.tgz", diff --git a/client/package.json b/client/package.json index 86240c01..2171fc6e 100644 --- a/client/package.json +++ b/client/package.json @@ -17,7 +17,6 @@ "@vue/composition-api": "^1.1.4", "@vue/eslint-config-typescript": "^7.0.0", "axios": "^0.21.4", - "bluebird": "^3.5.5", "direct-vuex": "^0.12.1", "gl-matrix": "^3.4.3", "idle-vue": "^2.0.5", @@ -39,7 +38,6 @@ "@babel/plugin-transform-block-scoping": "7.10.5", "@babel/runtime": "7.11.0", "@babel/runtime-corejs2": "7.11.0", - "@types/bluebird": "^3.5.36", "@types/lodash": "^4.14.172", "@types/uuid": "^8.3.1", "@vue/cli-plugin-babel": "^3.3.0", diff --git a/client/src/store/index.ts b/client/src/store/index.ts index a1b6e0c6..07666184 100644 --- a/client/src/store/index.ts +++ b/client/src/store/index.ts @@ -1,6 +1,5 @@ /* eslint-disable no-use-before-define */ -import BluebirdPromise from 'bluebird'; import { createDirectStore } from 'direct-vuex'; import Vue from 'vue'; import Vuex from 'vuex'; @@ -68,7 +67,7 @@ function getArrayName(filename) { } function getData(id, file, webWorker = null) { - return new BluebirdPromise((resolve, reject) => { + return new Promise((resolve, reject) => { if (frameCache.has(id)) { resolve({ frameData: frameCache.get(id), webWorker }); } else { @@ -121,13 +120,13 @@ function loadFileAndGetData(frameId) { return loadFile(frameId).fileP.then((file) => getData(frameId, file, savedWorker) .then(({ webWorker, frameData }) => { savedWorker = webWorker; - return BluebirdPromise.resolve({ frameData }); + return Promise.resolve({ frameData }); }) .catch((error) => { const msg = 'loadFileAndGetData caught error getting data'; console.log(msg); console.log(error); - return BluebirdPromise.reject(msg); + return Promise.reject(msg); }) .finally(() => { if (savedWorker) { @@ -138,7 +137,7 @@ function loadFileAndGetData(frameId) { } function poolFunction(webWorker, taskInfo) { - return new BluebirdPromise((resolve, reject) => { + return new Promise((resolve, reject) => { const { frameId } = taskInfo; let filePromise = null; diff --git a/client/src/utils/ReaderFactory.js b/client/src/utils/ReaderFactory.js index 78924df0..fdea1c0a 100644 --- a/client/src/utils/ReaderFactory.js +++ b/client/src/utils/ReaderFactory.js @@ -1,11 +1,4 @@ import { CancelToken } from 'axios'; -import Promise from 'bluebird'; - -Promise.config({ - longStackTraces: false, - warnings: false, // note, run node with --trace-warnings to see full stack traces for warnings, - cancellation: true, -}); const READER_MAPPING = {}; @@ -104,7 +97,7 @@ function loadFiles(files) { } function downloadFrame(axios, fileName, url) { - return new Promise((resolve, reject, onCancel) => { + return new Promise((resolve, reject) => { const readerMapping = getReader({ name: fileName }); if (readerMapping) { const { readMethod } = readerMapping; @@ -118,9 +111,6 @@ function downloadFrame(axios, fileName, url) { } }) .catch(reject); - onCancel(() => { - source.cancel('navigated away'); - }); } else { throw new Error(`No reader found for ${fileName}`); }