-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ban circular dependencies #3547
Conversation
fd0a4d8
to
06aed08
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
06aed08
to
f766899
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
9dd1454
to
409167d
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: Sebastian Malton <[email protected]>
Conflicts have been resolved. A maintainer will review the pull request shortly. |
@@ -30,7 +30,15 @@ import { ClusterFrameInfo, clusterFrameMap } from "../cluster-frames"; | |||
import type { Disposer } from "../utils"; | |||
import type remote from "@electron/remote"; | |||
|
|||
const electronRemote = ipcMain ? null : require("@electron/remote"); | |||
const electronRemote = (() => { | |||
if (ipcRenderer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is non-env-agnostic code in common, which is bad. However, the tooling to solve something like this is not here yet -> ok for now.
const electronRemote = ipcMain ? null : require("@electron/remote"); | ||
const electronRemote = (() => { | ||
if (ipcRenderer) { | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Add comment to explain the underlying very good reason for this wild-card try/catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code will be going away as soon as #4625 is merged so I don't think it is really necessary.
@@ -34,6 +34,9 @@ import type { IKubeWatchEvent } from "./kube-watch-api"; | |||
import { KubeJsonApi, KubeJsonApiData } from "./kube-json-api"; | |||
import { noop } from "../utils"; | |||
import type { RequestInit } from "node-fetch"; | |||
|
|||
// BUG: https://github.com/mysticatea/abort-controller/pull/22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could explain more about the relevancy of this bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there is the rule import/no-named-as-default
from eslint-import
which errors if (according to the typings) an default import uses the same name as a named non-default import because it might mean that you meant to import that instead.
However, in this case there is a bug in the "abort-controller" package where (even though according to the typings there is an export called "AbortController") in fact it is only default exported in the JS.
@@ -30,6 +30,9 @@ import { ensureObjectSelfLink, IKubeApiQueryParams, KubeApi } from "./kube-api"; | |||
import { parseKubeApi } from "./kube-api-parse"; | |||
import type { KubeJsonApiData } from "./kube-json-api"; | |||
import type { RequestInit } from "node-fetch"; | |||
|
|||
// BUG: https://github.com/mysticatea/abort-controller/pull/22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before.
@@ -62,7 +61,7 @@ export class KubeObjectDetails extends React.Component { | |||
.getStore(this.path) | |||
?.getByPath(this.path); | |||
} catch (error) { | |||
logger.error(`[KUBE-OBJECT-DETAILS]: failed to get store or object: ${error}`, { path: this.path }); | |||
console.error(`[KUBE-OBJECT-DETAILS]: failed to get store or object: ${error}`, { path: this.path }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Should not use explicit console.error instead of abstracted logger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I don't exactly remember why I did this since in #4317 I revert this back.... will revert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added mostly superficial comments. Mergeable without action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me, make lint
now takes 67s (was 17s) on mac, 54s (was 12s) on linux. Much better than 10m
Signed-off-by: Sebastian Malton [email protected]
This is the last in a long chain of PRs which all need to be merged before this one will pass. This was done to make reviewing each part easier.
The PRs are as follows and must be merged in order
The following PR: must also be merged before this one, but can be done out of order of the above:
blocked on above