@react-three/fiber 10.0.0-alpha.5 → 10.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/webgpu.cjs +37 -0
- package/dist/chunks/webgpu.mjs +21 -0
- package/dist/extension.cjs +13 -0
- package/dist/extension.d.cts +63 -0
- package/dist/extension.d.mts +63 -0
- package/dist/extension.d.ts +63 -0
- package/dist/extension.mjs +1 -0
- package/dist/index.cjs +98 -15369
- package/dist/index.d.cts +101 -3885
- package/dist/index.d.mts +101 -3885
- package/dist/index.d.ts +101 -3857
- package/dist/index.mjs +12 -15270
- package/dist/legacy.cjs +105 -15307
- package/dist/legacy.d.cts +115 -3874
- package/dist/legacy.d.mts +115 -3874
- package/dist/legacy.d.ts +116 -3849
- package/dist/legacy.mjs +21 -15224
- package/dist/shared/fiber.34TOMPo3.d.cts +2494 -0
- package/dist/shared/fiber.BFuGd7gN.d.cts +90 -0
- package/dist/shared/fiber.BO8-26r8.cjs +541 -0
- package/dist/shared/fiber.BSXtODQl.cjs +14 -0
- package/dist/shared/fiber.Bll9fqKA.d.mts +90 -0
- package/dist/shared/fiber.BuWl08aJ.mjs +16564 -0
- package/dist/shared/fiber.C-3TIsF8.mjs +500 -0
- package/dist/shared/fiber.CjMAAsJy.d.ts +2494 -0
- package/dist/shared/fiber.DEWBFQJe.mjs +9 -0
- package/dist/shared/fiber.DQTSZ24m.d.cts +1240 -0
- package/dist/shared/fiber.DQTSZ24m.d.mts +1240 -0
- package/dist/shared/fiber.DQTSZ24m.d.ts +1240 -0
- package/dist/shared/fiber.DuA4F8L5.d.ts +90 -0
- package/dist/shared/fiber.Dy7Uz273.d.mts +2494 -0
- package/dist/shared/fiber.TRm3lZ7I.cjs +16662 -0
- package/dist/webgpu/index.cjs +101 -16209
- package/dist/webgpu/index.d.cts +106 -4247
- package/dist/webgpu/index.d.mts +106 -4247
- package/dist/webgpu/index.d.ts +106 -4219
- package/dist/webgpu/index.mjs +15 -16092
- package/package.json +13 -10
- package/readme.md +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-three/fiber",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.6",
|
|
4
4
|
"description": "A React renderer for Threejs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -53,29 +53,33 @@
|
|
|
53
53
|
"import": "./dist/webgpu/index.mjs",
|
|
54
54
|
"require": "./dist/webgpu/index.cjs"
|
|
55
55
|
},
|
|
56
|
+
"./extension": {
|
|
57
|
+
"types": "./dist/extension.d.ts",
|
|
58
|
+
"import": "./dist/extension.mjs",
|
|
59
|
+
"require": "./dist/extension.cjs"
|
|
60
|
+
},
|
|
56
61
|
"./package.json": "./package.json"
|
|
57
62
|
},
|
|
58
63
|
"dependencies": {
|
|
59
64
|
"@babel/runtime": "^7.28.6",
|
|
60
|
-
"@
|
|
61
|
-
"@pmndrs/scheduler": "^0.2.0",
|
|
65
|
+
"@pmndrs/scheduler": "^0.3.0",
|
|
62
66
|
"dequal": "^2.0.3",
|
|
63
|
-
"its-fine": "^2.
|
|
67
|
+
"its-fine": "^2.1.1",
|
|
64
68
|
"react-use-measure": "^2.1.7",
|
|
65
|
-
"scheduler": "^0.
|
|
69
|
+
"scheduler": "^0.28.0",
|
|
66
70
|
"suspend-react": "^0.1.3",
|
|
67
71
|
"use-sync-external-store": "^1.6.0",
|
|
68
72
|
"zustand": "^5.0.10"
|
|
69
73
|
},
|
|
70
74
|
"devDependencies": {
|
|
71
|
-
"@types/react-reconciler": "^0.
|
|
75
|
+
"@types/react-reconciler": "^0.33.0",
|
|
72
76
|
"@types/three": "^0.185.0",
|
|
73
77
|
"@types/webxr": "*",
|
|
74
|
-
"react-reconciler": "^0.
|
|
78
|
+
"react-reconciler": "^0.34.0"
|
|
75
79
|
},
|
|
76
80
|
"peerDependencies": {
|
|
77
|
-
"react": ">=19.0 <19.
|
|
78
|
-
"react-dom": ">=19.0 <19.
|
|
81
|
+
"react": ">=19.0 <19.4",
|
|
82
|
+
"react-dom": ">=19.0 <19.4",
|
|
79
83
|
"three": ">=0.185.0"
|
|
80
84
|
},
|
|
81
85
|
"peerDependenciesMeta": {
|
|
@@ -86,7 +90,6 @@
|
|
|
86
90
|
"scripts": {
|
|
87
91
|
"prebuild": "node -e \"require('fs').copyFileSync('../../readme.md', 'readme.md')\"",
|
|
88
92
|
"build": "unbuild",
|
|
89
|
-
"postbuild": "node ../../scripts/fix-three-types.js",
|
|
90
93
|
"stub": "unbuild --stub"
|
|
91
94
|
}
|
|
92
95
|
}
|
package/readme.md
CHANGED
|
@@ -37,7 +37,16 @@ Yes. It merely expresses Threejs in JSX, `<mesh />` dynamically turns into `new
|
|
|
37
37
|
|
|
38
38
|
#### Does it support WebGPU?
|
|
39
39
|
|
|
40
|
-
Yes.
|
|
40
|
+
Yes. In v10 it is the default: `<Canvas>` from `@react-three/fiber` renders with three's `WebGPURenderer`, which falls back to a WebGL2 backend where the browser has no WebGPU, and the hooks are typed for it. Node materials and TSL work out of the box, with our own hooks in [`@react-three/tsl`](https://github.com/pmndrs/react-three-fiber/tree/v10/packages/tsl). Scenes that need `WebGLRenderer` (GLSL `ShaderMaterial`s, `onBeforeCompile`, `postprocessing`) import from `@react-three/fiber/legacy`.
|
|
41
|
+
|
|
42
|
+
#### Upgrading to v10?
|
|
43
|
+
|
|
44
|
+
v10 is in alpha (`npm install @react-three/fiber@alpha`). Read the [migration guide](https://r3f.docs.pmnd.rs/next/migration/v10) and the [list of breaking changes](https://r3f.docs.pmnd.rs/next/migration/breaking-changes). The short version:
|
|
45
|
+
|
|
46
|
+
- `@react-three/fiber` renders with WebGPU; WebGL is `@react-three/fiber/legacy`, chosen by the import.
|
|
47
|
+
- `useThree`, `useFrame` and `onCreated` are typed for the import's renderer, so `state.renderer.compute(...)` needs no cast. Libraries that run on both renderers type against `@react-three/fiber/extension`.
|
|
48
|
+
- `state.gl` is `state.renderer` (deprecated), `state.clock` is gone (`state.elapsed`, `state.delta`), and `shadows` and the color props moved into `renderer={{ ... }}` / `gl={{ ... }}`.
|
|
49
|
+
- The TSL hooks live in `@react-three/tsl`; the `physics` frame phase runs on a fixed timestep.
|
|
41
50
|
|
|
42
51
|
### What does it look like?
|
|
43
52
|
|
|
@@ -215,7 +224,7 @@ Visit [docs.pmnd.rs](https://docs.pmnd.rs/react-three-fiber) | [Awesome React Th
|
|
|
215
224
|
|
|
216
225
|
You need to be versed in both React and Threejs before rushing into this. If you are unsure about React consult the official [React docs](https://react.dev/learn), especially [the section about hooks](https://react.dev/reference/react). As for Threejs, make sure you at least glance over the following links:
|
|
217
226
|
|
|
218
|
-
1. Make sure you have a [basic grasp of Threejs](https://threejs.org/
|
|
227
|
+
1. Make sure you have a [basic grasp of Threejs](https://threejs.org/manual/#en/creating-a-scene). Keep that site open.
|
|
219
228
|
2. When you know what a scene is, a camera, mesh, geometry, material, fork the [demo above](https://github.com/pmndrs/react-three-fiber#what-does-it-look-like).
|
|
220
229
|
3. [Look up](https://threejs.org/docs/index.html#api/en/objects/Mesh) the JSX elements that you see (mesh, ambientLight, etc), _all_ threejs exports are native to three-fiber.
|
|
221
230
|
4. Try changing some values, scroll through our [API](https://docs.pmnd.rs/react-three-fiber) to see what the various settings and hooks do.
|