mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Upgrade to electron@^19 (#5369)
* Upgrade to use electron 19.0.4 - Update documentation - Updated disturl in .yarnrc to fix build issue - Remove use of abort-controller package Signed-off-by: Sebastian Malton <sebastian@malton.name> * Remove support for webview tags Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
edacf3bec6
commit
6d37019089
18 files changed
+84
-134
No files matched your search
@@ -6,7 +6,6 @@
|
||||
import { forRemoteCluster, KubeApi } from "../kube-api";
|
||||
import { KubeJsonApi } from "../kube-json-api";
|
||||
import { KubeObject } from "../kube-object";
|
||||
import AbortController from "abort-controller";
|
||||
import { delay } from "../../utils/delay";
|
||||
import { PassThrough } from "stream";
|
||||
import { ApiManager } from "../api-manager";
|
||||
|
||||
@@ -19,7 +19,6 @@ import { KubeJsonApi } from "./kube-json-api";
|
||||
import type { Disposer } from "../utils";
|
||||
import { isDefined, noop, WrappedAbortController } from "../utils";
|
||||
import type { RequestInit } from "node-fetch";
|
||||
import type AbortController from "abort-controller";
|
||||
import type { AgentOptions } from "https";
|
||||
import { Agent } from "https";
|
||||
import type { Patch } from "rfc6902";
|
||||
@@ -29,6 +28,9 @@ import logger from "../logger";
|
||||
import { Environments, getEnvironmentSpecificLegacyGlobalDiForExtensionApi } from "../../extensions/as-legacy-globals-for-extension-api/legacy-global-di-for-extension-api";
|
||||
import autoRegistrationEmitterInjectable from "./api-manager/auto-registration-emitter.injectable";
|
||||
|
||||
// TODO: upgrade node-fetch once we are starting to use ES modules
|
||||
type LegacyAbortSignal = NonNullable<RequestInit["signal"]>;
|
||||
|
||||
/**
|
||||
* The options used for creating a `KubeApi`
|
||||
*/
|
||||
@@ -717,7 +719,7 @@ export class KubeApi<
|
||||
const requestParams = timeout ? { query: { timeoutSeconds: timeout }} : {};
|
||||
const watchUrl = this.getWatchUrl(namespace);
|
||||
const responsePromise = this.request.getResponse(watchUrl, requestParams, {
|
||||
signal: abortController.signal,
|
||||
signal: abortController.signal as LegacyAbortSignal,
|
||||
timeout: 600_000,
|
||||
});
|
||||
|
||||
|
||||
@@ -15,13 +15,15 @@ import { ItemStore } from "../item.store";
|
||||
import type { KubeApiQueryParams, KubeApi, KubeApiWatchCallback } from "./kube-api";
|
||||
import { parseKubeApi } from "./kube-api-parse";
|
||||
import type { RequestInit } from "node-fetch";
|
||||
import AbortController from "abort-controller";
|
||||
import type { Patch } from "rfc6902";
|
||||
import logger from "../logger";
|
||||
import assert from "assert";
|
||||
import type { PartialDeep } from "type-fest";
|
||||
import { entries } from "../utils/objects";
|
||||
|
||||
// TODO: upgrade node-fetch once we are starting to use ES modules
|
||||
type LegacyAbortSignal = NonNullable<RequestInit["signal"]>;
|
||||
|
||||
export type OnLoadFailure = (error: unknown) => void;
|
||||
|
||||
export interface KubeObjectStoreLoadingParams {
|
||||
@@ -477,7 +479,8 @@ export abstract class KubeObjectStore<
|
||||
callback,
|
||||
});
|
||||
|
||||
const { signal } = abortController;
|
||||
// TODO: upgrade node-fetch once we are starting to use ES modules
|
||||
const signal = abortController.signal as LegacyAbortSignal;
|
||||
|
||||
const callback: KubeApiWatchCallback<D> = (data, error) => {
|
||||
if (!this.isLoaded || error?.type === "aborted") return;
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import AbortController from "abort-controller";
|
||||
|
||||
/**
|
||||
* This is like an `AbortController` but will also abort if the parent aborts,
|
||||
* but won't make the parent abort if this aborts (single direction)
|
||||
*/
|
||||
export class WrappedAbortController extends AbortController {
|
||||
constructor(parent?: AbortController) {
|
||||
constructor(parent?: AbortController | undefined) {
|
||||
super();
|
||||
|
||||
parent?.signal.addEventListener("abort", () => {
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { AbortController } from "abort-controller";
|
||||
|
||||
/**
|
||||
* Return a promise that will be resolved after at least `timeout` ms have
|
||||
* passed. If `failFast` is provided then the promise is also resolved if it has
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { AbortSignal } from "abort-controller";
|
||||
|
||||
/**
|
||||
* Creates a new promise that will be rejected when the signal rejects.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user