Skip to content

Commit edd226f

Browse files
committed
feat: Upgrade react to 19 and apply codemods
1 parent b520bfc commit edd226f

File tree

9 files changed

+1591
-1554
lines changed

9 files changed

+1591
-1554
lines changed

app/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
"lodash": "^4.17.21",
4343
"normalize.css": "^8.0.1",
4444
"polished": "^4.3.1",
45-
"react": "~18.3.1",
45+
"react": "19.2.0",
4646
"react-aria": "^3.44.0",
4747
"react-aria-components": "^1.13.0",
48-
"react-dom": "~18.3.1",
48+
"react-dom": "19.2.0",
4949
"react-error-boundary": "^4.1.2",
5050
"react-hook-form": "^7.62.0",
5151
"react-hotkeys-hook": "^4.6.2",
@@ -85,15 +85,15 @@
8585
"@types/json-schema": "^7.0.15",
8686
"@types/lodash": "^4.17.20",
8787
"@types/node": "^22.17.0",
88-
"@types/react": "18.3.10",
89-
"@types/react-dom": "^18.3.7",
88+
"@types/react": "19.2.0",
89+
"@types/react-dom": "19.2.0",
9090
"@types/react-relay": "^18.2.1",
9191
"@types/recharts": "^1.8.29",
92-
"@types/relay-runtime": "^19.0.2",
92+
"@types/relay-runtime": "^19.0.3",
9393
"@types/three": "^0.149.0",
9494
"@typescript-eslint/eslint-plugin": "^7.18.0",
9595
"@typescript-eslint/parser": "^7.18.0",
96-
"@vitejs/plugin-react": "^4.7.0",
96+
"@vitejs/plugin-react": "^5.0.4",
9797
"babel-plugin-relay": "^19.0.0",
9898
"chromatic": "^11.29.0",
9999
"cpy-cli": "^5.0.0",

app/pnpm-lock.yaml

Lines changed: 1577 additions & 1542 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/components/CopyToClipboardButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export type CopyToClipboardButtonProps = Omit<
2525
/**
2626
* The text to copy to the clipboard
2727
*/
28-
text: string | RefObject<string>;
28+
text: string | RefObject<string | null>;
2929
};
3030

3131
const copyToClipboardButtonCSS = css`

app/src/components/generative/ToolChoiceSelector.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import {
2020
} from "@phoenix/schemas/toolChoiceSchemas";
2121
import { assertUnreachable, isObject } from "@phoenix/typeUtils";
2222

23+
import type { JSX } from "react";
24+
2325
/**
2426
* The "default" tool choices for each provider
2527
* Default just means choices we an always render without knowing any tool names

app/src/components/listbox/ListBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function ListBox<T extends object>(
7777

7878
type ListBoxComponent = <T extends object>(
7979
props: ListBoxProps<T> & React.RefAttributes<HTMLDivElement>
80-
) => React.ReactElement | null;
80+
) => React.ReactElement<any> | null;
8181

8282
const _ListBox = forwardRef(ListBox) as ListBoxComponent;
8383
export { _ListBox as ListBox };

app/src/components/tag/TagList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { forwardRef, Ref } from "react";
1+
import { forwardRef, Ref, type JSX } from "react";
22
import { TagList as AriaTagList, TagListProps } from "react-aria-components";
33
import { css } from "@emotion/react";
44

app/src/hooks/useDimensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type MaybeDimensions = Dimensions | null;
1212
* @param ref - The ref of the element
1313
* @returns The dimensions of the element
1414
*/
15-
export const useDimensions = (ref: React.RefObject<HTMLElement>) => {
15+
export const useDimensions = (ref: React.RefObject<HTMLElement | null>) => {
1616
const [dimensions, setDimensions] = useState<MaybeDimensions>(null);
1717

1818
useEffect(() => {

app/src/pages/experiment/ExperimentCompareTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ function TableBody<T>({
708708
tableContainerRef,
709709
}: {
710710
table: Table<T>;
711-
tableContainerRef: RefObject<HTMLDivElement>;
711+
tableContainerRef: RefObject<HTMLDivElement | null>;
712712
}) {
713713
const rows = table.getRowModel().rows;
714714
const virtualizer = useVirtualizer({

app/stories/Icons.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const meta: Meta = {
1111
export default meta;
1212

1313
function IconsGrid() {
14-
const iconsArray: ReactElement[] = [];
14+
const iconsArray: ReactElement<unknown>[] = [];
1515

1616
Object.keys(Icons).forEach((name) => {
1717
const iconKey = name as keyof typeof Icons;

0 commit comments

Comments
 (0)