Skip to content

Commit 462eb82

Browse files
authored
[!] upgrade core webui dependencies (#1237)
- bump @mui/* packages to v6 - bump @tanstack/react-query to v5.75.0 - bump eslint to v9 and migrate to flat config format - bump typescript to v5.7 - update form and resolver libraries
1 parent b737955 commit 462eb82

10 files changed

Lines changed: 902 additions & 2302 deletions

File tree

internal/webui/.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

internal/webui/eslint.config.mjs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import js from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
import reactPlugin from "eslint-plugin-react";
4+
import reactHooksPlugin from "eslint-plugin-react-hooks";
5+
import prettierConfig from "eslint-config-prettier";
6+
7+
export default [
8+
js.configs.recommended,
9+
...tseslint.configs.recommended,
10+
{
11+
files: ["**/*.{ts,tsx,jsx}"],
12+
plugins: {
13+
react: reactPlugin,
14+
"react-hooks": reactHooksPlugin,
15+
},
16+
languageOptions: {
17+
parserOptions: {
18+
ecmaFeatures: {
19+
jsx: true,
20+
},
21+
},
22+
},
23+
settings: {
24+
react: {
25+
version: "detect",
26+
},
27+
},
28+
rules: {
29+
...reactPlugin.configs.recommended.rules,
30+
...reactHooksPlugin.configs.recommended.rules,
31+
"react/react-in-jsx-scope": "off",
32+
"react-hooks/set-state-in-effect": "off",
33+
"react-hooks/immutability": "off",
34+
},
35+
},
36+
prettierConfig,
37+
{
38+
ignores: [
39+
"dist/**",
40+
"node_modules/**",
41+
"build/**",
42+
"internal/serviceWorker.js",
43+
"internal/setupTests.ts",
44+
"internal/**/__tests__/**",
45+
"internal/**/test/**",
46+
],
47+
},
48+
];

