@react-three/fiber 8.14.7 → 8.15.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @react-three/fiber
2
2
 
3
+ ## 8.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2d39676d: fix: ignore deprecated types, use correct XRFrame definition
8
+
9
+ ## 8.15.0
10
+
11
+ ### Minor Changes
12
+
13
+ - cca8b6bb: feat: export buildGraph
14
+
3
15
  ## 8.14.7
4
16
 
5
17
  ### Patch Changes
@@ -7,7 +7,7 @@ import { Renderer, context, RootState, Size, Dpr, Performance, PrivateKeys } fro
7
7
  import { extend, Root } from './renderer';
8
8
  import { addEffect, addAfterEffect, addTail, flushGlobalEffects } from './loop';
9
9
  import { EventManager, ComputeFunction } from './events';
10
- import { dispose, getRootState, Camera } from './utils';
10
+ import { dispose, getRootState, Camera, buildGraph } from './utils';
11
11
  import type { Properties } from '../three-types';
12
12
  declare type Canvas = HTMLCanvasElement | OffscreenCanvas;
13
13
  declare const roots: Map<Canvas, Root>;
@@ -54,4 +54,4 @@ export declare type InjectState = Partial<Omit<RootState, PrivateKeys> & {
54
54
  declare function createPortal(children: React.ReactNode, container: THREE.Object3D, state?: InjectState): JSX.Element;
55
55
  declare const act: any;
56
56
  export * from './hooks';
57
- export { context, render, createRoot, unmountComponentAtNode, createPortal, reconciler, applyProps, dispose, invalidate, advance, extend, addEffect, addAfterEffect, addTail, flushGlobalEffects, getRootState, act, roots as _roots, };
57
+ export { context, render, createRoot, unmountComponentAtNode, createPortal, reconciler, applyProps, dispose, invalidate, advance, extend, addEffect, addAfterEffect, addTail, flushGlobalEffects, getRootState, act, buildGraph, roots as _roots, };
@@ -1,4 +1,3 @@
1
- import * as THREE from 'three';
2
1
  import { Root } from './renderer';
3
2
  import { RootState } from './store';
4
3
  export declare type GlobalRenderCallback = (timeStamp: number) => void;
@@ -10,5 +9,5 @@ export declare function flushGlobalEffects(type: GlobalEffectType, timestamp: nu
10
9
  export declare function createLoop<TCanvas>(roots: Map<TCanvas, Root>): {
11
10
  loop: (timestamp: number) => void;
12
11
  invalidate: (state?: RootState | undefined, frames?: number) => void;
13
- advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined, frame?: THREE.XRFrame | undefined) => void;
12
+ advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState | undefined, frame?: import("three").XRFrame | undefined) => void;
14
13
  };
@@ -2,7 +2,7 @@ import * as THREE from 'three';
2
2
  import * as React from 'react';
3
3
  import { GetState, SetState, StoreApi, UseBoundStore } from 'zustand';
4
4
  import { DomEvent, EventManager, PointerCaptureTarget, ThreeEvent } from './events';
5
- import { Camera } from './utils';
5
+ import { _XRFrame, Camera } from './utils';
6
6
  export declare const privateKeys: readonly ["set", "get", "setSize", "setFrameloop", "setDpr", "events", "invalidate", "advance", "size", "viewport"];
7
7
  export declare type PrivateKeys = typeof privateKeys[number];
