Skip to content

Commit f672f3e

Browse files
authored
fix: move react dependencies to be peer dependencies (#91)
This PR moves react and react-dom to be peer dependencies, solving issues like #90 where there is a mismatch in React versions between the library and the host. This kind of move is usually a breaking change - but since we can assume that all the consumers of the React SDK already have React installed in their dependencies (since they need to render <UIResourceRenderer> somehow) - this might not be a problem.
1 parent b2fc647 commit f672f3e

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

pnpm-lock.yaml

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

sdks/typescript/client/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
"@quilted/threads": "^3.1.3",
2424
"@r2wc/react-to-web-component": "^2.0.4",
2525
"@remote-dom/core": "^1.8.0",
26-
"@remote-dom/react": "^1.2.2",
27-
"react": "^18.3.1",
28-
"react-dom": "^18.3.1"
26+
"@remote-dom/react": "^1.2.2"
2927
},
3028
"devDependencies": {
3129
"@testing-library/jest-dom": "^6.0.0",
@@ -34,12 +32,18 @@
3432
"@vitejs/plugin-react": "^4.0.0",
3533
"esbuild": "^0.25.5",
3634
"jsdom": "^22.0.0",
35+
"react": "^18.3.1",
36+
"react-dom": "^18.3.1",
3737
"rimraf": "^6.0.1",
3838
"typescript": "^5.0.0",
3939
"vite": "^5.0.0",
4040
"vite-plugin-dts": "^3.6.0",
4141
"vitest": "^1.0.0"
4242
},
43+
"peerDependencies": {
44+
"react": "^18 || ^19",
45+
"react-dom": "^18 || ^19"
46+
},
4347
"scripts": {
4448
"prepublishOnly": "pnpm run build",
4549
"build": "pnpm run clean && pnpm run bundle:iframe && tsc && vite build && pnpm run build:wc",
@@ -82,4 +86,4 @@
8286
]
8387
},
8488
"license": "Apache-2.0"
85-
}
89+
}

0 commit comments

Comments
 (0)