You're viewing the
v10 deployment.development
This is the hub for all technical documentation. It covers day-to-day workflow, project structure, and links to specialized guides.
v10 Context
v10 introduces significant architectural changes:
- WebGPU by default —
<Canvas>on@react-three/fiberrenders with WebGPURenderer;/legacykeeps WebGLRenderer,/webgpuloads WebGPU statically - Native Split — React Native support moves to the separate
@react-three/nativepackage (pmndrs/native, not yet on npm) - New Build System — Unbuild, one build with a shared core; renderer supports loaded on demand
- Modern Tooling — pnpm workspaces and Vitest for testing
These changes mean an app downloads only the renderer its Canvas asks for, and libraries built on fiber add no renderer at all.
Development Workflow
//* Development Cycle ===================================
pnpm dev # Generate stubs linking src → dist
pnpm examples # Launch example suite for UI testing
pnpm test # Run Vitest suite
pnpm build # Generate production bundles
The general loop:
pnpm dev— Start development mode- Edit files in
packages/fiber/src/ pnpm test— Verify changespnpm examples— Visual verification
Project Structure
packages/fiber/
├── src/
│ ├── index.tsx # Default entry (WebGL + WebGPU)
│ ├── legacy.tsx # Legacy entry (WebGL only)
│ ├── webgpu/ # WebGPU-specific entry/logic
│ ├── core/ # Core reconciler and hooks (shared)
│ └── support/ # webgl.ts / webgpu.ts: the only modules that import three
├── types/ # Internal TypeScript definitions
├── tests/ # Vitest tests
└── build.config.ts # Build entry point configuration
- Shared Logic — Most changes happen in
src/core/ - Three imports — Core never imports a three value; it reads classes from the renderer support a root loaded (see BUILD)
Adding Features
//* All Entry Points ------------------------------------
- Add logic in
src/core/ - Export from
src/core/index.tsx - Automatically available in all bundles
//* WebGPU-Specific -------------------------------------
- Add code to
src/webgpu/ - Export from
src/webgpu/index.tsx - Only exported from
@react-three/fiber/webgpu
//* New THREE.js Imports --------------------------------
- In
src/core/,import typeonly. Read a shared-core class fromgetThree(), a renderer-specific one fromstate.internal.support - A renderer-specific class core does not have yet goes on the support (
types/provider.d.ts,src/support/webgl.ts,src/support/webgpu.ts) - A three addon is loaded where it is used, with a dynamic import
Documentation Index
Design rationale is not kept as separate documents — it lives with the feature it explains. See README.