Skip to content

Commit

Permalink
chore: remove bluebird dependency (#1668)
Browse files Browse the repository at this point in the history
* chore: remove bluebird dependency

* chore: fix constant name
  • Loading branch information
eglitise authored Sep 9, 2024
1 parent 27ba5f5 commit 304a52c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/common/renderer/constants/session-inspector.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const MJPEG_STREAM_CHECK_INTERVAL = 1000;
export const SESSION_EXPIRY_PROMPT_TIMEOUT = 60 * 60 * 1000; // Give user 1 hour to reply
export const REFRESH_DELAY_MILLIS = 500;

export const APP_MODE = {
NATIVE: 'native',
Expand Down
5 changes: 2 additions & 3 deletions app/common/renderer/lib/appium-client.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Bluebird from 'bluebird';
import _ from 'lodash';

import {SCREENSHOT_INTERACTION_MODE} from '../constants/screenshot';
import {APP_MODE, NATIVE_APP} from '../constants/session-inspector';
import {APP_MODE, NATIVE_APP, REFRESH_DELAY_MILLIS} from '../constants/session-inspector';
import {log} from '../utils/logger';
import {parseSource, setHtmlElementAttributes} from './webview-helpers';

Expand Down Expand Up @@ -131,7 +130,7 @@ export default class AppiumClient {
windowSizeUpdate = {};
if (!skipRefresh) {
// Give the source/screenshot time to change before taking the screenshot
await Bluebird.delay(500);
await new Promise((resolve) => setTimeout(resolve, REFRESH_DELAY_MILLIS));
if (!skipScreenshot) {
screenshotUpdate = await this.getScreenshotUpdate();
}
Expand Down
1 change: 0 additions & 1 deletion app/common/renderer/utils/file-handling.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {Promise} from 'bluebird';
import _ from 'lodash';

import {CAPABILITY_TYPES, SERVER_TYPES} from '../constants/session-builder';
Expand Down
3 changes: 1 addition & 2 deletions ci-jobs/crowdin-update-resources.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import B from 'bluebird';
import {createReadStream} from 'node:fs';
import path from 'node:path';

Expand Down Expand Up @@ -42,7 +41,7 @@ async function updateFile(fileId, storageId) {
}

async function main() {
const [storageId, fileId] = await B.all([uploadToStorage(), getFileId()]);
const [storageId, fileId] = await Promise.all([uploadToStorage(), getFileId()]);
await updateFile(fileId, storageId);
log.info('All done');
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
},
"//dependencies": {
"antd": "V5: significant rewrite required",
"bluebird": "Deprecated: recommended to replace with native promises",
"cheerio": "V1: requires Node 18",
"uuid": "V10: requires Node 16. Can also be replaced with crypto.randomUUID in Electron 14+"
},
Expand All @@ -69,7 +68,6 @@
"@xmldom/xmldom": "0.9.2",
"antd": "4.24.16",
"axios": "1.7.7",
"bluebird": "3.7.2",
"cheerio": "1.0.0-rc.12",
"electron-debug": "4.0.1",
"electron-settings": "4.0.4",
Expand Down

0 comments on commit 304a52c

Please sign in to comment.