@react-three/fiber 10.0.0-canary.76d2134 → 10.0.0-canary.7dfc4e4

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/index.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as three_examples_jsm_inspector_Inspector_js from 'three/examples/jsm/inspector/Inspector.js';
1
2
  import * as three_webgpu from 'three/webgpu';
2
3
  import { CubeRenderTarget, RenderTarget, WebGPURenderer, Node, StorageTexture, Data3DTexture, CanvasTarget, ShaderNodeObject, Euler as Euler$2, Color as Color$2, ColorRepresentation as ColorRepresentation$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, Loader as Loader$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three/webgpu';
3
4
  import * as THREE$1 from 'three';
@@ -12,7 +13,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
12
13
  export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
13
14
  import { Options } from 'react-use-measure';
14
15
  import * as react_jsx_runtime from 'react/jsx-runtime';
15
- import { ThreeElement as ThreeElement$1, Euler as Euler$3 } from '@react-three/fiber';
16
16
  import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
17
17
 
18
18
  function _mergeNamespaces(n, m) {
@@ -48,6 +48,9 @@ function _mergeNamespaces(n, m) {
48
48
  declare const R3F_BUILD_LEGACY = true;
49
49
  declare const R3F_BUILD_WEBGPU = true;
50
50
 
51
+ /** Lazily load the three Inspector. Keeps it out of the eager module graph — see note above. */
52
+ declare function loadInspector(): Promise<typeof three_examples_jsm_inspector_Inspector_js.Inspector>;
53
+
51
54
  var THREE = /*#__PURE__*/_mergeNamespaces({
52
55
  __proto__: null,
53
56
  CubeRenderTarget: CubeRenderTarget,
@@ -59,7 +62,8 @@ var THREE = /*#__PURE__*/_mergeNamespaces({
59
62
  WebGLCubeRenderTarget: WebGLCubeRenderTarget,
60
63
  WebGLRenderTarget: WebGLRenderTarget,
61
64
  WebGLRenderer: WebGLRenderer,
62
- WebGLRendererParameters: WebGLRendererParameters
65
+ WebGLRendererParameters: WebGLRendererParameters,
66
+ loadInspector: loadInspector
63
67
  }, [three_webgpu]);
64
68
 
65
69
  //* Utility Types ==============================
@@ -497,6 +501,18 @@ interface InternalState {
497
501
  * @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
498
502
  */
499
503
  canvasTarget?: CanvasTarget
504
+ /**
505
+ * Set when this root's canvas target has been resized and the backend's cached render pass
506
+ * descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
507
+ *
508
+ * Flushed by the canvas-target job in the `start` phase, which is the only place this root's
509
+ * target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
510
+ * whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
511
+ * invalidate some other canvas's descriptor instead.
512
+ *
513
+ * @see https://github.com/pmndrs/react-three-fiber/issues/3847
514
+ */
515
+ canvasTargetSizeDirty?: boolean
500
516
  /**
501
517
  * Whether multi-canvas rendering is active.
502
518
  * True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
@@ -1635,9 +1651,9 @@ type EnvironmentProps = {
1635
1651
  blur?: number;
1636
1652
  backgroundBlurriness?: number;
1637
1653
  backgroundIntensity?: number;
1638
- backgroundRotation?: Euler$3;
1654
+ backgroundRotation?: Euler;
1639
1655
  environmentIntensity?: number;
1640
- environmentRotation?: Euler$3;
1656
+ environmentRotation?: Euler;
1641
1657
  map?: Texture$1;
1642
1658
  preset?: PresetsType;
1643
1659
  scene?: Scene | React$1.RefObject<Scene>;
@@ -1721,7 +1737,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
1721
1737
  declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): react_jsx_runtime.JSX.Element;
1722
1738
  declare module '@react-three/fiber' {
1723
1739
  interface ThreeElements {
1724
- groundProjectedEnvImpl: ThreeElement$1<typeof GroundedSkybox>;
1740
+ groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
1725
1741
  }
1726
1742
  }
1727
1743
  /**
@@ -1879,7 +1895,7 @@ declare namespace useLoader {
1879
1895
  *
1880
1896
  * @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
1881
1897
  * @param priorityOrOptions - Either a priority number (backwards compat) or options object
1882
- * @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
1898
+ * @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
1883
1899
  *
1884
1900
  * @example
1885
1901
  * // Simple priority (backwards compat)
@@ -2175,7 +2191,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
2175
2191
  * Invalidates the view, requesting a frame to be rendered.
2176
2192
  * In demand mode, this triggers the scheduler to run frames.
2177
2193
  *
2178
- * @param state - Optional root state (ignored in new scheduler, kept for backwards compat)
2194
+ * With a state argument, only that root's jobs run on the requested frames; other
2195
+ * roots on 'demand' stay idle. Without one, every registered root is invalidated.
2196
+ *
2197
+ * @param state - Optional root state; targets the invalidation at that root
2179
2198
  * @param frames - Number of frames to request (default: 1)
2180
2199
  * @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
2181
2200
  *
@@ -2186,14 +2205,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
2186
2205
  * Advances the frameloop and runs render effects.
2187
2206
  * Useful for when manually rendering via `frameloop="never"`.
2188
2207
  *
2208
+ * With a state argument, only that root is stepped. Without one, every
2209
+ * registered root is stepped for backwards compatibility.
2210
+ *
2189
2211
  * @param timestamp - The timestamp to use for this frame
2190
2212
  * @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
2191
- * @param state - Ignored (kept for backwards compat)
2192
- * @param frame - Ignored (kept for backwards compat)
2213
+ * @param state - Optional root state; targets the manual step at that root
2193
2214
  *
2194
2215
  * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
2195
2216
  */
2196
- declare function advance(timestamp: number): void;
2217
+ declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
2197
2218
 
2198
2219
  /* eslint-disable @definitelytyped/no-unnecessary-generics */
2199
2220
  declare function ReactReconciler<
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as three_examples_jsm_inspector_Inspector_js from 'three/examples/jsm/inspector/Inspector.js';
1
2
  import * as three_webgpu from 'three/webgpu';
2
3
  import { CubeRenderTarget, RenderTarget, WebGPURenderer, Node, StorageTexture, Data3DTexture, CanvasTarget, ShaderNodeObject, Euler as Euler$2, Color as Color$2, ColorRepresentation as ColorRepresentation$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, Loader as Loader$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three/webgpu';
3
4
  import * as THREE$1 from 'three';
@@ -12,7 +13,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
12
13
  export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
13
14
  import { Options } from 'react-use-measure';
14
15
  import * as react_jsx_runtime from 'react/jsx-runtime';
15
- import { ThreeElement as ThreeElement$1, Euler as Euler$3 } from '@react-three/fiber';
16
16
  import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
17
17
 
18
18
  function _mergeNamespaces(n, m) {
@@ -48,6 +48,9 @@ function _mergeNamespaces(n, m) {
48
48
  declare const R3F_BUILD_LEGACY = true;
49
49
  declare const R3F_BUILD_WEBGPU = true;
50
50
 
51
+ /** Lazily load the three Inspector. Keeps it out of the eager module graph — see note above. */
52
+ declare function loadInspector(): Promise<typeof three_examples_jsm_inspector_Inspector_js.Inspector>;
53
+
51
54
  var THREE = /*#__PURE__*/_mergeNamespaces({
52
55
  __proto__: null,
53
56
  CubeRenderTarget: CubeRenderTarget,
@@ -59,7 +62,8 @@ var THREE = /*#__PURE__*/_mergeNamespaces({
59
62
  WebGLCubeRenderTarget: WebGLCubeRenderTarget,
60
63
  WebGLRenderTarget: WebGLRenderTarget,
61
64
  WebGLRenderer: WebGLRenderer,
62
- WebGLRendererParameters: WebGLRendererParameters
65
+ WebGLRendererParameters: WebGLRendererParameters,
66
+ loadInspector: loadInspector
63
67
  }, [three_webgpu]);
64
68
 
65
69
  //* Utility Types ==============================
@@ -497,6 +501,18 @@ interface InternalState {
497
501
  * @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
498
502
  */
499
503
  canvasTarget?: CanvasTarget
504
+ /**
505
+ * Set when this root's canvas target has been resized and the backend's cached render pass
506
+ * descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
507
+ *
508
+ * Flushed by the canvas-target job in the `start` phase, which is the only place this root's
509
+ * target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
510
+ * whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
511
+ * invalidate some other canvas's descriptor instead.
512
+ *
513
+ * @see https://github.com/pmndrs/react-three-fiber/issues/3847
514
+ */
515
+ canvasTargetSizeDirty?: boolean
500
516
  /**
501
517
  * Whether multi-canvas rendering is active.
502
518
  * True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
@@ -1635,9 +1651,9 @@ type EnvironmentProps = {
1635
1651
  blur?: number;
1636
1652
  backgroundBlurriness?: number;
1637
1653
  backgroundIntensity?: number;
1638
- backgroundRotation?: Euler$3;
1654
+ backgroundRotation?: Euler;
1639
1655
  environmentIntensity?: number;
1640
- environmentRotation?: Euler$3;
1656
+ environmentRotation?: Euler;
1641
1657
  map?: Texture$1;
1642
1658
  preset?: PresetsType;
1643
1659
  scene?: Scene | React$1.RefObject<Scene>;
@@ -1721,7 +1737,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
1721
1737
  declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): react_jsx_runtime.JSX.Element;
1722
1738
  declare module '@react-three/fiber' {
1723
1739
  interface ThreeElements {
1724
- groundProjectedEnvImpl: ThreeElement$1<typeof GroundedSkybox>;
1740
+ groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
1725
1741
  }
1726
1742
  }
1727
1743
  /**
@@ -1879,7 +1895,7 @@ declare namespace useLoader {
1879
1895
  *
1880
1896
  * @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
1881
1897
  * @param priorityOrOptions - Either a priority number (backwards compat) or options object
1882
- * @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
1898
+ * @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
1883
1899
  *
1884
1900
  * @example
1885
1901
  * // Simple priority (backwards compat)
@@ -2175,7 +2191,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
2175
2191
  * Invalidates the view, requesting a frame to be rendered.
2176
2192
  * In demand mode, this triggers the scheduler to run frames.
2177
2193
  *
2178
- * @param state - Optional root state (ignored in new scheduler, kept for backwards compat)
2194
+ * With a state argument, only that root's jobs run on the requested frames; other
2195
+ * roots on 'demand' stay idle. Without one, every registered root is invalidated.
2196
+ *
2197
+ * @param state - Optional root state; targets the invalidation at that root
2179
2198
  * @param frames - Number of frames to request (default: 1)
2180
2199
  * @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
2181
2200
  *
@@ -2186,14 +2205,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
2186
2205
  * Advances the frameloop and runs render effects.
2187
2206
  * Useful for when manually rendering via `frameloop="never"`.
2188
2207
  *
2208
+ * With a state argument, only that root is stepped. Without one, every
2209
+ * registered root is stepped for backwards compatibility.
2210
+ *
2189
2211
  * @param timestamp - The timestamp to use for this frame
2190
2212
  * @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
2191
- * @param state - Ignored (kept for backwards compat)
2192
- * @param frame - Ignored (kept for backwards compat)
2213
+ * @param state - Optional root state; targets the manual step at that root
2193
2214
  *
2194
2215
  * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
2195
2216
  */
2196
- declare function advance(timestamp: number): void;
2217
+ declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
2197
2218
 
2198
2219
  /* eslint-disable @definitelytyped/no-unnecessary-generics */
2199
2220
  declare function ReactReconciler<
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as three_examples_jsm_inspector_Inspector_js from 'three/examples/jsm/inspector/Inspector.js';
1
2
  import * as three_webgpu from 'three/webgpu';
2
3
  import { CubeRenderTarget, RenderTarget, WebGPURenderer, Node, StorageTexture, Data3DTexture, CanvasTarget, ShaderNodeObject, Euler as Euler$2, Color as Color$2, ColorRepresentation as ColorRepresentation$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, Loader as Loader$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three/webgpu';
3
4
  import * as THREE$1 from 'three';
@@ -12,7 +13,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
12
13
  export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
13
14
  import { Options } from 'react-use-measure';
14
15
  import * as react_jsx_runtime from 'react/jsx-runtime';
15
- import { ThreeElement as ThreeElement$1, Euler as Euler$3 } from '@react-three/fiber';
16
16
  import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
17
17
 
18
18
  function _mergeNamespaces(n, m) {
@@ -48,6 +48,9 @@ function _mergeNamespaces(n, m) {
48
48
  declare const R3F_BUILD_LEGACY = true;
49
49
  declare const R3F_BUILD_WEBGPU = true;
50
50
 
51
+ /** Lazily load the three Inspector. Keeps it out of the eager module graph — see note above. */
52
+ declare function loadInspector(): Promise<typeof three_examples_jsm_inspector_Inspector_js.Inspector>;
53
+
51
54
  var THREE = /*#__PURE__*/_mergeNamespaces({
52
55
  __proto__: null,
53
56
  CubeRenderTarget: CubeRenderTarget,
@@ -59,7 +62,8 @@ var THREE = /*#__PURE__*/_mergeNamespaces({
59
62
  WebGLCubeRenderTarget: WebGLCubeRenderTarget,
60
63
  WebGLRenderTarget: WebGLRenderTarget,
61
64
  WebGLRenderer: WebGLRenderer,
62
- WebGLRendererParameters: WebGLRendererParameters
65
+ WebGLRendererParameters: WebGLRendererParameters,
66
+ loadInspector: loadInspector
63
67
  }, [three_webgpu]);
64
68
 
65
69
  //* Utility Types ==============================
@@ -497,6 +501,18 @@ interface InternalState {
497
501
  * @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
498
502
  */
499
503
  canvasTarget?: CanvasTarget
504
+ /**
505
+ * Set when this root's canvas target has been resized and the backend's cached render pass
506
+ * descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
507
+ *
508
+ * Flushed by the canvas-target job in the `start` phase, which is the only place this root's
509
+ * target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
510
+ * whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
511
+ * invalidate some other canvas's descriptor instead.
512
+ *
513
+ * @see https://github.com/pmndrs/react-three-fiber/issues/3847
514
+ */
515
+ canvasTargetSizeDirty?: boolean
500
516
  /**
501
517
  * Whether multi-canvas rendering is active.
502
518
  * True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
@@ -1635,9 +1651,9 @@ type EnvironmentProps = {
1635
1651
  blur?: number;
1636
1652
  backgroundBlurriness?: number;
1637
1653
  backgroundIntensity?: number;
1638
- backgroundRotation?: Euler$3;
1654
+ backgroundRotation?: Euler;
1639
1655
  environmentIntensity?: number;
1640
- environmentRotation?: Euler$3;
1656
+ environmentRotation?: Euler;
1641
1657
  map?: Texture$1;
1642
1658
  preset?: PresetsType;
1643
1659
  scene?: Scene | React$1.RefObject<Scene>;
@@ -1721,7 +1737,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
1721
1737
  declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): react_jsx_runtime.JSX.Element;
1722
1738
  declare module '@react-three/fiber' {
1723
1739
  interface ThreeElements {
1724
- groundProjectedEnvImpl: ThreeElement$1<typeof GroundedSkybox>;
1740
+ groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
1725
1741
  }
1726
1742
  }
1727
1743
  /**
@@ -1879,7 +1895,7 @@ declare namespace useLoader {
1879
1895
  *
1880
1896
  * @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
1881
1897
  * @param priorityOrOptions - Either a priority number (backwards compat) or options object
1882
- * @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
1898
+ * @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
1883
1899
  *
1884
1900
  * @example
1885
1901
  * // Simple priority (backwards compat)
@@ -2175,7 +2191,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
2175
2191
  * Invalidates the view, requesting a frame to be rendered.
2176
2192
  * In demand mode, this triggers the scheduler to run frames.
2177
2193
  *
2178
- * @param state - Optional root state (ignored in new scheduler, kept for backwards compat)
2194
+ * With a state argument, only that root's jobs run on the requested frames; other
2195
+ * roots on 'demand' stay idle. Without one, every registered root is invalidated.
2196
+ *
2197
+ * @param state - Optional root state; targets the invalidation at that root
2179
2198
  * @param frames - Number of frames to request (default: 1)
2180
2199
  * @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
2181
2200
  *
@@ -2186,14 +2205,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
2186
2205
  * Advances the frameloop and runs render effects.
2187
2206
  * Useful for when manually rendering via `frameloop="never"`.
2188
2207
  *
2208
+ * With a state argument, only that root is stepped. Without one, every
2209
+ * registered root is stepped for backwards compatibility.
2210
+ *
2189
2211
  * @param timestamp - The timestamp to use for this frame
2190
2212
  * @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
2191
- * @param state - Ignored (kept for backwards compat)
2192
- * @param frame - Ignored (kept for backwards compat)
2213
+ * @param state - Optional root state; targets the manual step at that root
2193
2214
  *
2194
2215
  * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
2195
2216
  */
2196
- declare function advance(timestamp: number): void;
2217
+ declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
2197
2218
 
2198
2219
  /* eslint-disable @definitelytyped/no-unnecessary-generics */
2199
2220
  declare function ReactReconciler<