@react-three/fiber 8.13.5 → 8.13.7

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.13.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 37b9502a: fix(Canvas): pass scene prop
8
+
9
+ ## 8.13.6
10
+
11
+ ### Patch Changes
12
+
13
+ - 0597495c: fix: harden XR init against Renderer shim
14
+
3
15
  ## 8.13.5
4
16
 
5
17
  ### Patch Changes
@@ -1667,7 +1667,7 @@ function loadingFn(extensions, onProgress) {
1667
1667
  return Promise.all(input.map(input => new Promise((res, reject) => loader.load(input, data => {
1668
1668
  if (data.scene) Object.assign(data, buildGraph(data.scene));
1669
1669
  res(data);
1670
- }, onProgress, error => reject(new Error(`Could not load ${input}: ${error.message})`))))));
1670
+ }, onProgress, error => reject(new Error(`Could not load ${input}: ${error.message}`))))));
1671
1671
  };
1672
1672
  }
1673
1673
 
@@ -1867,6 +1867,7 @@ function createRoot(canvas) {
1867
1867
 
1868
1868
  // Set up XR (one time only!)
1869
1869
  if (!state.xr) {
1870
+ var _gl$xr;
1870
1871
  // Handle frame behavior in WebXR
1871
1872
  const handleXRFrame = (timestamp, frame) => {
1872
1873
  const state = store.getState();
@@ -1897,7 +1898,7 @@ function createRoot(canvas) {
1897
1898
  };
1898
1899
 
1899
1900
  // Subscribe to WebXR session events
1900
- if (gl.xr) xr.connect();
1901
+ if (typeof ((_gl$xr = gl.xr) == null ? void 0 : _gl$xr.addEventListener) === 'function') xr.connect();
1901
1902
  state.set({
1902
1903
  xr
1903
1904
  });
@@ -1640,7 +1640,7 @@ function loadingFn(extensions, onProgress) {
1640
1640
  return Promise.all(input.map(input => new Promise((res, reject) => loader.load(input, data => {
1641
1641
  if (data.scene) Object.assign(data, buildGraph(data.scene));
1642
1642
  res(data);
1643
- }, onProgress, error => reject(new Error(`Could not load ${input}: ${error.message})`))))));
1643
+ }, onProgress, error => reject(new Error(`Could not load ${input}: ${error.message}`))))));
1644
1644
  };
1645
1645
  }
1646
1646
 
@@ -1840,6 +1840,7 @@ function createRoot(canvas) {
1840
1840
 
1841
1841
  // Set up XR (one time only!)
1842
1842
  if (!state.xr) {
1843
+ var _gl$xr;
1843
1844
  // Handle frame behavior in WebXR
1844
1845
  const handleXRFrame = (timestamp, frame) => {
1845
1846
  const state = store.getState();
@@ -1870,7 +1871,7 @@ function createRoot(canvas) {
1870
1871
  };
1871
1872
 
1872
1873
  // Subscribe to WebXR session events
1873
- if (gl.xr) xr.connect();
1874
+ if (typeof ((_gl$xr = gl.xr) == null ? void 0 : _gl$xr.addEventListener) === 'function') xr.connect();
1874
1875
  state.set({
1875
1876
  xr
1876
1877
  });
@@ -1667,7 +1667,7 @@ function loadingFn(extensions, onProgress) {
1667
1667
  return Promise.all(input.map(input => new Promise((res, reject) => loader.load(input, data => {
1668
1668
  if (data.scene) Object.assign(data, buildGraph(data.scene));
1669
1669
  res(data);
1670
- }, onProgress, error => reject(new Error(`Could not load ${input}: ${error.message})`))))));
1670
+ }, onProgress, error => reject(new Error(`Could not load ${input}: ${error.message}`))))));
1671
1671
  };
1672
1672
  }
1673
1673
 
