diff --git a/package.json b/package.json index ed5174145d..6c38469887 100644 --- a/package.json +++ b/package.json @@ -184,6 +184,7 @@ "abort-controller": "^3.0.0", "array-move": "^3.0.0", "auto-bind": "^4.0.0", + "autobind-decorator": "^2.4.0", "await-lock": "^2.1.0", "byline": "^5.0.0", "chalk": "^4.1.0", diff --git a/src/common/search-store.ts b/src/common/search-store.ts index 01d38bce9d..1ccd8d9470 100644 --- a/src/common/search-store.ts +++ b/src/common/search-store.ts @@ -1,6 +1,6 @@ import { action, computed, observable, reaction, makeObservable } from "mobx"; import { dockStore } from "../renderer/components/dock/dock.store"; -import { autobind } from "../renderer/utils"; +import { boundMethod } from "../renderer/utils"; export class SearchStore { /** @@ -108,12 +108,12 @@ export class SearchStore { return prev; } - @autobind() + @boundMethod public setNextOverlayActive(): void { this.activeOverlayIndex = this.getNextOverlay(true); } - @autobind() + @boundMethod public setPrevOverlayActive(): void { this.activeOverlayIndex = this.getPrevOverlay(true); } @@ -139,7 +139,7 @@ export class SearchStore { * @param line Index of the line where overlay is located * @param occurrence Number of the overlay within one line */ - @autobind() + @boundMethod public isActiveOverlay(line: number, occurrence: number): boolean { const firstLineIndex = this.occurrences.findIndex(item => item === line); diff --git a/src/common/utils/autobind.ts b/src/common/utils/autobind.ts index 9df08427d9..42031d844e 100644 --- a/src/common/utils/autobind.ts +++ b/src/common/utils/autobind.ts @@ -1,8 +1,8 @@ -// Automatically bind methods to their class instance -// API: https://github.com/sindresorhus/auto-bind +import {boundMethod, boundClass} from "autobind-decorator"; import autoBindClass, { Options } from "auto-bind"; import autoBindReactClass from "auto-bind/react"; +// Automatically bind methods to their class instance export function autoBind(obj: T, opts?: Options): T { if ("componentWillUnmount" in obj) { return autoBindReactClass(obj as any, opts); @@ -11,6 +11,9 @@ export function autoBind(obj: T, opts?: Options): T { return autoBindClass(obj, opts); } -export function autobind(): any { - return (): void => undefined; // noop -} +// Class/method decorators +// Note: @boundClass doesn't work with mobx-6.x/@action decorator +export { + boundClass, + boundMethod, +}; diff --git a/src/renderer/api/terminal-api.ts b/src/renderer/api/terminal-api.ts index 1a94052586..16c798784a 100644 --- a/src/renderer/api/terminal-api.ts +++ b/src/renderer/api/terminal-api.ts @@ -1,5 +1,5 @@ import { stringify } from "querystring"; -import { autobind, base64, EventEmitter } from "../utils"; +import { boundMethod, base64, EventEmitter } from "../utils"; import { WebSocketApi } from "./websocket-api"; import isEqual from "lodash/isEqual"; import { isDevelopment } from "../../common/vars"; @@ -85,7 +85,7 @@ export class TerminalApi extends WebSocketApi { this.onReady.removeAllListeners(); } - @autobind() + @boundMethod protected _onReady(data: string) { if (!data) return; this.isReady = true; diff --git a/src/renderer/components/+apps-helm-charts/helm-chart-details.tsx b/src/renderer/components/+apps-helm-charts/helm-chart-details.tsx index 0f71d046a1..335811266b 100644 --- a/src/renderer/components/+apps-helm-charts/helm-chart-details.tsx +++ b/src/renderer/components/+apps-helm-charts/helm-chart-details.tsx @@ -5,7 +5,7 @@ import { getChartDetails, HelmChart } from "../../api/endpoints/helm-charts.api" import { observable, autorun, makeObservable } from "mobx"; import { observer } from "mobx-react"; import { Drawer, DrawerItem } from "../drawer"; -import { autobind, stopPropagation } from "../../utils"; +import { boundMethod, stopPropagation } from "../../utils"; import { MarkdownViewer } from "../markdown-viewer"; import { Spinner } from "../spinner"; import { Button } from "../button"; @@ -51,7 +51,7 @@ export class HelmChartDetails extends Component { }); }); - @autobind() + @boundMethod async onVersionChange({ value: version }: SelectOption) { this.selectedChart = this.chartVersions.find(chart => chart.version === version); this.readme = null; @@ -68,7 +68,7 @@ export class HelmChartDetails extends Component { } } - @autobind() + @boundMethod install() { createInstallChartTab(this.selectedChart); this.props.hideDetails(); diff --git a/src/renderer/components/+apps-releases/release-menu.tsx b/src/renderer/components/+apps-releases/release-menu.tsx index e482bb000a..06312bc274 100644 --- a/src/renderer/components/+apps-releases/release-menu.tsx +++ b/src/renderer/components/+apps-releases/release-menu.tsx @@ -1,6 +1,6 @@ import React from "react"; import { HelmRelease } from "../../api/endpoints/helm-releases.api"; -import { autobind, cssNames } from "../../utils"; +import { boundMethod, cssNames } from "../../utils"; import { releaseStore } from "./release.store"; import { MenuActions, MenuActionsProps } from "../menu/menu-actions"; import { MenuItem } from "../menu"; @@ -14,12 +14,12 @@ interface Props extends MenuActionsProps { } export class HelmReleaseMenu extends React.Component { - @autobind() + @boundMethod remove() { return releaseStore.remove(this.props.release); } - @autobind() + @boundMethod upgrade() { const { release, hideDetails } = this.props; @@ -27,7 +27,7 @@ export class HelmReleaseMenu extends React.Component { hideDetails && hideDetails(); } - @autobind() + @boundMethod rollback() { ReleaseRollbackDialog.open(this.props.release); } diff --git a/src/renderer/components/+catalog/catalog-add-button.tsx b/src/renderer/components/+catalog/catalog-add-button.tsx index 1521998d89..db53361b7e 100644 --- a/src/renderer/components/+catalog/catalog-add-button.tsx +++ b/src/renderer/components/+catalog/catalog-add-button.tsx @@ -4,7 +4,7 @@ import { SpeedDial, SpeedDialAction } from "@material-ui/lab"; import { Icon } from "../icon"; import { disposeOnUnmount, observer } from "mobx-react"; import { observable, reaction, makeObservable } from "mobx"; -import { autobind } from "../../../common/utils"; +import { boundMethod } from "../../../common/utils"; import { CatalogCategory, CatalogEntityAddMenuContext, CatalogEntityContextMenu } from "../../api/catalog-entity"; import { EventEmitter } from "events"; import { navigate } from "../../navigation"; @@ -40,17 +40,17 @@ export class CatalogAddButton extends React.Component { ]); } - @autobind() + @boundMethod onOpen() { this.isOpen = true; } - @autobind() + @boundMethod onClose() { this.isOpen = false; } - @autobind() + @boundMethod onButtonClick() { if (this.menuItems.length == 1) { this.menuItems[0].onClick(); diff --git a/src/renderer/components/+catalog/catalog.tsx b/src/renderer/components/+catalog/catalog.tsx index fa9f4b484d..ad7b812e80 100644 --- a/src/renderer/components/+catalog/catalog.tsx +++ b/src/renderer/components/+catalog/catalog.tsx @@ -12,7 +12,7 @@ import { Icon } from "../icon"; import { CatalogEntityContextMenu, CatalogEntityContextMenuContext, catalogEntityRunContext } from "../../api/catalog-entity"; import { Badge } from "../badge"; import { HotbarStore } from "../../../common/hotbar-store"; -import { autobind } from "../../utils"; +import { boundMethod } from "../../utils"; import { ConfirmDialog } from "../confirm-dialog"; import { Tab, Tabs } from "../tabs"; import { catalogCategoryRegistry } from "../../../common/catalog"; @@ -114,7 +114,7 @@ export class Catalog extends React.Component { ); } - @autobind() + @boundMethod renderItemMenu(item: CatalogEntityItem) { const menuItems = this.contextMenu.menuItems.filter((menuItem) => !menuItem.onlyVisibleForSource || menuItem.onlyVisibleForSource === item.entity.metadata.source); diff --git a/src/renderer/components/+cluster/cluster-issues.tsx b/src/renderer/components/+cluster/cluster-issues.tsx index fabfd1c3cd..43ad722cbc 100644 --- a/src/renderer/components/+cluster/cluster-issues.tsx +++ b/src/renderer/components/+cluster/cluster-issues.tsx @@ -8,7 +8,7 @@ import { SubHeader } from "../layout/sub-header"; import { Table, TableCell, TableHead, TableRow } from "../table"; import { nodesStore } from "../+nodes/nodes.store"; import { eventStore } from "../+events/event.store"; -import { autobind, cssNames, prevDefault } from "../../utils"; +import { boundMethod, cssNames, prevDefault } from "../../utils"; import { ItemObject } from "../../item.store"; import { Spinner } from "../spinner"; import { ThemeStore } from "../../theme.store"; @@ -87,7 +87,7 @@ export class ClusterIssues extends React.Component { return warnings; } - @autobind() + @boundMethod getTableRow(uid: string) { const { warnings } = this; const warning = warnings.find(warn => warn.getId() == uid); diff --git a/src/renderer/components/+extensions/extensions.tsx b/src/renderer/components/+extensions/extensions.tsx index 2d9baba1d4..74c4332960 100644 --- a/src/renderer/components/+extensions/extensions.tsx +++ b/src/renderer/components/+extensions/extensions.tsx @@ -6,7 +6,7 @@ import { disposeOnUnmount, observer } from "mobx-react"; import os from "os"; import path from "path"; import React from "react"; -import { autobind, disposer, Disposer, downloadFile, downloadJson, ExtendableDisposer, extractTar, listTarEntries, noop, readFileFromTar } from "../../../common/utils"; +import { boundMethod, disposer, Disposer, downloadFile, downloadJson, ExtendableDisposer, extractTar, listTarEntries, noop, readFileFromTar } from "../../../common/utils"; import { docsUrl } from "../../../common/vars"; import { ExtensionDiscovery, InstalledExtension, manifestFilename } from "../../../extensions/extension-discovery"; import { ExtensionLoader } from "../../../extensions/extension-loader"; @@ -519,7 +519,7 @@ export class Extensions extends React.Component { ); } - @autobind() + @boundMethod renderExtension(extension: InstalledExtension) { const { id, isEnabled, manifest } = extension; const { name, description, version } = manifest; diff --git a/src/renderer/components/+network-endpoints/endpoint-subset-list.tsx b/src/renderer/components/+network-endpoints/endpoint-subset-list.tsx index 7dbcc81c59..880a9872e7 100644 --- a/src/renderer/components/+network-endpoints/endpoint-subset-list.tsx +++ b/src/renderer/components/+network-endpoints/endpoint-subset-list.tsx @@ -4,7 +4,7 @@ import React from "react"; import { observer } from "mobx-react"; import { EndpointSubset, Endpoint, EndpointAddress} from "../../api/endpoints"; import { Table, TableCell, TableHead, TableRow } from "../table"; -import { autobind } from "../../utils"; +import { boundMethod } from "../../utils"; import { lookupApiLink } from "../../api/kube-api"; import { Link } from "react-router-dom"; import { getDetailsUrl } from "../kube-object"; @@ -24,7 +24,7 @@ export class EndpointSubsetList extends React.Component { return this.renderAddressTableRow(address); } - @autobind() + @boundMethod getNotReadyAddressTableRow(ip: string) { const { subset} = this.props; const address = subset.getNotReadyAddresses().find(address => address.getId() == ip); @@ -32,7 +32,7 @@ export class EndpointSubsetList extends React.Component { return this.renderAddressTableRow(address); } - @autobind() + @boundMethod renderAddressTable(addresses: EndpointAddress[], virtual: boolean) { return (
@@ -58,7 +58,7 @@ export class EndpointSubsetList extends React.Component { ); } - @autobind() + @boundMethod renderAddressTableRow(address: EndpointAddress) { const { endpoint } = this.props; diff --git a/src/renderer/components/+storage-volumes/volume-details-list.tsx b/src/renderer/components/+storage-volumes/volume-details-list.tsx index a9fb091050..253968784a 100644 --- a/src/renderer/components/+storage-volumes/volume-details-list.tsx +++ b/src/renderer/components/+storage-volumes/volume-details-list.tsx @@ -3,7 +3,7 @@ import "./volume-details-list.scss"; import React from "react"; import { observer } from "mobx-react"; import { PersistentVolume } from "../../api/endpoints/persistent-volume.api"; -import { autobind } from "../../../common/utils/autobind"; +import { boundMethod } from "../../../common/utils/autobind"; import { TableRow } from "../table/table-row"; import { cssNames, prevDefault } from "../../utils"; import { showDetails } from "../kube-object/kube-object-details"; @@ -33,7 +33,7 @@ export class VolumeDetailsList extends React.Component { [sortBy.status]: (volume: PersistentVolume) => volume.getStatus(), }; - @autobind() + @boundMethod getTableRow(uid: string) { const { persistentVolumes } = this.props; const volume = persistentVolumes.find(volume => volume.getId() === uid); diff --git a/src/renderer/components/+user-management-roles-bindings/role-binding-details.tsx b/src/renderer/components/+user-management-roles-bindings/role-binding-details.tsx index eb28725422..f8fb5fc66f 100644 --- a/src/renderer/components/+user-management-roles-bindings/role-binding-details.tsx +++ b/src/renderer/components/+user-management-roles-bindings/role-binding-details.tsx @@ -3,7 +3,7 @@ import "./role-binding-details.scss"; import React from "react"; import { AddRemoveButtons } from "../add-remove-buttons"; import { IRoleBindingSubject, RoleBinding } from "../../api/endpoints"; -import { autobind, prevDefault } from "../../utils"; +import { boundMethod, prevDefault } from "../../utils"; import { Table, TableCell, TableHead, TableRow } from "../table"; import { ConfirmDialog } from "../confirm-dialog"; import { DrawerTitle } from "../drawer"; @@ -47,7 +47,7 @@ export class RoleBindingDetails extends React.Component { ); } - @autobind() + @boundMethod removeSelectedSubjects() { const { object: roleBinding } = this.props; const { selectedSubjects } = this; diff --git a/src/renderer/components/+workloads-overview/overview-statuses.tsx b/src/renderer/components/+workloads-overview/overview-statuses.tsx index bc0484dadc..1552813ff9 100644 --- a/src/renderer/components/+workloads-overview/overview-statuses.tsx +++ b/src/renderer/components/+workloads-overview/overview-statuses.tsx @@ -9,7 +9,7 @@ import { namespaceStore } from "../+namespaces/namespace.store"; import { NamespaceSelectFilter } from "../+namespaces/namespace-select-filter"; import { isAllowedResource, KubeResource } from "../../../common/rbac"; import { ResourceNames } from "../../utils/rbac"; -import { autobind } from "../../utils"; +import { boundMethod } from "../../utils"; const resources: KubeResource[] = [ "pods", @@ -23,7 +23,7 @@ const resources: KubeResource[] = [ @observer export class OverviewStatuses extends React.Component { - @autobind() + @boundMethod renderWorkload(resource: KubeResource): React.ReactElement { const store = workloadStores[resource]; const items = store.getAllByNs(namespaceStore.contextNamespaces); diff --git a/src/renderer/components/+workloads-pods/pod-details-list.tsx b/src/renderer/components/+workloads-pods/pod-details-list.tsx index f4a4542f4c..fe9f99fd35 100644 --- a/src/renderer/components/+workloads-pods/pod-details-list.tsx +++ b/src/renderer/components/+workloads-pods/pod-details-list.tsx @@ -6,7 +6,7 @@ import { reaction, makeObservable } from "mobx"; import { disposeOnUnmount, observer } from "mobx-react"; import { podsStore } from "./pods.store"; import { Pod } from "../../api/endpoints"; -import { autobind, bytesToUnits, cssNames, interval, prevDefault } from "../../utils"; +import { boundMethod, bytesToUnits, cssNames, interval, prevDefault } from "../../utils"; import { LineProgress } from "../line-progress"; import { KubeObject } from "../../api/kube-object"; import { Table, TableCell, TableHead, TableRow } from "../table"; @@ -103,7 +103,7 @@ export class PodDetailsList extends React.Component { ); } - @autobind() + @boundMethod getTableRow(uid: string) { const { pods } = this.props; const pod = pods.find(pod => pod.getId() == uid); diff --git a/src/renderer/components/+workloads-pods/pod-details.tsx b/src/renderer/components/+workloads-pods/pod-details.tsx index 930dc5b5aa..d296a39620 100644 --- a/src/renderer/components/+workloads-pods/pod-details.tsx +++ b/src/renderer/components/+workloads-pods/pod-details.tsx @@ -8,7 +8,7 @@ import { autorun, observable, reaction, toJS, makeObservable } from "mobx"; import { IPodMetrics, nodesApi, Pod, pvcApi, configMapApi } from "../../api/endpoints"; import { DrawerItem, DrawerTitle } from "../drawer"; import { Badge } from "../badge"; -import { autobind, cssNames, interval } from "../../utils"; +import { boundMethod, cssNames, interval } from "../../utils"; import { PodDetailsContainer } from "./pod-details-container"; import { PodDetailsAffinities } from "./pod-details-affinities"; import { PodDetailsTolerations } from "./pod-details-tolerations"; @@ -56,7 +56,7 @@ export class PodDetails extends React.Component { podsStore.reset(); } - @autobind() + @boundMethod async loadMetrics() { const { object: pod } = this.props; diff --git a/src/renderer/components/ace-editor/ace-editor.tsx b/src/renderer/components/ace-editor/ace-editor.tsx index 180c142ffd..9b106ce500 100644 --- a/src/renderer/components/ace-editor/ace-editor.tsx +++ b/src/renderer/components/ace-editor/ace-editor.tsx @@ -5,7 +5,7 @@ import "./ace-editor.scss"; import React from "react"; import { observer } from "mobx-react"; import AceBuild, { Ace } from "ace-builds"; -import { autobind, cssNames, noop } from "../../utils"; +import { boundMethod, cssNames, noop } from "../../utils"; interface Props extends Partial { className?: string; @@ -128,7 +128,7 @@ export class AceEditor extends React.Component { }); } - @autobind() + @boundMethod onCursorPosChange() { const { onCursorPosChange } = this.props; @@ -137,7 +137,7 @@ export class AceEditor extends React.Component { } } - @autobind() + @boundMethod onChange(delta: Ace.Delta) { const { onChange } = this.props; diff --git a/src/renderer/components/animate/animate.tsx b/src/renderer/components/animate/animate.tsx index 4006d25c5b..d390524512 100644 --- a/src/renderer/components/animate/animate.tsx +++ b/src/renderer/components/animate/animate.tsx @@ -2,7 +2,7 @@ import "./animate.scss"; import React from "react"; import { observable, reaction, makeObservable } from "mobx"; import { disposeOnUnmount, observer } from "mobx-react"; -import { autobind, cssNames, noop } from "../../utils"; +import { boundMethod, cssNames, noop } from "../../utils"; export type AnimateName = "opacity" | "slide-right" | "opacity-scale" | string; @@ -71,7 +71,7 @@ export class Animate extends React.Component { this.statusClassName.leave = false; } - @autobind() + @boundMethod onTransitionEnd(evt: React.TransitionEvent) { const { enter, leave } = this.statusClassName; const { onTransitionEnd } = this.contentElem.props; diff --git a/src/renderer/components/checkbox/checkbox.tsx b/src/renderer/components/checkbox/checkbox.tsx index 8d452a1198..23e5483bf1 100644 --- a/src/renderer/components/checkbox/checkbox.tsx +++ b/src/renderer/components/checkbox/checkbox.tsx @@ -1,6 +1,6 @@ import "./checkbox.scss"; import React from "react"; -import { autobind, cssNames } from "../../utils"; +import { boundMethod, cssNames } from "../../utils"; export interface CheckboxProps { theme?: "dark" | "light"; @@ -15,7 +15,7 @@ export interface CheckboxProps { export class Checkbox extends React.PureComponent { private input: HTMLInputElement; - @autobind() + @boundMethod onChange(evt: React.ChangeEvent) { if (this.props.onChange) { this.props.onChange(this.input.checked, evt); diff --git a/src/renderer/components/clipboard/clipboard.tsx b/src/renderer/components/clipboard/clipboard.tsx index f387b487d6..58922d7ca9 100644 --- a/src/renderer/components/clipboard/clipboard.tsx +++ b/src/renderer/components/clipboard/clipboard.tsx @@ -1,7 +1,7 @@ import "./clipboard.scss"; import React from "react"; import { findDOMNode } from "react-dom"; -import { autobind } from "../../../common/utils"; +import { boundMethod } from "../../../common/utils"; import { Notifications } from "../notifications"; import { copyToClipboard } from "../../utils/copyToClipboard"; import logger from "../../../main/logger"; @@ -33,7 +33,7 @@ export class Clipboard extends React.Component { return React.Children.only(this.props.children) as React.ReactElement; } - @autobind() + @boundMethod onClick(evt: React.MouseEvent) { if (this.rootReactElem.props.onClick) { this.rootReactElem.props.onClick(evt); // pass event to children-root-element if any diff --git a/src/renderer/components/cluster-settings/components/cluster-kubeconfig.tsx b/src/renderer/components/cluster-settings/components/cluster-kubeconfig.tsx index f1a475c325..2c3bf62e97 100644 --- a/src/renderer/components/cluster-settings/components/cluster-kubeconfig.tsx +++ b/src/renderer/components/cluster-settings/components/cluster-kubeconfig.tsx @@ -2,7 +2,7 @@ import React from "react"; import { Cluster } from "../../../../main/cluster"; import { observer } from "mobx-react"; import { SubTitle } from "../../layout/sub-title"; -import { autobind } from "../../../../common/utils"; +import { boundMethod } from "../../../../common/utils"; import { shell } from "electron"; interface Props { @@ -12,7 +12,7 @@ interface Props { @observer export class ClusterKubeconfig extends React.Component { - @autobind() + @boundMethod openKubeconfig() { const { cluster } = this.props; diff --git a/src/renderer/components/cluster-settings/components/remove-cluster-button.tsx b/src/renderer/components/cluster-settings/components/remove-cluster-button.tsx index b41aa4d9aa..4e886da612 100644 --- a/src/renderer/components/cluster-settings/components/remove-cluster-button.tsx +++ b/src/renderer/components/cluster-settings/components/remove-cluster-button.tsx @@ -2,7 +2,7 @@ import React from "react"; import { observer } from "mobx-react"; import { ClusterStore } from "../../../../common/cluster-store"; import { Cluster } from "../../../../main/cluster"; -import { autobind } from "../../../utils"; +import { boundMethod } from "../../../utils"; import { Button } from "../../button"; import { ConfirmDialog } from "../../confirm-dialog"; @@ -12,7 +12,7 @@ interface Props { @observer export class RemoveClusterButton extends React.Component { - @autobind() + @boundMethod confirmRemoveCluster() { const { cluster } = this.props; diff --git a/src/renderer/components/dock/dock-tab.tsx b/src/renderer/components/dock/dock-tab.tsx index bcee911757..8cc61572fe 100644 --- a/src/renderer/components/dock/dock-tab.tsx +++ b/src/renderer/components/dock/dock-tab.tsx @@ -2,7 +2,7 @@ import "./dock-tab.scss"; import React from "react"; import { observer } from "mobx-react"; -import { autobind, cssNames, prevDefault } from "../../utils"; +import { boundMethod, cssNames, prevDefault } from "../../utils"; import { dockStore, IDockTab } from "./dock.store"; import { Tab, TabProps } from "../tabs"; import { Icon } from "../icon"; @@ -26,7 +26,7 @@ export class DockTab extends React.Component { return this.props.value.id; } - @autobind() + @boundMethod close() { dockStore.closeTab(this.tabId); } diff --git a/src/renderer/components/dock/install-chart.tsx b/src/renderer/components/dock/install-chart.tsx index c146ba32e6..06ce2e6d5b 100644 --- a/src/renderer/components/dock/install-chart.tsx +++ b/src/renderer/components/dock/install-chart.tsx @@ -7,7 +7,7 @@ import { dockStore, IDockTab } from "./dock.store"; import { InfoPanel } from "./info-panel"; import { Badge } from "../badge"; import { NamespaceSelect } from "../+namespaces/namespace-select"; -import { autobind, prevDefault } from "../../utils"; +import { boundMethod, prevDefault } from "../../utils"; import { IChartInstallData, installChartStore } from "./install-chart.store"; import { Spinner } from "../spinner"; import { Icon } from "../icon"; @@ -54,7 +54,7 @@ export class InstallChart extends Component { return installChartStore.details.getData(this.tabId); } - @autobind() + @boundMethod viewRelease() { const { release } = this.releaseDetails; @@ -67,14 +67,14 @@ export class InstallChart extends Component { dockStore.closeTab(this.tabId); } - @autobind() + @boundMethod save(data: Partial) { const chart = { ...this.chartData, ...data }; installChartStore.setData(this.tabId, chart); } - @autobind() + @boundMethod onVersionChange(option: SelectOption) { const version = option.value; @@ -82,18 +82,18 @@ export class InstallChart extends Component { installChartStore.loadValues(this.tabId); } - @autobind() + @boundMethod onValuesChange(values: string, error?: string) { this.error = error; this.save({ values }); } - @autobind() + @boundMethod onNamespaceChange(opt: SelectOption) { this.save({ namespace: opt.value }); } - @autobind() + @boundMethod onReleaseNameChange(name: string) { this.save({ releaseName: name }); } diff --git a/src/renderer/components/dock/logs.tsx b/src/renderer/components/dock/logs.tsx index e698c543ca..73f5dea070 100644 --- a/src/renderer/components/dock/logs.tsx +++ b/src/renderer/components/dock/logs.tsx @@ -3,7 +3,7 @@ import { observable, reaction, makeObservable } from "mobx"; import { disposeOnUnmount, observer } from "mobx-react"; import { searchStore } from "../../../common/search-store"; -import { autobind } from "../../utils"; +import { boundMethod } from "../../utils"; import { IDockTab } from "./dock.store"; import { InfoPanel } from "./info-panel"; import { LogResourceSelector } from "./log-resource-selector"; @@ -54,7 +54,7 @@ export class Logs extends React.Component { * A function for various actions after search is happened * @param query {string} A text from search field */ - @autobind() + @boundMethod onSearch() { this.toOverlay(); } @@ -62,7 +62,7 @@ export class Logs extends React.Component { /** * Scrolling to active overlay (search word highlight) */ - @autobind() + @boundMethod toOverlay() { const { activeOverlayLine } = searchStore; diff --git a/src/renderer/components/dock/terminal-tab.tsx b/src/renderer/components/dock/terminal-tab.tsx index cd1de7b1a9..33de8d80c9 100644 --- a/src/renderer/components/dock/terminal-tab.tsx +++ b/src/renderer/components/dock/terminal-tab.tsx @@ -2,7 +2,7 @@ import "./terminal-tab.scss"; import React from "react"; import { observer } from "mobx-react"; -import { autobind, cssNames } from "../../utils"; +import { boundMethod, cssNames } from "../../utils"; import { DockTab, DockTabProps } from "./dock-tab"; import { Icon } from "../icon"; import { terminalStore } from "./terminal.store"; @@ -33,7 +33,7 @@ export class TerminalTab extends React.Component { return terminalStore.isDisconnected(this.tabId); } - @autobind() + @boundMethod reconnect() { terminalStore.reconnect(this.tabId); } diff --git a/src/renderer/components/dock/terminal.ts b/src/renderer/components/dock/terminal.ts index 1eb53b6929..33d6929537 100644 --- a/src/renderer/components/dock/terminal.ts +++ b/src/renderer/components/dock/terminal.ts @@ -5,7 +5,7 @@ import { FitAddon } from "xterm-addon-fit"; import { dockStore, TabId } from "./dock.store"; import { TerminalApi } from "../../api/terminal-api"; import { ThemeStore } from "../../theme.store"; -import { autobind } from "../../utils"; +import { boundMethod } from "../../utils"; import { isMac } from "../../../common/vars"; import { camelCase } from "lodash"; @@ -36,7 +36,7 @@ export class Terminal { public scrollPos = 0; public disposers: Function[] = []; - @autobind() + @boundMethod protected setTheme(colors: Record) { // Replacing keys stored in styles to format accepted by terminal // E.g. terminalBrightBlack -> brightBlack diff --git a/src/renderer/components/editable-list/editable-list.tsx b/src/renderer/components/editable-list/editable-list.tsx index c2eaa703f7..05931610e2 100644 --- a/src/renderer/components/editable-list/editable-list.tsx +++ b/src/renderer/components/editable-list/editable-list.tsx @@ -5,7 +5,7 @@ import { Icon } from "../icon"; import { Input } from "../input"; import { observable, makeObservable } from "mobx"; import { observer } from "mobx-react"; -import { autobind } from "../../utils"; +import { boundMethod } from "../../utils"; export interface Props { items: T[], @@ -33,7 +33,7 @@ export class EditableList extends React.Component> { makeObservable(this); } - @autobind() + @boundMethod onSubmit(val: string) { const { add } = this.props; diff --git a/src/renderer/components/icon/icon.tsx b/src/renderer/components/icon/icon.tsx index 246e68414d..aee8fd15aa 100644 --- a/src/renderer/components/icon/icon.tsx +++ b/src/renderer/components/icon/icon.tsx @@ -4,7 +4,7 @@ import React, { ReactNode } from "react"; import { findDOMNode } from "react-dom"; import { NavLink } from "react-router-dom"; import { LocationDescriptor } from "history"; -import { autobind, cssNames } from "../../utils"; +import { boundMethod, cssNames } from "../../utils"; import { TooltipDecoratorProps, withTooltip } from "../tooltip"; import isNumber from "lodash/isNumber"; @@ -36,7 +36,7 @@ export class Icon extends React.PureComponent { return interactive ?? !!(onClick || href || link); } - @autobind() + @boundMethod onClick(evt: React.MouseEvent) { if (this.props.disabled) { return; @@ -47,7 +47,7 @@ export class Icon extends React.PureComponent { } } - @autobind() + @boundMethod onKeyDown(evt: React.KeyboardEvent) { switch (evt.nativeEvent.code) { case "Space": diff --git a/src/renderer/components/input/drop-file-input.tsx b/src/renderer/components/input/drop-file-input.tsx index 81cbb2d5f9..9ad5c584fb 100644 --- a/src/renderer/components/input/drop-file-input.tsx +++ b/src/renderer/components/input/drop-file-input.tsx @@ -1,6 +1,6 @@ import "./drop-file-input.scss"; import React from "react"; -import { autobind, cssNames, IClassName } from "../../utils"; +import { boundMethod, cssNames, IClassName } from "../../utils"; import { observable, makeObservable } from "mobx"; import { observer } from "mobx-react"; import logger from "../../../main/logger"; @@ -24,17 +24,17 @@ export class DropFileInput extends React.Component< makeObservable(this); } - @autobind() + @boundMethod onDragEnter() { this.dropAreaActive = true; } - @autobind() + @boundMethod onDragLeave() { this.dropAreaActive = false; } - @autobind() + @boundMethod onDragOver(evt: React.DragEvent) { if (this.props.onDragOver) { this.props.onDragOver(evt); @@ -43,7 +43,7 @@ export class DropFileInput extends React.Component< evt.dataTransfer.dropEffect = "move"; } - @autobind() + @boundMethod onDrop(evt: React.DragEvent) { if (this.props.onDrop) { this.props.onDrop(evt); diff --git a/src/renderer/components/input/input.tsx b/src/renderer/components/input/input.tsx index ad3b77c8e8..3b0b9f6091 100644 --- a/src/renderer/components/input/input.tsx +++ b/src/renderer/components/input/input.tsx @@ -1,7 +1,7 @@ import "./input.scss"; import React, { DOMAttributes, InputHTMLAttributes, TextareaHTMLAttributes } from "react"; -import { autobind, cssNames, debouncePromise, getRandId } from "../../utils"; +import { boundMethod, cssNames, debouncePromise, getRandId } from "../../utils"; import { Icon } from "../icon"; import { Tooltip, TooltipProps } from "../tooltip"; import * as Validators from "./input_validators"; @@ -195,7 +195,7 @@ export class Input extends React.Component { this.setState({ dirty }); } - @autobind() + @boundMethod onFocus(evt: React.FocusEvent) { const { onFocus, autoSelectOnFocus } = this.props; @@ -204,7 +204,7 @@ export class Input extends React.Component { this.setState({ focused: true }); } - @autobind() + @boundMethod onBlur(evt: React.FocusEvent) { const { onBlur } = this.props; @@ -213,7 +213,7 @@ export class Input extends React.Component { this.setState({ focused: false }); } - @autobind() + @boundMethod onChange(evt: React.ChangeEvent) { if (this.props.onChange) { this.props.onChange(evt.currentTarget.value, evt); @@ -232,7 +232,7 @@ export class Input extends React.Component { } } - @autobind() + @boundMethod onKeyDown(evt: React.KeyboardEvent) { const modified = evt.shiftKey || evt.metaKey || evt.altKey || evt.ctrlKey; @@ -281,7 +281,7 @@ export class Input extends React.Component { } } - @autobind() + @boundMethod bindRef(elem: InputElement) { this.input = elem; } diff --git a/src/renderer/components/input/search-input.tsx b/src/renderer/components/input/search-input.tsx index 144cf10ada..363f391d6b 100644 --- a/src/renderer/components/input/search-input.tsx +++ b/src/renderer/components/input/search-input.tsx @@ -2,7 +2,7 @@ import "./search-input.scss"; import React, { createRef } from "react"; import { observer } from "mobx-react"; -import { autobind, cssNames } from "../../utils"; +import { boundMethod, cssNames } from "../../utils"; import { Icon } from "../icon"; import { Input, InputProps } from "./input"; @@ -37,7 +37,7 @@ export class SearchInput extends React.Component { window.removeEventListener("keydown", this.onGlobalKey); } - @autobind() + @boundMethod onGlobalKey(evt: KeyboardEvent) { const meta = evt.metaKey || evt.ctrlKey; @@ -46,7 +46,7 @@ export class SearchInput extends React.Component { } } - @autobind() + @boundMethod onKeyDown(evt: React.KeyboardEvent) { if (this.props.onKeyDown) { this.props.onKeyDown(evt); @@ -60,7 +60,7 @@ export class SearchInput extends React.Component { } } - @autobind() + @boundMethod clear() { if (this.props.onClear) { this.props.onClear(); diff --git a/src/renderer/components/item-object-list/item-list-layout.tsx b/src/renderer/components/item-object-list/item-list-layout.tsx index 33217cdf5d..522fa718cf 100644 --- a/src/renderer/components/item-object-list/item-list-layout.tsx +++ b/src/renderer/components/item-object-list/item-list-layout.tsx @@ -6,7 +6,7 @@ import { computed, makeObservable } from "mobx"; import { disposeOnUnmount, observer } from "mobx-react"; import { ConfirmDialog, ConfirmDialogParams } from "../confirm-dialog"; import { Table, TableCell, TableCellProps, TableHead, TableProps, TableRow, TableRowProps, TableSortCallback } from "../table"; -import { autobind, createStorage, cssNames, IClassName, isReactNode, noop, ObservableToggleSet, prevDefault, stopPropagation } from "../../utils"; +import { boundMethod, createStorage, cssNames, IClassName, isReactNode, noop, ObservableToggleSet, prevDefault, stopPropagation } from "../../utils"; import { AddRemoveButtons, AddRemoveButtonsProps } from "../add-remove-buttons"; import { NoItems } from "../no-items"; import { Spinner } from "../spinner"; @@ -221,7 +221,7 @@ export class ItemListLayout extends React.Component { return this.applyFilters(filterItems.concat(this.props.filterItems), items); } - @autobind() + @boundMethod getRow(uid: string) { const { isSelectable, renderTableHeader, renderTableContents, renderItemMenu, @@ -274,7 +274,7 @@ export class ItemListLayout extends React.Component { ); } - @autobind() + @boundMethod removeItemsDialog() { const { customizeRemoveDialog, store } = this.props; const { selectedItems, removeSelectedItems } = store; @@ -294,7 +294,7 @@ export class ItemListLayout extends React.Component { }); } - @autobind() + @boundMethod toggleFilters() { this.showFilters = !this.showFilters; } diff --git a/src/renderer/components/kube-object/kube-object-menu.tsx b/src/renderer/components/kube-object/kube-object-menu.tsx index 470e98dac4..54cbf032f3 100644 --- a/src/renderer/components/kube-object/kube-object-menu.tsx +++ b/src/renderer/components/kube-object/kube-object-menu.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { autobind, cssNames } from "../../utils"; +import { boundMethod, cssNames } from "../../utils"; import { KubeObject } from "../../api/kube-object"; import { editResourceTab } from "../dock/edit-resource.store"; import { MenuActions, MenuActionsProps } from "../menu/menu-actions"; @@ -34,13 +34,13 @@ export class KubeObjectMenu extends React.Component extends React.Component = { export class PageLayout extends React.Component { static defaultProps = defaultProps as object; - @autobind() + @boundMethod back(evt?: React.MouseEvent | KeyboardEvent) { if (this.props.back) { this.props.back(evt); diff --git a/src/renderer/components/menu/menu-actions.tsx b/src/renderer/components/menu/menu-actions.tsx index 6415018d95..f8c20a42c4 100644 --- a/src/renderer/components/menu/menu-actions.tsx +++ b/src/renderer/components/menu/menu-actions.tsx @@ -3,7 +3,7 @@ import "./menu-actions.scss"; import React, { isValidElement } from "react"; import { observable, makeObservable } from "mobx"; import { observer } from "mobx-react"; -import { autobind, cssNames } from "../../utils"; +import { boundMethod, cssNames } from "../../utils"; import { ConfirmDialog } from "../confirm-dialog"; import { Icon, IconProps } from "../icon"; import { Menu, MenuItem, MenuProps } from "../menu"; @@ -43,7 +43,7 @@ export class MenuActions extends React.Component { makeObservable(this); } - @autobind() + @boundMethod remove() { const { removeAction } = this.props; let { removeConfirmationMessage } = this.props; diff --git a/src/renderer/components/select/select.tsx b/src/renderer/components/select/select.tsx index 543433bb06..e267330e4c 100644 --- a/src/renderer/components/select/select.tsx +++ b/src/renderer/components/select/select.tsx @@ -5,7 +5,7 @@ import "./select.scss"; import React, { ReactNode } from "react"; import { computed, makeObservable } from "mobx"; import { observer } from "mobx-react"; -import { autobind, cssNames } from "../../utils"; +import { boundMethod, cssNames } from "../../utils"; import ReactSelect, { ActionMeta, components, Props as ReactSelectProps, Styles } from "react-select"; import Creatable, { CreatableProps } from "react-select/creatable"; import { ThemeStore } from "../../theme.store"; @@ -85,14 +85,14 @@ export class Select extends React.Component { return options as SelectOption[]; } - @autobind() + @boundMethod onChange(value: SelectOption, meta: ActionMeta) { if (this.props.onChange) { this.props.onChange(value, meta); } } - @autobind() + @boundMethod onKeyDown(evt: React.KeyboardEvent) { if (this.props.onKeyDown) { this.props.onKeyDown(evt); diff --git a/src/renderer/components/table/table-cell.tsx b/src/renderer/components/table/table-cell.tsx index 81e2f9f85f..858def891e 100644 --- a/src/renderer/components/table/table-cell.tsx +++ b/src/renderer/components/table/table-cell.tsx @@ -2,7 +2,7 @@ import "./table-cell.scss"; import type { TableSortBy, TableSortParams } from "./table"; import React, { ReactNode } from "react"; -import { autobind, cssNames, displayBooleans } from "../../utils"; +import { boundMethod, cssNames, displayBooleans } from "../../utils"; import { Icon } from "../icon"; import { Checkbox } from "../checkbox"; @@ -23,7 +23,7 @@ export interface TableCellProps extends React.DOMAttributes { } export class TableCell extends React.Component { - @autobind() + @boundMethod onClick(evt: React.MouseEvent) { if (this.props.onClick) { this.props.onClick(evt); diff --git a/src/renderer/components/table/table.tsx b/src/renderer/components/table/table.tsx index 5f39895d50..2388f7a71f 100644 --- a/src/renderer/components/table/table.tsx +++ b/src/renderer/components/table/table.tsx @@ -3,7 +3,7 @@ import "./table.scss"; import React from "react"; import { orderBy } from "lodash"; import { observer } from "mobx-react"; -import { autobind, cssNames, noop } from "../../utils"; +import { boundMethod, cssNames, noop } from "../../utils"; import { TableRow, TableRowElem, TableRowProps } from "./table-row"; import { TableHead, TableHeadElem, TableHeadProps } from "./table-head"; import { TableCellElem } from "./table-cell"; @@ -120,7 +120,7 @@ export class Table extends React.Component { return orderBy(items, sortingCallback, order as any); } - @autobind() + @boundMethod protected onSort({ sortBy, orderBy }: TableSortParams) { setSortParams(this.props.tableId, { sortBy, orderBy }); const { sortSyncWithUrl, onSort } = this.props; @@ -135,7 +135,7 @@ export class Table extends React.Component { } } - @autobind() + @boundMethod sort(colName: TableSortBy) { const { sortBy, orderBy } = this.sortParams; const sameColumn = sortBy == colName; diff --git a/src/renderer/components/tabs/tabs.tsx b/src/renderer/components/tabs/tabs.tsx index 721d7ad6f1..bfc5a01b7e 100644 --- a/src/renderer/components/tabs/tabs.tsx +++ b/src/renderer/components/tabs/tabs.tsx @@ -1,6 +1,6 @@ import "./tabs.scss"; import React, { DOMAttributes } from "react"; -import { autobind, cssNames } from "../../utils"; +import { boundMethod, cssNames } from "../../utils"; import { Icon } from "../icon"; const TabsContext = React.createContext({}); @@ -24,7 +24,7 @@ export interface TabsProps extends TabsContextValue, Omit { public elem: HTMLElement; - @autobind() + @boundMethod protected bindRef(elem: HTMLElement) { this.elem = elem; } @@ -82,7 +82,7 @@ export class Tab extends React.PureComponent { }); } - @autobind() + @boundMethod onClick(evt: React.MouseEvent) { const { value, active, disabled, onClick } = this.props; const { onChange } = this.context; @@ -92,7 +92,7 @@ export class Tab extends React.PureComponent { if (onChange) onChange(value); } - @autobind() + @boundMethod onFocus(evt: React.FocusEvent) { const { onFocus } = this.props; @@ -100,7 +100,7 @@ export class Tab extends React.PureComponent { this.scrollIntoView(); } - @autobind() + @boundMethod onKeyDown(evt: React.KeyboardEvent) { const ENTER_KEY = evt.keyCode === 13; const SPACE_KEY = evt.keyCode === 32; @@ -117,7 +117,7 @@ export class Tab extends React.PureComponent { } } - @autobind() + @boundMethod protected bindRef(elem: HTMLElement) { this.elem = elem; } diff --git a/src/renderer/components/tooltip/tooltip.tsx b/src/renderer/components/tooltip/tooltip.tsx index 69a88aabe4..c8c4b0eebc 100644 --- a/src/renderer/components/tooltip/tooltip.tsx +++ b/src/renderer/components/tooltip/tooltip.tsx @@ -3,7 +3,7 @@ import "./tooltip.scss"; import React from "react"; import { createPortal } from "react-dom"; import { observer } from "mobx-react"; -import { autobind, cssNames, IClassName } from "../../utils"; +import { boundMethod, cssNames, IClassName } from "../../utils"; import { observable, makeObservable } from "mobx"; export enum TooltipPosition { @@ -78,18 +78,18 @@ export class Tooltip extends React.Component { this.hoverTarget.removeEventListener("mouseleave", this.onLeaveTarget); } - @autobind() + @boundMethod protected onEnterTarget() { this.isVisible = true; this.refreshPosition(); } - @autobind() + @boundMethod protected onLeaveTarget() { this.isVisible = false; } - @autobind() + @boundMethod refreshPosition() { const { preferredPositions } = this.props; const { elem, targetElem } = this; @@ -199,7 +199,7 @@ export class Tooltip extends React.Component { }; } - @autobind() + @boundMethod bindRef(elem: HTMLElement) { this.elem = elem; } diff --git a/src/renderer/item.store.ts b/src/renderer/item.store.ts index 7aa6ff33c2..a0631dd47a 100644 --- a/src/renderer/item.store.ts +++ b/src/renderer/item.store.ts @@ -1,5 +1,5 @@ import orderBy from "lodash/orderBy"; -import { autobind, noop } from "./utils"; +import { autoBind, noop } from "./utils"; import { action, computed, observable, when, makeObservable } from "mobx"; export interface ItemObject { @@ -7,7 +7,6 @@ export interface ItemObject { getName(): string; } -@autobind() export abstract class ItemStore { abstract loadAll(...args: any[]): Promise; @@ -21,6 +20,7 @@ export abstract class ItemStore { constructor() { makeObservable(this); + autoBind(this); } @computed get selectedItems(): T[] { diff --git a/src/renderer/kube-object.store.ts b/src/renderer/kube-object.store.ts index 42ba553f51..dddbd87e4c 100644 --- a/src/renderer/kube-object.store.ts +++ b/src/renderer/kube-object.store.ts @@ -1,7 +1,7 @@ import type { ClusterContext } from "./components/context"; import { action, computed, observable, reaction, when, makeObservable } from "mobx"; -import { autobind, noop, rejectPromiseBy } from "./utils"; +import { autoBind, noop, rejectPromiseBy } from "./utils"; import { KubeObject, KubeStatus } from "./api/kube-object"; import { IKubeWatchEvent } from "./api/kube-watch-api"; import { ItemStore } from "./item.store"; @@ -16,7 +16,6 @@ export interface KubeObjectStoreLoadingParams { reqInit?: RequestInit; } -@autobind() export abstract class KubeObjectStore extends ItemStore { static defaultContext = observable.box(); // TODO: support multiple cluster contexts @@ -31,6 +30,7 @@ export abstract class KubeObjectStore extends ItemSt constructor() { super(); makeObservable(this); + autoBind(this); this.bindWatchEventsUpdater(); } diff --git a/src/renderer/protocol-handler/router.ts b/src/renderer/protocol-handler/router.ts index d1dc0ceafd..991df3abc9 100644 --- a/src/renderer/protocol-handler/router.ts +++ b/src/renderer/protocol-handler/router.ts @@ -2,7 +2,7 @@ import { ipcRenderer } from "electron"; import * as proto from "../../common/protocol-handler"; import logger from "../../main/logger"; import Url from "url-parse"; -import { autobind } from "../utils"; +import { boundMethod } from "../utils"; export class LensProtocolRouterRenderer extends proto.LensProtocolRouter { /** @@ -14,7 +14,7 @@ export class LensProtocolRouterRenderer extends proto.LensProtocolRouter { .on(proto.ProtocolHandlerExtension, this.ipcExtensionHandler); } - @autobind() + @boundMethod private ipcInternalHandler(event: Electron.IpcRendererEvent, ...args: any[]): void { if (args.length !== 1) { return void logger.warn(`${proto.LensProtocolRouter.LoggingPrefix}: unexpected number of args`, { args }); @@ -26,7 +26,7 @@ export class LensProtocolRouterRenderer extends proto.LensProtocolRouter { this._routeToInternal(url); } - @autobind() + @boundMethod private ipcExtensionHandler(event: Electron.IpcRendererEvent, ...args: any[]): void { if (args.length !== 1) { return void logger.warn(`${proto.LensProtocolRouter.LoggingPrefix}: unexpected number of args`, { args }); diff --git a/src/renderer/theme.store.ts b/src/renderer/theme.store.ts index 83aac8eb19..a088c1491a 100644 --- a/src/renderer/theme.store.ts +++ b/src/renderer/theme.store.ts @@ -1,5 +1,5 @@ import { computed, observable, reaction, makeObservable } from "mobx"; -import { autoBind, autobind, Singleton } from "./utils"; +import { autoBind, boundMethod, Singleton } from "./utils"; import { UserStore } from "../common/user-store"; import logger from "../main/logger"; @@ -77,7 +77,7 @@ export class ThemeStore extends Singleton { return this.allThemes.get(themeId); } - @autobind() + @boundMethod protected async loadTheme(themeId: ThemeId): Promise { try { const existingTheme = this.getThemeById(themeId); diff --git a/yarn.lock b/yarn.lock index 41fd213e27..5f1b5ad155 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2713,6 +2713,11 @@ auto-bind@^4.0.0: resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-4.0.0.tgz#e3589fc6c2da8f7ca43ba9f84fa52a744fc997fb" integrity sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ== +autobind-decorator@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/autobind-decorator/-/autobind-decorator-2.4.0.tgz#ea9e1c98708cf3b5b356f7cf9f10f265ff18239c" + integrity sha512-OGYhWUO72V6DafbF8PM8rm3EPbfuyMZcJhtm5/n26IDwO18pohE4eNazLoCGhPiXOCD0gEGmrbU3849QvM8bbw== + await-lock@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/await-lock/-/await-lock-2.1.0.tgz#bc78c51d229a34d5d90965a1c94770e772c6145e"