internal/webui/package.json

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
"main": "index.js",
88
"scripts": {
99
"build": "vite build",
10-
"lint:cypress": "eslint --no-eslintrc --ext=ts -c cypress/.eslintrc cypress/e2e",
11-
"lint:fix": "eslint --ext=jsx,ts,tsx src --fix",
10+
"lint:fix": "eslint src --fix",
1211
"lint:quick": "yarn lint:ts --cache",
13-
"lint:ts": "eslint --ext=jsx,ts,tsx src",
12+
"lint:ts": "eslint src",
1413
"preview": "vite preview",
1514
"start": "vite"
1615
},
@@ -26,64 +25,50 @@
2625
"last 1 safari version"
2726
]
2827
},
29-
"eslintConfig": {
30-
"extends": [
31-
"eslint:recommended",
32-
"plugin:@typescript-eslint/recommended"
33-
]
34-
},
3528
"resolutions": {
36-
"brace-expansion": "^2.0.2",
3729
"cookie": "^0.7.0",
38-
"form-data": "^4.0.0",
39-
"on-headers": "^1.1.0",
40-
"path-to-regexp": "^0.1.12",
41-
"postcss": "^8.4.31",
42-
"serialize-javascript": "^6.0.2",
43-
"webpack-dev-server": "^5.2.1"
30+
"postcss": "^8.4.31"
4431
},
4532
"dependencies": {
46-
"@emotion/react": "^11.9.3",
47-
"@emotion/styled": "^11.9.3",
48-
"@hookform/resolvers": "^3.3.4",
49-
"@mui/icons-material": "^5.16.9",
50-
"@mui/lab": "^5.0.0-alpha.176",
51-
"@mui/material": "^5.16.9",
52-
"@mui/system": "^5.16.7",
33+
"@emotion/react": "^11.14.0",
34+
"@emotion/styled": "^11.14.0",
35+
"@hookform/resolvers": "^5.0.1",
36+
"@mui/icons-material": "^6.5.0",
37+
"@mui/material": "^6.5.0",
38+
"@mui/system": "^6.5.0",
5339
"@mui/x-data-grid": "^7.29.8",
54-
"@tanstack/react-query": "^4.24.4",
40+
"@tanstack/react-query": "^5.75.0",
5541
"axios": "^1.13.5",
5642
"classnames": "^2.5.1",
57-
"form-data": "^4.0.4",
58-
"moment": "^2.29.4",
43+
"form-data": "^4.0.0",
5944
"react": "^18.2.0",
6045
"react-dom": "^18.2.0",
61-
"react-hook-form": "^7.43.1",
46+
"react-hook-form": "^7.55.0",
6247
"react-markdown": "^10.1.0",
6348
"react-router-dom": "6.8.1",
6449
"react-use-websocket": "^4.5.0",
6550
"tss-react": "^4.9.6",
66-
"typescript": "^4.9.5",
51+
"typescript": "^5.7.0",
6752
"yaml": "^2.4.1",
6853
"yup": "^1.4.0"
6954
},
7055
"devDependencies": {
71-
"@types/eslint": "^8.21.0",
72-
"@types/node": "^18.13.0",
73-
"@types/react": "^18.0.27",
74-
"@types/react-dom": "^18.0.10",
75-
"@types/react-router-dom": "^5.3.3",
56+
"@eslint/js": "^9.27.0",
57+
"@types/node": "^22.15.0",
58+
"@types/react": "^18.3.28",
59+
"@types/react-dom": "^18.3.7",
7660
"@typescript-eslint/eslint-plugin": "^8.54.0",
7761
"@typescript-eslint/parser": "^8.54.0",
7862
"@vitejs/plugin-react": "^5.1.3",
7963
"cross-env": "^10.1.0",
80-
"eslint": "^8.33.0",
81-
"eslint-config-prettier": "^8.6.0",
64+
"eslint": "^9.27.0",
65+
"eslint-config-prettier": "^10.1.0",
8266
"eslint-plugin-import": "^2.32.0",
83-
"eslint-plugin-prettier": "^4.2.1",
67+
"eslint-plugin-prettier": "^5.4.0",
8468
"eslint-plugin-react": "^7.37.5",
8569
"eslint-plugin-react-hooks": "^7.0.1",
86-
"prettier": "2.8.4",
70+
"prettier": "^3.5.0",
71+
"typescript-eslint": "^8.54.0",
8772
"vite": "^7.3.1",
8873
"vite-plugin-svgr": "^4.5.0",
8974
"vite-tsconfig-paths": "^6.0.5"

internal/webui/src/QueryClient.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const QueryClientProvider = ({ children }: Props) => {
2828
onSuccess: (_data, _variables, _context, mutation) => {
2929
callAlert("success", "Success");
3030
if (mutation.options.mutationKey) {
31-
queryClient.invalidateQueries(mutation.options.mutationKey);
31+
queryClient.invalidateQueries({ queryKey: mutation.options.mutationKey });
3232
}
3333
},
3434
onError: (error) => {
@@ -43,7 +43,7 @@ export const QueryClientProvider = ({ children }: Props) => {
4343
});
4444

4545
return (
46-
<ClientProvider client={queryClient} contextSharing={true}>
46+
<ClientProvider client={queryClient}>
4747
{children}
4848
</ClientProvider>
4949
);

internal/webui/src/containers/MetricFormDialog/MetricFormDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export const MetricFormDialog = () => {
3636
[addMetric.isSuccess, editMetric.isSuccess],
3737
);
3838
const isLoading = useMemo(
39-
() => addMetric.isLoading || editMetric.isLoading,
40-
[addMetric.isLoading, editMetric.isLoading],
39+
() => addMetric.isPending || editMetric.isPending,
40+
[addMetric.isPending, editMetric.isPending],
4141
);
4242

4343
useEffect(() => {

internal/webui/src/containers/PresetFormDialog/PresetFormDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export const PresetFormDialog = () => {
3131
[addPreset.isSuccess, editPreset.isSuccess],
3232
);
3333
const isLoading = useMemo(
34-
() => addPreset.isLoading || editPreset.isLoading,
35-
[addPreset.isLoading, editPreset.isLoading]
34+
() => addPreset.isPending || editPreset.isPending,
35+
[addPreset.isPending, editPreset.isPending]
3636
);
3737

3838
useEffect(() => {

internal/webui/src/containers/SourceFormDialog/SourceFormDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export const SourceFormDialog = () => {
5858
};
5959

6060
const isLoading = useMemo(
61-
() => addSource.isLoading || editSource.isLoading,
62-
[addSource.isLoading, editSource.isLoading],
61+
() => addSource.isPending || editSource.isPending,
62+
[addSource.isPending, editSource.isPending],
6363
);
6464

6565
return (

internal/webui/src/containers/SourceFormDialog/components/SourceForm/components/TestConnection/TestConnection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const TestConnection = ({ ConnStr }: Props) => {
1515

1616
return (
1717
<Tooltip title="Test connection">
18-
<IconButton onClick={handleTestConnection} disabled={testConnection.isLoading}>
18+
<IconButton onClick={handleTestConnection} disabled={testConnection.isPending}>
1919
<CableIcon />
2020
</IconButton>
2121
</Tooltip>

internal/webui/tsconfig.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
"noImplicitThis": true,
1919
"noImplicitAny": true,
2020
"strictNullChecks": true,
21-
//"suppressImplicitAnyIndexErrors": true,
22-
"ignoreDeprecations": "5.0",
2321
"allowSyntheticDefaultImports": true,
2422
"esModuleInterop": true,
2523
"skipLibCheck": true,

0 commit comments

Comments
 (0)