Skip to content
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

refactor: upgrade to react 19 #4549

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/builder/app/builder/shared/floating-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const useSideOffset = ({
side?: "left" | "right";
isOpen: boolean;
containerRef?: RefObject<null | HTMLElement>;
}): [RefObject<HTMLButtonElement>, number] => {
}): [RefObject<null | HTMLButtonElement>, number] => {
const triggerRef = useRef<null | HTMLButtonElement>(null);
const [sideOffset, setSideOffset] = useState(0);

Expand Down
6 changes: 4 additions & 2 deletions apps/builder/app/canvas/features/build-mode/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
$isPreviewMode,
$selectedInstanceSelector,
} from "~/shared/nano-states";
import type { InstanceSelector } from "~/shared/tree-utils";

export const Block = React.forwardRef<
HTMLDivElement,
Expand Down Expand Up @@ -61,8 +62,9 @@ export const Block = React.forwardRef<
return (
<div style={{ display: "contents" }} ref={ref} {...props}>
{childArray.filter((child) => {
const { instanceSelector } = child.props;

const { instanceSelector } = child.props as {
instanceSelector: InstanceSelector;
};
return instanceSelector[0] === templateInstanceId;
})}
</div>
Expand Down
10 changes: 5 additions & 5 deletions apps/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@
"nanostores": "^0.11.3",
"picocolors": "^1.1.0",
"pretty-bytes": "^6.1.1",
"react": "18.3.0-canary-14898b6a9-20240318",
"react": "19.0.0",
"react-colorful": "^5.6.1",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "19.0.0",
"react-error-boundary": "^4.1.2",
"react-script-hook": "^1.7.2",
"remix-auth": "^3.7.0",
Expand All @@ -126,12 +126,12 @@
"@remix-run/dev": "^2.15.0",
"@types/debug": "^4.1.12",
"@types/dom-navigation": "^1.0.4",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@webstudio-is/tsconfig": "workspace:*",
"html-tags": "^4.0.0",
"react-router-dom": "^6.28.0",
"react-test-renderer": "18.3.0-canary-14898b6a9-20240318",
"react-test-renderer": "19.0.0",
"type-fest": "^4.28.0",
"typescript": "5.7.2",
"vite": "^5.4.11",
Expand Down
8 changes: 4 additions & 4 deletions fixtures/ssg-netlify-by-project-id/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"private": true,
"sideEffects": false,
"devDependencies": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@vitejs/plugin-react": "^4.3.4",
"prettier": "3.4.2",
"typescript": "5.7.2",
Expand All @@ -37,8 +37,8 @@
"@webstudio-is/sdk-components-react": "workspace:*",
"@webstudio-is/sdk-components-react-radix": "workspace:*",
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"vike": "^0.4.206"
}
}
8 changes: 4 additions & 4 deletions fixtures/ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"private": true,
"sideEffects": false,
"devDependencies": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@vitejs/plugin-react": "^4.3.4",
"prettier": "3.4.2",
"typescript": "5.7.2",
Expand All @@ -37,8 +37,8 @@
"@webstudio-is/sdk-components-react": "workspace:*",
"@webstudio-is/sdk-components-react-radix": "workspace:*",
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"vike": "^0.4.206"
}
}
8 changes: 4 additions & 4 deletions fixtures/webstudio-cloudflare-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
"@webstudio-is/sdk-components-react-radix": "workspace:*",
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"isbot": "^5.1.17",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"webstudio": "workspace:*",
"worktop": "0.8.0-next.18",
"zod": "^3.22.4"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240620.0",
"@remix-run/dev": "2.15.0",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"typescript": "5.7.2",
"vite": "^5.4.11",
"wrangler": "^3.63.2"
Expand Down
8 changes: 4 additions & 4 deletions fixtures/webstudio-custom-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
"@webstudio-is/sdk-components-react-radix": "workspace:*",
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"isbot": "^5.1.17",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"web-vitals": "^3.5.2"
},
"devDependencies": {
"@remix-run/dev": "2.15.0",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"typescript": "5.7.2",
"vite": "^5.4.11",
"webstudio": "workspace:*"
Expand Down
8 changes: 4 additions & 4 deletions fixtures/webstudio-remix-netlify-edge-functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
"@webstudio-is/sdk-components-react-radix": "workspace:*",
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"isbot": "^5.1.17",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"private": true,
"sideEffects": false,
"devDependencies": {
"@remix-run/dev": "2.15.0",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"typescript": "5.7.2",
"vite": "^5.4.11",
"webstudio": "workspace:*"
Expand Down
8 changes: 4 additions & 4 deletions fixtures/webstudio-remix-netlify-functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"@webstudio-is/sdk-components-react-radix": "workspace:*",
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"isbot": "^5.1.17",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"private": true,
"sideEffects": false,
"devDependencies": {
"@remix-run/dev": "2.15.0",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"typescript": "5.7.2",
"vite": "^5.4.11",
"webstudio": "workspace:*"
Expand Down
8 changes: 4 additions & 4 deletions fixtures/webstudio-remix-vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
"@webstudio-is/sdk-components-react-radix": "workspace:*",
"@webstudio-is/sdk-components-react-remix": "workspace:*",
"isbot": "^5.1.17",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@remix-run/dev": "2.15.0",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"typescript": "5.7.2",
"vite": "^5.4.11",
"webstudio": "workspace:*"
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
"@types/css-tree": "^2.3.1",
"@types/eslint__js": "^8.42.3",
"@types/node": "^22.9.3",
"@types/react": "^18.2.70",
"@types/react": "^19.0.1",
"esbuild": "^0.24.0",
"eslint": "^9.16.0",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-unicorn": "^56.0.1",
"nano-staged": "^0.8.0",
"prettier": "3.4.2",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "19.0.0",
"react-dom": "19.0.0",
"simple-git-hooks": "^2.11.1",
"storybook": "^8.4.6",
"tsx": "^4.19.2",
Expand Down Expand Up @@ -78,10 +78,10 @@
},
"pnpm": {
"overrides": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318"
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2",
"react": "19.0.0",
"react-dom": "19.0.0"
},
"patchedDependencies": {
"@stitches/[email protected]": "patches/@[email protected]",
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@
"@remix-run/react": "^2.15.0",
"@remix-run/server-runtime": "^2.15.0",
"@types/node": "^22.9.3",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@types/yargs": "^17.0.33",
"@vitejs/plugin-react": "^4.3.4",
"@webstudio-is/tsconfig": "workspace:*",
"prettier": "3.4.2",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "19.0.0",
"react-dom": "19.0.0",
"ts-expect": "^1.3.0",
"vike": "^0.4.206",
"vite": "^5.4.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/html-to-jsx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test("Should not fail", async () => {
const result = await convertHtmlToJsxAndRenderToHtml(htmlCode);
expect(result).toMatchInlineSnapshot(`
"
<p><a><script src><scri pt>
<p><a><script><scri pt>
</script></a></p>"
`);
});
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/templates/defaults/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"@webstudio-is/image": "0.0.0-webstudio-version",
"@webstudio-is/sdk": "0.0.0-webstudio-version",
"isbot": "^5.1.17",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318"
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@remix-run/dev": "2.15.0",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"typescript": "5.7.2",
"vite": "^5.4.11"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/templates/ssg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"@webstudio-is/sdk-components-react": "0.0.0-webstudio-version",
"@webstudio-is/image": "0.0.0-webstudio-version",
"@webstudio-is/sdk": "0.0.0-webstudio-version",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"vike": "^0.4.206"
},
"devDependencies": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@vitejs/plugin-react": "^4.3.4",
"typescript": "5.7.2",
"vite": "^5.4.11"
Expand Down
8 changes: 4 additions & 4 deletions packages/css-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@webstudio-is/tsconfig": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "19.0.0",
"react-dom": "19.0.0",
"vitest": "^2.1.8"
},
"exports": {
Expand Down
8 changes: 4 additions & 4 deletions packages/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"test": "vitest run"
},
"devDependencies": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@webstudio-is/image": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "19.0.0",
"react-dom": "19.0.0",
"vitest": "^2.1.8",
"zod": "^3.22.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ type Props = ComponentProps<typeof ItemButton> & {
draggable?: boolean;
label: React.ReactElement;
thumbnail?: React.ReactElement;
buttons?: React.ReactElement;
buttons?: React.ReactElement<{ children: ReactNode }>;
// to support Radix trigger asChild
"data-state"?: "open";
// for Storybook purposes
Expand Down
8 changes: 4 additions & 4 deletions packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"devDependencies": {
"@svgo/jsx": "^0.4.2",
"@types/node": "^22.9.3",
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@webstudio-is/tsconfig": "workspace:*",
"change-case": "^5.4.4",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "19.0.0",
"react-dom": "19.0.0",
"svgo": "^3.0.2"
},
"peerDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"dts": "tsc --project tsconfig.dts.json"
},
"dependencies": {
"react": "18.3.0-canary-14898b6a9-20240318",
"react": "19.0.0",
"warn-once": "^0.1.1"
},
"devDependencies": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@webstudio-is/tsconfig": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "19.0.0",
"vitest": "^2.1.8"
},
"peerDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/react-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"test": "vitest run"
},
"devDependencies": {
"@types/react": "^18.2.70",
"@types/react-dom": "^18.2.25",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"@webstudio-is/tsconfig": "workspace:*",
"react": "18.3.0-canary-14898b6a9-20240318",
"react-dom": "18.3.0-canary-14898b6a9-20240318",
"react": "19.0.0",
"react-dom": "19.0.0",
"strip-indent": "^4.0.0",
"type-fest": "^4.28.0",
"vitest": "^2.1.8",
Expand Down
Loading
Loading