Skip to content

Commit

Permalink
Use @mui/x-charts-vendor for d3 upgrade (#4508)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin authored Aug 1, 2024
1 parent 1183382 commit 22b48ac
Show file tree
Hide file tree
Showing 128 changed files with 1,128 additions and 1,020 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
caughtErrors: 'none',
},
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/restrict-template-expressions': 'off',
Expand All @@ -55,6 +59,8 @@ module.exports = {
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-require-imports': 'off',

'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
Expand Down
1 change: 0 additions & 1 deletion .ignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ test_data/yeast_synteny/
test_data/hg38_aliases.txt
test_data/honeybee/config.json
test_data/honeybee/amel_hav3.1.chrom.sizes
plugins/wiggle/src/util.ts
plugins/protein/src/ProteinReferenceSequenceRenderer/aminoAcids.js
plugins/spreadsheet-view/src/SpreadsheetView/test_data/starfusion_example.fusion_predictions.tsv
products/jbrowse-aws-lambda-functions/
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
"@types/set-value": "^4.0.1",
"@types/string-template": "^1.0.2",
"@types/tmp": "^0.2.1",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"babel-loader": "^9.1.0",
"body-parser": "^1.20.2",
"browserslist": "^4.18.1",
Expand All @@ -101,7 +101,7 @@
"dependency-graph": "^1.0.0",
"dotenv": "^16.3.1",
"dotenv-expand": "^11.0.3",
"electron": "31.2.1",
"electron": "31.3.1",
"electron-builder": "^24.9.0",
"electron-mock-ipc": "^0.3.8",
"eslint": "^8.0.0",
Expand All @@ -111,7 +111,7 @@
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-react-refresh": "^0.4.3",
"eslint-plugin-tsdoc": "^0.3.0",
"eslint-plugin-unicorn": "^54.0.0",
"eslint-plugin-unicorn": "^55.0.0",
"express": "^4.18.2",
"express-basic-auth": "^1.2.1",
"file-loader": "^6.2.0",
Expand All @@ -138,7 +138,7 @@
"react-dom": "^18.0.0",
"react-refresh": "^0.14.0",
"requestidlecallback-polyfill": "^1.0.2",
"rimraf": "^5.0.0",
"rimraf": "^6.0.1",
"rxjs": "^7.0.0",
"semver": "^7.3.4",
"slugify": "^1.6.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const useStyles = makeStyles()(theme => ({

export default function BasicValue({ value }: { value: unknown }) {
const { classes } = useStyles()
const isLink = `${value}`.match(/^https?:\/\//)
const isLink = /^https?:\/\//.exec(`${value}`)
return (
<div className={classes.fieldValue}>
{React.isValidElement(value) ? (
Expand Down
1 change: 1 addition & 0 deletions packages/core/PluginManager.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
import {
isModelType,
isType,
Expand Down
2 changes: 0 additions & 2 deletions packages/core/assemblyManager/assemblyConfigSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ function assemblyConfigSchema(pluginManager: PluginManager) {
{
preProcessSnapshot: snap => {
// allow refNameAliases to be unspecified
// @ts-expect-error
if (!snap.adapter) {
return { adapter: { type: 'RefNameAliasAdapter' } }
}
Expand All @@ -73,7 +72,6 @@ function assemblyConfigSchema(pluginManager: PluginManager) {
{
preProcessSnapshot: snap => {
// allow cytoBand to be unspecified
// @ts-expect-error
if (!snap.adapter) {
return { adapter: { type: 'CytobandAdapter' } }
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/assemblyManager/assemblyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ function assemblyManagerFactory(conf: IAnyType, pm: PluginManager) {
!!assembly?.error,
)
if (assembly.error) {
// eslint-disable-next-line @typescript-eslint/only-throw-error
throw assembly.error
}
return assembly
Expand Down
4 changes: 3 additions & 1 deletion packages/core/configuration/configurationSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export interface ConfigurationSchemaOptions<
actions?: (self: unknown) => any
views?: (self: unknown) => any
extend?: (self: unknown) => any
preProcessSnapshot?: (snapshot: {}) => {}
preProcessSnapshot?: (
snapshot: Record<string, unknown>,
) => Record<string, unknown>
}

function preprocessConfigurationSchemaArguments(
Expand Down
5 changes: 4 additions & 1 deletion packages/core/pluggableElementTypes/RpcMethodType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export default abstract class RpcMethodType extends PluggableElementBase {
super({})
}

async serializeArguments(args: {}, rpcDriverClassName: string): Promise<{}> {
async serializeArguments(
args: Record<string, unknown>,
rpcDriverClassName: string,
): Promise<Record<string, unknown>> {
const blobMap = getBlobMap()
await this.augmentLocationObjects(args, rpcDriverClassName)
return { ...args, blobMap }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ function stateModelFactory() {
*/
get RenderingComponent(): React.FC<{
model: typeof self
onHorizontalScroll?: Function
onHorizontalScroll?: () => void
blockState?: Record<string, any>
}> {
const { pluginManager } = getEnv(self)
const displayType = pluginManager.getDisplayType(self.type)
return displayType.ReactComponent as React.FC<{
return pluginManager.getDisplayType(self.type)
.ReactComponent as React.FC<{
model: typeof self
onHorizontalScroll?: Function
onHorizontalScroll?: () => void
blockState?: Record<string, any>
}>
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ import { dedupe, getSerializedSvg } from '../../util'
import { firstValueFrom } from 'rxjs'

export interface RenderArgs extends ServerSideRenderArgs {
displayModel: {}
displayModel: Record<string, unknown>
blockKey: string
}

export interface RenderArgsSerialized extends ServerSideRenderArgsSerialized {
displayModel: {}
displayModel: Record<string, unknown>
blockKey: string
}

export interface RenderArgsDeserialized
extends ServerSideRenderArgsDeserialized {
displayModel: {}
displayModel: Record<string, unknown>
blockKey: string
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ const NewHydrate = observer(function RpcRenderedSvgGroup(props: Props) {
)
})
return () => {
clearTimeout(renderTimeout)
if (renderTimeout !== undefined) {
clearTimeout(renderTimeout)
}
const root = rootRef.current
rootRef.current = undefined

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ const NewHydrate = observer(function ServerSideRenderedContent({
)
})
return () => {
clearTimeout(renderTimeout)
if (renderTimeout !== undefined) {
clearTimeout(renderTimeout)
}
const root = rootRef.current
rootRef.current = undefined

Expand Down
9 changes: 7 additions & 2 deletions packages/core/rpc/MainThreadRpcDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class DummyHandle {

async call(
_functionName: string,
_filteredArgs?: {},
_filteredArgs?: Record<string, unknown>,
_options = {},
): Promise<unknown> {
return undefined
Expand All @@ -28,7 +28,12 @@ export default class MainThreadRpcDriver extends BaseRpcDriver {
this.makeWorker = async (): Promise<DummyHandle> => new DummyHandle()
}

async call(pm: PluginManager, sessionId: string, funcName: string, args: {}) {
async call(
pm: PluginManager,
sessionId: string,
funcName: string,
args: Record<string, unknown>,
) {
if (!sessionId) {
throw new TypeError('sessionId is required')
}
Expand Down
8 changes: 7 additions & 1 deletion packages/core/rpc/RpcManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface BackendConfigurations {
'config'
>
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const DriverClasses = {
WebWorkerRpcDriver,
MainThreadRpcDriver,
Expand Down Expand Up @@ -86,7 +87,12 @@ export default class RpcManager {
return this.getDriver(backendName)
}

async call(sessionId: string, functionName: string, args: {}, opts = {}) {
async call(
sessionId: string,
functionName: string,
args: Record<string, unknown>,
opts = {},
) {
if (!sessionId) {
throw new Error('sessionId is required')
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/rpc/methods/CoreFreeResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { freeAdapterResources } from '../../data_adapters/dataAdapterCache'
export default class CoreFreeResources extends RpcMethodType {
name = 'CoreFreeResources'

async execute(specification: {}) {
async execute(specification: Record<string, unknown>) {
let deleteCount = 0

deleteCount += freeAdapterResources(specification)
Expand All @@ -25,7 +25,7 @@ export default class CoreFreeResources extends RpcMethodType {

return deleteCount
}
async serializeArguments(args: {}, _rpcDriver: string): Promise<{}> {
async serializeArguments(args: Record<string, unknown>, _rpcDriver: string) {
return args
}
}
2 changes: 1 addition & 1 deletion packages/core/rpc/methods/CoreGetFeatureDensityStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class CoreGetFeatureDensityStats extends RpcMethodType {

async execute(
args: {
adapterConfig: {}
adapterConfig: Record<string, unknown>
regions: Region[]
signal?: RemoteAbortSignal
headers?: Record<string, string>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/rpc/methods/CoreGetFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class CoreGetFeatures extends RpcMethodType {
args: {
sessionId: string
regions: Region[]
adapterConfig: {}
adapterConfig: Record<string, unknown>
signal?: RemoteAbortSignal
// eslint-disable-next-line @typescript-eslint/no-explicit-any
opts?: any
Expand Down
2 changes: 1 addition & 1 deletion packages/core/rpc/methods/CoreGetFileInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class CoreGetFileInfo extends RpcMethodType {
args: {
sessionId: string
signal: RemoteAbortSignal
adapterConfig: {}
adapterConfig: Record<string, unknown>
},
rpcDriver: string,
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/rpc/methods/CoreGetMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class CoreGetMetadata extends RpcMethodType {
args: {
sessionId: string
signal: RemoteAbortSignal
adapterConfig: {}
adapterConfig: Record<string, unknown>
},
rpcDriver: string,
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/rpc/methods/CoreGetRefNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class CoreGetRefNames extends RpcMethodType {
args: {
sessionId: string
signal: RemoteAbortSignal
adapterConfig: {}
adapterConfig: Record<string, unknown>
},
rpcDriver: string,
) {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/rpc/methods/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {
import { Region } from '../../util'

export interface RenderArgs extends ServerSideRenderArgs {
adapterConfig: {}
adapterConfig: Record<string, unknown>
rendererType: string
}

export interface RenderArgsSerialized extends ServerSideRenderArgsSerialized {
assemblyName: string
regions: Region[]
adapterConfig: {}
adapterConfig: Record<string, unknown>
rendererType: string
}

Expand Down
1 change: 1 addition & 0 deletions packages/core/ui/CascadingMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
import React, { useContext, useMemo } from 'react'
import {
Divider,
Expand Down
6 changes: 3 additions & 3 deletions packages/core/ui/ErrorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ function parseError(str: string) {
// mobx-state-tree

// case 1. element has a path
const match = trim.match(
/.*at path "(.*)" snapshot `(.*)` is not assignable/m,
const match = /.*at path "(.*)" snapshot `(.*)` is not assignable/m.exec(
trim,
)
if (match) {
str = `Failed to load element at ${match[1]}...Failed element had snapshot`
snapshotError = match[2]
}

// case 2. element has no path
const match2 = trim.match(/.*snapshot `(.*)` is not assignable/)
const match2 = /.*snapshot `(.*)` is not assignable/.exec(trim)
if (match2) {
str = `Failed to load element...Failed element had snapshot`
snapshotError = match2[1]
Expand Down
2 changes: 1 addition & 1 deletion packages/core/ui/FactoryResetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function FactoryResetDialog({
}: {
onClose: () => void
open: boolean
onFactoryReset: Function
onFactoryReset: () => void
}) {
function handleDialogClose(action?: string) {
if (action === 'reset') {
Expand Down
Loading

0 comments on commit 22b48ac

Please sign in to comment.