8
8
  export interface Intersection extends THREE.Intersection {
@@ -28,7 +28,7 @@ export declare type Viewport = Size & {
28
28
  distance: number;
29
29
  aspect: number;
30
30
  };
31
- export declare type RenderCallback = (state: RootState, delta: number, frame?: THREE.XRFrame) => void;
31
+ export declare type RenderCallback = (state: RootState, delta: number, frame?: _XRFrame) => void;
32
32
  export declare type Performance = {
33
33
  current: number;
34
34
  min: number;
@@ -1,7 +1,12 @@
1
+ /// <reference types="webxr" />
1
2
  import * as THREE from 'three';
2
3
  import * as React from 'react';
3
4
  import { AttachType, Instance, InstanceProps, LocalState } from './renderer';
4
5
  import { Dpr, Renderer, RootState, Size } from './store';
6
+ declare type _DeprecatedXRFrame = THREE.XRFrame;
7
+ export declare type _XRFrame = THREE.WebGLRenderTargetOptions extends {
8
+ samples?: number;
9
+ } ? XRFrame : _DeprecatedXRFrame;
5
10
  export declare const hasColorSpace: <T extends object | Renderer | THREE.Texture, P = T extends Renderer ? {
6
11
  outputColorSpace: string;
7
12
  } : {
@@ -92,3 +97,4 @@ export declare function updateInstance(instance: Instance): void;
92
97
  export declare function updateCamera(camera: Camera & {
93
98
  manual?: boolean;
94
99
  }, size: Size): void;
100
+ export {};
@@ -105,7 +105,7 @@ export declare type ConeGeometryProps = BufferGeometryNode<THREE.ConeGeometry, t
105
105
  export declare type CylinderGeometryProps = BufferGeometryNode<THREE.CylinderGeometry, typeof THREE.CylinderGeometry>;
106
106
  export declare type CircleGeometryProps = BufferGeometryNode<THREE.CircleGeometry, typeof THREE.CircleGeometry>;
107
107
  export declare type BoxGeometryProps = BufferGeometryNode<THREE.BoxGeometry, typeof THREE.BoxGeometry>;
108
- export declare type CapsuleGeometryProps = BufferGeometryNode<THREE.CapsuleBufferGeometry, typeof THREE.CapsuleBufferGeometry>;
108
+ export declare type CapsuleGeometryProps = BufferGeometryNode<THREE.CapsuleGeometry, typeof THREE.CapsuleGeometry>;
109
109
  export declare type MaterialProps = MaterialNode<THREE.Material, [THREE.MaterialParameters]>;
110
110
  export declare type ShadowMaterialProps = MaterialNode<THREE.ShadowMaterial, [THREE.ShaderMaterialParameters]>;
111
111
  export declare type SpriteMaterialProps = MaterialNode<THREE.SpriteMaterial, [THREE.SpriteMaterialParameters]>;
@@ -497,7 +497,9 @@ const is = {
497
497
  }
498
498
  };
499
499
 
500
- // Collects nodes and materials from a THREE.Object3D
500
+ /**
501
+ * Collects nodes and materials from a THREE.Object3D.
502
+ */
501
503
  function buildGraph(object) {
502
504
  const data = {
503
505
  nodes: {},
@@ -2211,6 +2213,7 @@ exports.addEffect = addEffect;
2211
2213
  exports.addTail = addTail;
2212
2214
  exports.advance = advance;
2213
2215
  exports.applyProps = applyProps;
2216
+ exports.buildGraph = buildGraph;
2214
2217
  exports.context = context;
2215
2218
  exports.createEvents = createEvents;
2216
2219
  exports.createPortal = createPortal;
@@ -470,7 +470,9 @@ const is = {
470
470
  }
471
471
  };
472
472
 
473
- // Collects nodes and materials from a THREE.Object3D
473
+ /**
474
+ * Collects nodes and materials from a THREE.Object3D.
475
+ */
474
476
  function buildGraph(object) {
475
477
  const data = {
476
478
  nodes: {},
@@ -2176,4 +2178,4 @@ reconciler.injectIntoDevTools({
2176
2178
  });
2177
2179
  const act = React.unstable_act;
2178
2180
 
2179
- export { useFrame as A, Block as B, useGraph as C, useLoader as D, ErrorBoundary as E, useIsomorphicLayoutEffect as a, createRoot as b, createEvents as c, unmountComponentAtNode as d, extend as e, context as f, createPortal as g, reconciler as h, isRef as i, applyProps as j, dispose as k, invalidate as l, advance as m, addEffect as n, addAfterEffect as o, addTail as p, flushGlobalEffects as q, render as r, getRootState as s, threeTypes as t, useMutableCallback as u, act as v, roots as w, useInstanceHandle as x, useStore as y, useThree as z };
2181
+ export { useThree as A, Block as B, useFrame as C, useGraph as D, ErrorBoundary as E, useLoader as F, useIsomorphicLayoutEffect as a, createRoot as b, createEvents as c, unmountComponentAtNode as d, extend as e, context as f, createPortal as g, reconciler as h, isRef as i, applyProps as j, dispose as k, invalidate as l, advance as m, addEffect as n, addAfterEffect as o, addTail as p, flushGlobalEffects as q, render as r, getRootState as s, threeTypes as t, useMutableCallback as u, act as v, buildGraph as w, roots as x, useInstanceHandle as y, useStore as z };
@@ -497,7 +497,9 @@ const is = {
497
497
  }
498
498
  };
499
499
 
500
- // Collects nodes and materials from a THREE.Object3D
500
+ /**
501
+ * Collects nodes and materials from a THREE.Object3D.
502
+ */
501
503
  function buildGraph(object) {
502
504
  const data = {
503
505
  nodes: {},
@@ -2211,6 +2213,7 @@ exports.addEffect = addEffect;
2211
2213
  exports.addTail = addTail;
2212
2214
  exports.advance = advance;
2213
2215
  exports.applyProps = applyProps;
2216
+ exports.buildGraph = buildGraph;
2214
2217
  exports.context = context;
2215
2218
  exports.createEvents = createEvents;
2216
2219
  exports.createPortal = createPortal;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-d1f17345.cjs.dev.js');
5
+ var index = require('./index-34a45f4c.cjs.dev.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -269,6 +269,7 @@ exports.addEffect = index.addEffect;
269
269
  exports.addTail = index.addTail;
270
270
  exports.advance = index.advance;
271
271
  exports.applyProps = index.applyProps;
272
+ exports.buildGraph = index.buildGraph;
272
273
  exports.context = index.context;
273
274
  exports.createEvents = index.createEvents;
274
275
  exports.createPortal = index.createPortal;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-ce1a9f04.cjs.prod.js');
5
+ var index = require('./index-f4d4539a.cjs.prod.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -269,6 +269,7 @@ exports.addEffect = index.addEffect;
269
269
  exports.addTail = index.addTail;
270
270
  exports.advance = index.advance;
271
271
  exports.applyProps = index.applyProps;
272
+ exports.buildGraph = index.buildGraph;
272
273
  exports.context = index.context;
273
274
  exports.createEvents = index.createEvents;
274
275
  exports.createPortal = index.createPortal;
@@ -1,5 +1,5 @@
1
- import { c as createEvents, e as extend, u as useMutableCallback, a as useIsomorphicLayoutEffect, b as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from './index-c4d1c86e.esm.js';
2
- export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from './index-c4d1c86e.esm.js';
1
+ import { c as createEvents, e as extend, u as useMutableCallback, a as useIsomorphicLayoutEffect, b as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from './index-5918012a.esm.js';
2
+ export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from './index-5918012a.esm.js';
3
3
  import _extends from '@babel/runtime/helpers/esm/extends';
4
4
  import * as React from 'react';
5
5
  import * as THREE from 'three';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-d1f17345.cjs.dev.js');
5
+ var index = require('../../dist/index-34a45f4c.cjs.dev.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -456,6 +456,7 @@ exports.addEffect = index.addEffect;
456
456
  exports.addTail = index.addTail;
457
457
  exports.advance = index.advance;
458
458
  exports.applyProps = index.applyProps;
459
+ exports.buildGraph = index.buildGraph;
459
460
  exports.context = index.context;
460
461
  exports.createEvents = index.createEvents;
461
462
  exports.createPortal = index.createPortal;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-ce1a9f04.cjs.prod.js');
5
+ var index = require('../../dist/index-f4d4539a.cjs.prod.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -456,6 +456,7 @@ exports.addEffect = index.addEffect;
456
456
  exports.addTail = index.addTail;
457
457
  exports.advance = index.advance;
458
458
  exports.applyProps = index.applyProps;
459
+ exports.buildGraph = index.buildGraph;
459
460
  exports.context = index.context;
460
461
  exports.createEvents = index.createEvents;
461
462
  exports.createPortal = index.createPortal;
@@ -1,5 +1,5 @@
1
- import { c as createEvents, e as extend, u as useMutableCallback, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-c4d1c86e.esm.js';
2
- export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from '../../dist/index-c4d1c86e.esm.js';
1
+ import { c as createEvents, e as extend, u as useMutableCallback, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-5918012a.esm.js';
2
+ export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from '../../dist/index-5918012a.esm.js';
3
3
  import _extends from '@babel/runtime/helpers/esm/extends';
4
4
  import * as React from 'react';
5
5
  import * as THREE from 'three';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/fiber",
3
- "version": "8.14.7",
3
+ "version": "8.15.1",
4
4
  "description": "A React renderer for Threejs",
5
5
  "keywords": [
6
6
  "react",
@@ -44,6 +44,7 @@
44
44
  "dependencies": {
45
45
  "@babel/runtime": "^7.17.8",
46
46
  "@types/react-reconciler": "^0.26.7",
47
+ "@types/webxr": "*",
47
48
  "base64-js": "^1.5.1",
48
49
  "buffer": "^6.0.3",
49
50
  "its-fine": "^1.0.6",