Skip to content

Commit 62906a9

Browse files
authored
feat: react 19 support (#727)
* feat: react 19 support * fix: tests * fix: prettier * chore: fix package ordering * feat: update to non-rc versions
1 parent 09c7847 commit 62906a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+8080
-12379
lines changed

.changeset/empty-pears-suffer.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@react-three/rapier-addons": minor
3+
"@react-three/rapier": minor
4+
---
5+
6+
feat: remove deprecated Vector3Array, Vector4Array, Boolean3Array types
7+
8+
use Vector3Tuple, Vector4Tuple, Boolean3Tuple instead

.changeset/pre.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"mode": "pre",
3+
"tag": "canary",
4+
"initialVersions": {
5+
"demo": "0.0.0",
6+
"@react-three/rapier": "1.5.0",
7+
"@react-three/rapier-addons": "4.0.1"
8+
},
9+
"changesets": []
10+
}

.changeset/rude-keys-carry.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@react-three/rapier-addons": major
3+
"@react-three/rapier": major
4+
---
5+
6+
feat: react 19 support

.github/workflows/r3-rapier-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Setup Node.js environment
3535
uses: actions/[email protected]
3636
with:
37-
node-version: 18.x
37+
node-version: 22.x
3838

3939
- name: Enable corepack
4040
run: corepack enable

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
- name: Checkout Repo
1616
uses: actions/checkout@v3
1717

18-
- name: Setup Node.js 18.x
18+
- name: Setup Node.js 22.x
1919
uses: actions/setup-node@v3
2020
with:
21-
node-version: 18
21+
node-version: 22
2222

2323
- name: Install Dependencies
2424
run: yarn --immutable

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v3
15-
- name: Setup Node.js 18.x
15+
- name: Setup Node.js 22.x
1616
uses: actions/setup-node@v3
1717
with:
18-
node-version: 18
18+
node-version: 22
1919

2020
- name: Enable corepack
2121
run: corepack enable

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v22.0.0

demo/package.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,25 @@
99
"preview": "vite preview"
1010
},
1111
"dependencies": {
12-
"@react-three/csg": "1.1.5",
13-
"@react-three/drei": "9.112.0",
14-
"@react-three/fiber": "8.17.7",
12+
"@react-three/csg": "3.3.0",
13+
"@react-three/drei": "10.0.1",
14+
"@react-three/fiber": "9.0.4",
1515
"@react-three/rapier": "1.5.0",
1616
"@react-three/rapier-addons": "4.0.1",
17-
"@types/three": "0.168.0",
18-
"leva": "0.9.35",
19-
"r3f-perf": "7.2.1",
20-
"react": "18.2.0",
21-
"react-dom": "18.2.0",
22-
"react-router-dom": "6.4.3",
23-
"three": "0.168.0"
17+
"@types/three": "0.172.0",
18+
"leva": "0.10.0",
19+
"r3f-perf": "7.2.3",
20+
"react": "19.0.0",
21+
"react-dom": "19.0.0",
22+
"react-router-dom": "7.1.3",
23+
"three": "0.172.0"
2424
},
2525
"devDependencies": {
26-
"@vitejs/plugin-react": "4.3.1",
27-
"typescript": "4.6.3",
28-
"vite": "3.0.3"
26+
"@types/react": "19.0.8",
27+
"@types/react-dom": "19.0.3",
28+
"@vitejs/plugin-react": "4.3.4",
29+
"typescript": "5.7.3",
30+
"vite": "6.0.11"
2931
},
3032
"repository": "https://github.com/pmndrs/react-three-rapier/tree/master/demo"
3133
}

demo/src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Canvas } from "@react-three/fiber";
33
import { Physics, RigidBody } from "@react-three/rapier";
44
import { Perf } from "r3f-perf";
55
import {
6+
JSX,
67
ReactNode,
78
StrictMode,
89
Suspense,
@@ -117,7 +118,7 @@ export const App = () => {
117118
const [interpolate, setInterpolate] = useState<boolean>(true);
118119
const [physicsKey, setPhysicsKey] = useState<number>(0);
119120
const [cameraEnabled, setCameraEnabled] = useState<boolean>(true);
120-
const orbitControlRef = useRef<OrbitControlsImpl>(null);
121+
const orbitControlRef = useRef<OrbitControlsImpl>(null!);
121122

122123
useResetOrbitControls();
123124

demo/src/examples/all-colliders/AllCollidersExample.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Box, Cone, Cylinder, Html, Sphere } from "@react-three/drei";
2-
import { MeshProps, Object3DProps } from "@react-three/fiber";
2+
import { ThreeElements } from "@react-three/fiber";
33
import {
44
BallCollider,
55
CapsuleCollider,
@@ -21,7 +21,10 @@ import { PlaneGeometry } from "three";
2121
import { useEffect, useRef } from "react";
2222
import { useResetOrbitControls } from "../../hooks/use-reset-orbit-controls";
2323

24-
const CuteBox = (props: Omit<MeshProps, "args">) => (
24+
type Object3DProps = ThreeElements["object3D"];
25+
type MeshProps = ThreeElements["mesh"];
26+
27+
const CuteBox = (props: Omit<MeshProps, "args" | "ref">) => (
2528
<Box castShadow receiveShadow {...props}>
2629
<meshPhysicalMaterial color="orange" />
2730
</Box>

0 commit comments

Comments
 (0)