Skip to content

Commit 92db71c

Browse files
committed
[ui] bump react 19
1 parent cf624af commit 92db71c

24 files changed

+1644
-1608
lines changed

quickwit/quickwit-ui/biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
"style": "off",
1313
"complexity": "off",
1414
"correctness": {
15-
"useExhaustiveDependencies": "warn"
15+
"useExhaustiveDependencies": "off"
1616
},
1717
"suspicious": {
18+
"noTsIgnore": "off",
1819
"useIterableCallbackReturn": "off",
1920
"noExplicitAny": "off",
2021
"noArrayIndexKey": "off"

quickwit/quickwit-ui/jest.config.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module.exports = {
2-
setupFiles: ["react-app-polyfill/jsdom"], // polyfill jsdom api (such as fetch)
2+
setupFiles: [
3+
"react-app-polyfill/jsdom", // polyfill jsdom api (such as fetch)
4+
"<rootDir>/jest/setup.js", // polyfill textEncode
5+
],
36

47
setupFilesAfterEnv: ["@testing-library/jest-dom"],
58

@@ -11,13 +14,13 @@ module.exports = {
1114
"babel-jest",
1215
{
1316
presets: [["babel-preset-react-app", { runtime: "automatic" }]],
17+
plugins: [
18+
["babel-plugin-transform-assets", { extensions: ["svg", "woff2"] }],
19+
],
1420
babelrc: false,
1521
configFile: false,
1622
},
1723
],
18-
19-
// transform asset files
20-
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "jest-transform-stub",
2124
},
2225

2326
moduleNameMapper: {

quickwit/quickwit-ui/jest/setup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
global.TextEncoder = require("util").TextEncoder;

quickwit/quickwit-ui/package.json

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,50 @@
77
"@babel/core": "7.28.5",
88
"@babel/runtime": "7.28.4",
99
"@biomejs/biome": "2.3.5",
10-
"@emotion/react": "11.11.1",
11-
"@emotion/styled": "11.11.0",
10+
"@emotion/react": "11.14.0",
11+
"@emotion/styled": "11.14.1",
1212
"@monaco-editor/react": "4.7.0",
13-
"@mui/icons-material": "5.11.0",
14-
"@mui/lab": "5.0.0-alpha.114",
15-
"@mui/material": "5.11.2",
16-
"@mui/system": "5.11.2",
17-
"@mui/x-charts": "7.3.2",
18-
"@mui/x-date-pickers": "5.0.12",
13+
"@mui/icons-material": "7.3.5",
14+
"@mui/lab": "7.0.1-beta.19",
15+
"@mui/material": "7.3.5",
16+
"@mui/system": "7.3.5",
17+
"@mui/x-charts": "8.18.0",
18+
"@mui/x-date-pickers": "8.18.0",
19+
"@testing-library/dom": "10.4.1",
1920
"@testing-library/jest-dom": "6.9.1",
20-
"@testing-library/react": "12.1.5",
21+
"@testing-library/react": "16.3.0",
2122
"@testing-library/user-event": "14.6.1",
2223
"@types/jest": "30.0.0",
2324
"@types/node": "20.8.7",
24-
"@types/react": "17.0.65",
25-
"@types/react-dom": "17.0.18",
26-
"@types/swagger-ui-react": "4.18.2",
25+
"@types/react": "19.2.6",
26+
"@types/react-dom": "19.2.3",
27+
"@types/swagger-ui-react": "5.18.0",
2728
"babel-jest": "30.2.0",
29+
"babel-plugin-transform-assets": "1.0.2",
2830
"babel-preset-react-app": "10.1.0",
2931
"cypress": "13.3.2",
3032
"dayjs": "1.11.7",
3133
"jest": "30.2.0",
3234
"jest-environment-jsdom": "30.2.0",
3335
"jest-transform-stub": "2.0.0",
34-
"monaco-editor": "0.34.1",
35-
"react": "17.0.2",
36+
"monaco-editor": "0.54.0",
37+
"react": "19.2.0",
3638
"react-app-polyfill": "3.0.0",
37-
"react-dom": "17.0.2",
38-
"react-number-format": "4.9.4",
39+
"react-dom": "19.2.0",
40+
"react-monaco-editor": "0.59.0",
41+
"react-number-format": "5.4.4",
42+
"react-router": "7.9.6",
3943
"react-router-dom": "6.6.1",
40-
"styled-components": "5.3.6",
41-
"styled-icons": "10.47.0",
42-
"swagger-ui-react": "5.9.0",
44+
"styled-components": "6.1.19",
45+
"styled-icons": "10.47.1",
46+
"swagger-ui-react": "5.30.2",
4347
"typescript": "5.9.3",
4448
"vite": "7.2.2",
4549
"web-vitals": "2.1.4"
4650
},
4751
"resolutions": {
48-
"@types/react": "17.0.65",
49-
"@types/react-dom": "17.0.18"
52+
"@types/react": "19.2.6",
53+
"@types/react-dom": "19.2.3"
5054
},
5155
"scripts": {
5256
"start": "vite",

quickwit/quickwit-ui/src/components/IndexSummary.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { Paper } from "@mui/material";
1717
import dayjs from "dayjs";
1818
import utc from "dayjs/plugin/utc";
1919
import { FC, ReactNode } from "react";
20-
import NumberFormat from "react-number-format";
20+
import { NumericFormat } from "react-number-format";
2121
import { Index } from "../utils/models";
2222

2323
dayjs.extend(utc);
@@ -85,14 +85,14 @@ export function IndexSummary({ index }: { index: Index }) {
8585
{index.metadata.index_config.index_uri}
8686
</IndexRow>
8787
<IndexRow title="Number of published documents:">
88-
<NumberFormat
88+
<NumericFormat
8989
value={total_num_docs}
9090
displayType={"text"}
9191
thousandSeparator={true}
9292
/>
9393
</IndexRow>
9494
<IndexRow title="Size of published documents (uncompressed):">
95-
<NumberFormat
95+
<NumericFormat
9696
value={total_uncompressed_num_bytes / 1000000}
9797
displayType={"text"}
9898
thousandSeparator={true}
@@ -104,7 +104,7 @@ export function IndexSummary({ index }: { index: Index }) {
104104
{published_splits.length}
105105
</IndexRow>
106106
<IndexRow title="Size of published splits:">
107-
<NumberFormat
107+
<NumericFormat
108108
value={total_num_bytes / 1000000}
109109
displayType={"text"}
110110
thousandSeparator={true}

quickwit/quickwit-ui/src/components/IndexesTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
} from "@mui/material";
2424
import dayjs from "dayjs";
2525
import utc from "dayjs/plugin/utc";
26-
import { useNavigate } from "react-router-dom";
26+
import { useNavigate } from "react-router";
2727
import { IndexMetadata } from "../utils/models";
2828

2929
dayjs.extend(utc);

quickwit/quickwit-ui/src/components/JsonEditor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
import { BeforeMount, Editor, OnMount } from "@monaco-editor/react";
1516
import { useCallback } from "react";
1617
import { EDITOR_THEME } from "../utils/theme";
17-
import { Editor, OnMount } from "@monaco-editor/react";
1818

1919
export function JsonEditor({
2020
content,
@@ -47,9 +47,9 @@ export function JsonEditor({
4747
[resizeOnMount],
4848
);
4949

50-
function beforeMount(monaco: any) {
50+
const beforeMount: BeforeMount = (monaco) => {
5151
monaco.editor.defineTheme("quickwit-light", EDITOR_THEME);
52-
}
52+
};
5353

5454
return (
5555
<Editor

quickwit/quickwit-ui/src/components/QueryEditor/QueryEditor.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
import { Editor } from "@monaco-editor/react";
1516
import { Box } from "@mui/material";
1617
import * as monacoEditor from "monaco-editor/esm/vs/editor/editor.api";
17-
import { useEffect, useRef, useState } from "react";
18-
import { Editor } from "@monaco-editor/react";
18+
import React, { useEffect, useRef, useState } from "react";
1919
import { SearchComponentProps } from "../../utils/SearchComponentProps";
2020
import { EDITOR_THEME } from "../../utils/theme";
2121
import {
2222
createIndexCompletionProvider,
2323
LANGUAGE_CONFIG,
2424
LanguageFeatures,
2525
} from "./config";
26-
import React from "react";
2726

2827
const QUICKWIT_EDITOR_THEME_ID = "quickwit-light";
2928

quickwit/quickwit-ui/src/components/SearchResult/AggregationResult.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import { BarChart } from "@mui/x-charts/BarChart";
1616
import { LineChart } from "@mui/x-charts/LineChart";
17-
import { CurveType } from "@mui/x-charts/models/seriesType/line";
1817
import {
1918
extractAggregationResults,
2019
HistogramResult,
@@ -38,22 +37,22 @@ export function AggregationResult({
3837
}) {
3938
const result = extractAggregationResults(searchResponse.aggregations);
4039
if (isHistogram(result)) {
41-
const xAxis = [
40+
const xAxis: React.ComponentProps<typeof LineChart>["xAxis"] = [
4241
{
4342
data: result.timestamps,
4443
valueFormatter: (date: number) => {
4544
return new Date(date).toISOString();
4645
},
4746
},
4847
];
49-
const series = result.data.map((line) => {
50-
const curve: CurveType = "monotoneX";
51-
return {
52-
curve,
53-
label: line.name,
54-
data: line.value,
55-
};
56-
});
48+
const series: React.ComponentProps<typeof LineChart>["series"] =
49+
result.data.map((line) => {
50+
return {
51+
curve: "monotoneX",
52+
label: line.name,
53+
data: line.value,
54+
};
55+
});
5756
// we don't customize colors because we would need a full palette.
5857
return <LineChart xAxis={xAxis} series={series} yAxis={[{ min: 0 }]} />;
5958
} else if (isTerm(result)) {

quickwit/quickwit-ui/src/components/SearchResult/SearchResult.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import { Box, Typography } from "@mui/material";
1616
import { useMemo } from "react";
17-
import NumberFormat from "react-number-format";
17+
import { NumericFormat } from "react-number-format";
1818
import { Index, ResponseError, SearchResponse } from "../../utils/models";
1919
import Loader from "../Loader";
2020
import ErrorResponseDisplay from "../ResponseErrorDisplay";
@@ -25,13 +25,13 @@ function HitCount({ searchResponse }: { searchResponse: SearchResponse }) {
2525
return (
2626
<Box>
2727
<Typography variant="body2" color="textSecondary">
28-
<NumberFormat
28+
<NumericFormat
2929
displayType="text"
3030
value={searchResponse.num_hits}
3131
thousandSeparator=","
3232
/>{" "}
3333
hits found in&nbsp;
34-
<NumberFormat
34+
<NumericFormat
3535
decimalScale={2}
3636
displayType="text"
3737
value={searchResponse.elapsed_time_micros / 1000000}

0 commit comments

Comments
 (0)