@@ -1867,6 +1867,7 @@ function createRoot(canvas) {
1867
1867
 
1868
1868
  // Set up XR (one time only!)
1869
1869
  if (!state.xr) {
1870
+ var _gl$xr;
1870
1871
  // Handle frame behavior in WebXR
1871
1872
  const handleXRFrame = (timestamp, frame) => {
1872
1873
  const state = store.getState();
@@ -1897,7 +1898,7 @@ function createRoot(canvas) {
1897
1898
  };
1898
1899
 
1899
1900
  // Subscribe to WebXR session events
1900
- if (gl.xr) xr.connect();
1901
+ if (typeof ((_gl$xr = gl.xr) == null ? void 0 : _gl$xr.addEventListener) === 'function') xr.connect();
1901
1902
  state.set({
1902
1903
  xr
1903
1904
  });
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-c4a77a3a.cjs.dev.js');
5
+ var index = require('./index-3bf7d7a3.cjs.dev.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -141,6 +141,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
141
141
  performance,
142
142
  raycaster,
143
143
  camera,
144
+ scene,
144
145
  onPointerMissed,
145
146
  onCreated,
146
147
  ...props
@@ -187,6 +188,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
187
188
  performance,
188
189
  raycaster,
189
190
  camera,
191
+ scene,
190
192
  size: containerRect,
191
193
  // Pass mutable reference to onPointerMissed so it's free to update
192
194
  onPointerMissed: (...args) => handlePointerMissed.current == null ? void 0 : handlePointerMissed.current(...args),
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-eae395d9.cjs.prod.js');
5
+ var index = require('./index-e0fec69f.cjs.prod.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -141,6 +141,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
141
141
  performance,
142
142
  raycaster,
143
143
  camera,
144
+ scene,
144
145
  onPointerMissed,
145
146
  onCreated,
146
147
  ...props
@@ -187,6 +188,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
187
188
  performance,
188
189
  raycaster,
189
190
  camera,
191
+ scene,
190
192
  size: containerRect,
191
193
  // Pass mutable reference to onPointerMissed so it's free to update
192
194
  onPointerMissed: (...args) => handlePointerMissed.current == null ? void 0 : handlePointerMissed.current(...args),
@@ -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-27578f8f.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-27578f8f.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-673ef987.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-673ef987.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';
@@ -114,6 +114,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
114
114
  performance,
115
115
  raycaster,
116
116
  camera,
117
+ scene,
117
118
  onPointerMissed,
118
119
  onCreated,
119
120
  ...props
@@ -160,6 +161,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
160
161
  performance,
161
162
  raycaster,
162
163
  camera,
164
+ scene,
163
165
  size: containerRect,
164
166
  // Pass mutable reference to onPointerMissed so it's free to update
165
167
  onPointerMissed: (...args) => handlePointerMissed.current == null ? void 0 : handlePointerMissed.current(...args),
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-c4a77a3a.cjs.dev.js');
5
+ var index = require('../../dist/index-3bf7d7a3.cjs.dev.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -251,6 +251,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
251
251
  performance,
252
252
  raycaster,
253
253
  camera,
254
+ scene,
254
255
  onPointerMissed,
255
256
  onCreated,
256
257
  ...props
@@ -330,6 +331,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
330
331
  performance,
331
332
  raycaster,
332
333
  camera,
334
+ scene,
333
335
  // expo-gl can only render at native dpr/resolution
334
336
  // https://github.com/expo/expo-three/issues/39
335
337
  dpr: reactNative.PixelRatio.get(),
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-eae395d9.cjs.prod.js');
5
+ var index = require('../../dist/index-e0fec69f.cjs.prod.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -251,6 +251,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
251
251
  performance,
252
252
  raycaster,
253
253
  camera,
254
+ scene,
254
255
  onPointerMissed,
255
256
  onCreated,
256
257
  ...props
@@ -330,6 +331,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
330
331
  performance,
331
332
  raycaster,
332
333
  camera,
334
+ scene,
333
335
  // expo-gl can only render at native dpr/resolution
334
336
  // https://github.com/expo/expo-three/issues/39
335
337
  dpr: reactNative.PixelRatio.get(),
@@ -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-27578f8f.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-27578f8f.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-673ef987.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-673ef987.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';
@@ -224,6 +224,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
224
224
  performance,
225
225
  raycaster,
226
226
  camera,
227
+ scene,
227
228
  onPointerMissed,
228
229
  onCreated,
229
230
  ...props
@@ -303,6 +304,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
303
304
  performance,
304
305
  raycaster,
305
306
  camera,
307
+ scene,
306
308
  // expo-gl can only render at native dpr/resolution
307
309
  // https://github.com/expo/expo-three/issues/39
308
310
  dpr: PixelRatio.get(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/fiber",
3
- "version": "8.13.5",
3
+ "version": "8.13.7",
4
4
  "description": "A React renderer for Threejs",
5
5
  "keywords": [
6
6
  "react",