@react-three/fiber 8.15.8 → 8.15.10

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.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 49158164: fix: don't recursively dispose primitives
8
+
9
+ ## 8.15.9
10
+
11
+ ### Patch Changes
12
+
13
+ - 4cbc5530: fix(native): deopt iOS blob URI path
14
+
3
15
  ## 8.15.8
4
16
 
5
17
  ### Patch Changes
@@ -139,7 +139,7 @@ function createRenderer(_roots, _getEventPriority) {
139
139
  // Since disposal is recursive, we can check the optional dispose arg, which will be undefined
140
140
  // when the reconciler calls it, but then carry our own check recursively
141
141
  const isPrimitive = (_child$__r3f5 = child.__r3f) == null ? void 0 : _child$__r3f5.primitive;
142
- const shouldDispose = dispose === undefined ? child.dispose !== null && !isPrimitive : dispose;
142
+ const shouldDispose = !isPrimitive && (dispose === undefined ? child.dispose !== null : dispose);
143
143
 
144
144
  // Remove nested child objects. Primitives should not have objects and children that are
145
145
  // attached to them declaratively ...
@@ -2143,7 +2143,9 @@ function Portal({
2143
2143
  },
2144
2144
  ...rest
2145
2145
  };
2146
- }, [state]);
2146
+ },
2147
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2148
+ [state]);
2147
2149
  const [usePortalStore] = React.useState(() => {
2148
2150
  // Create a mirrored store, based on the previous root with a few overrides ...
2149
2151
  const previousState = previousRoot.getState();
@@ -2184,9 +2186,11 @@ function Portal({
2184
2186
  unsub();
2185
2187
  usePortalStore.destroy();
2186
2188
  };
2189
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2187
2190
  }, []);
2188
2191
  React.useEffect(() => {
2189
2192
  usePortalStore.setState(injectState => inject(previousRoot.getState(), injectState));
2193
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2190
2194
  }, [inject]);
2191
2195
  return /*#__PURE__*/React.createElement(React.Fragment, null, reconciler.createPortal( /*#__PURE__*/React.createElement(context.Provider, {
2192
2196
  value: usePortalStore
@@ -166,7 +166,7 @@ function createRenderer(_roots, _getEventPriority) {
166
166
  // Since disposal is recursive, we can check the optional dispose arg, which will be undefined
167
167
  // when the reconciler calls it, but then carry our own check recursively
168
168
  const isPrimitive = (_child$__r3f5 = child.__r3f) == null ? void 0 : _child$__r3f5.primitive;
169
- const shouldDispose = dispose === undefined ? child.dispose !== null && !isPrimitive : dispose;
169
+ const shouldDispose = !isPrimitive && (dispose === undefined ? child.dispose !== null : dispose);
170
170
 
171
171
  // Remove nested child objects. Primitives should not have objects and children that are
172
172
  // attached to them declaratively ...
@@ -2170,7 +2170,9 @@ function Portal({
2170
2170
  },
2171
2171
  ...rest
2172
2172
  };
2173
- }, [state]);
2173
+ },
2174
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2175
+ [state]);
2174
2176
  const [usePortalStore] = React__namespace.useState(() => {
2175
2177
  // Create a mirrored store, based on the previous root with a few overrides ...
2176
2178
  const previousState = previousRoot.getState();
@@ -2211,9 +2213,11 @@ function Portal({
2211
2213
  unsub();
2212
2214
  usePortalStore.destroy();
2213
2215
  };
2216
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2214
2217
  }, []);
2215
2218
  React__namespace.useEffect(() => {
2216
2219
  usePortalStore.setState(injectState => inject(previousRoot.getState(), injectState));
2220
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2217
2221
  }, [inject]);
2218
2222
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, reconciler.createPortal( /*#__PURE__*/React__namespace.createElement(context.Provider, {
2219
2223
  value: usePortalStore
@@ -166,7 +166,7 @@ function createRenderer(_roots, _getEventPriority) {
166
166
  // Since disposal is recursive, we can check the optional dispose arg, which will be undefined
167
167
  // when the reconciler calls it, but then carry our own check recursively
168
168
  const isPrimitive = (_child$__r3f5 = child.__r3f) == null ? void 0 : _child$__r3f5.primitive;
169
- const shouldDispose = dispose === undefined ? child.dispose !== null && !isPrimitive : dispose;
169
+ const shouldDispose = !isPrimitive && (dispose === undefined ? child.dispose !== null : dispose);
170
170
 
171
171
  // Remove nested child objects. Primitives should not have objects and children that are
172
172
  // attached to them declaratively ...
@@ -2170,7 +2170,9 @@ function Portal({
2170
2170
  },
2171
2171
  ...rest
2172
2172
  };
2173
- }, [state]);
2173
+ },
2174
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2175
+ [state]);
2174
2176
  const [usePortalStore] = React__namespace.useState(() => {
2175
2177
  // Create a mirrored store, based on the previous root with a few overrides ...
2176
2178
  const previousState = previousRoot.getState();
@@ -2211,9 +2213,11 @@ function Portal({
2211
2213
  unsub();
2212
2214
  usePortalStore.destroy();
2213
2215
  };
2216
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2214
2217
  }, []);
2215
2218
  React__namespace.useEffect(() => {
2216
2219
  usePortalStore.setState(injectState => inject(previousRoot.getState(), injectState));
2220
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2217
2221
  }, [inject]);
2218
2222
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, reconciler.createPortal( /*#__PURE__*/React__namespace.createElement(context.Provider, {
2219
2223
  value: usePortalStore
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-d26c5c57.cjs.dev.js');
5
+ var index = require('./index-28e9146f.cjs.dev.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-e6d64601.cjs.prod.js');
5
+ var index = require('./index-ae8ad041.cjs.prod.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -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-594193f5.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-594193f5.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-0c28a0fd.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-0c28a0fd.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-d26c5c57.cjs.dev.js');
5
+ var index = require('../../dist/index-28e9146f.cjs.dev.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -363,7 +363,6 @@ function polyfills() {
363
363
  };
364
364
  const createFromParts = BlobManager.createFromParts;
365
365
  BlobManager.createFromParts = function (parts, options) {
366
- var _NativeModules$BlobMo2;
367
366
  parts = parts.map(part => {
368
367
  if (part instanceof ArrayBuffer || ArrayBuffer.isView(part)) {
369
368
  part = base64Js.fromByteArray(new Uint8Array(part));
@@ -371,13 +370,17 @@ function polyfills() {
371
370
  return part;
372
371
  });
373
372
  const blob = createFromParts(parts, options);
374
- if (!((_NativeModules$BlobMo2 = reactNative.NativeModules.BlobModule) != null && _NativeModules$BlobMo2.BLOB_URI_SCHEME)) {
375
- blob.data._base64 = '';
376
- for (const part of parts) {
377
- var _data$_base, _data;
378
- blob.data._base64 += (_data$_base = (_data = part.data) == null ? void 0 : _data._base64) != null ? _data$_base : part;
379
- }
373
+
374
+ // Always enable slow but safe path for iOS (previously for Android unauth)
375
+ // https://github.com/pmndrs/react-three-fiber/issues/3075
376
+ // if (!NativeModules.BlobModule?.BLOB_URI_SCHEME) {
377
+ blob.data._base64 = '';
378
+ for (const part of parts) {
379
+ var _data$_base, _data;
380
+ blob.data._base64 += (_data$_base = (_data = part.data) == null ? void 0 : _data._base64) != null ? _data$_base : part;
380
381
  }
382
+ // }
383
+
381
384
  return blob;
382
385
  };
383
386
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-e6d64601.cjs.prod.js');
5
+ var index = require('../../dist/index-ae8ad041.cjs.prod.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -363,7 +363,6 @@ function polyfills() {
363
363
  };
364
364
  const createFromParts = BlobManager.createFromParts;
365
365
  BlobManager.createFromParts = function (parts, options) {
366
- var _NativeModules$BlobMo2;
367
366
  parts = parts.map(part => {
368
367
  if (part instanceof ArrayBuffer || ArrayBuffer.isView(part)) {
369
368
  part = base64Js.fromByteArray(new Uint8Array(part));
@@ -371,13 +370,17 @@ function polyfills() {
371
370
  return part;
372
371
  });
373
372
  const blob = createFromParts(parts, options);
374
- if (!((_NativeModules$BlobMo2 = reactNative.NativeModules.BlobModule) != null && _NativeModules$BlobMo2.BLOB_URI_SCHEME)) {
375
- blob.data._base64 = '';
376
- for (const part of parts) {
377
- var _data$_base, _data;
378
- blob.data._base64 += (_data$_base = (_data = part.data) == null ? void 0 : _data._base64) != null ? _data$_base : part;
379
- }
373
+
374
+ // Always enable slow but safe path for iOS (previously for Android unauth)
375
+ // https://github.com/pmndrs/react-three-fiber/issues/3075
376
+ // if (!NativeModules.BlobModule?.BLOB_URI_SCHEME) {
377
+ blob.data._base64 = '';
378
+ for (const part of parts) {
379
+ var _data$_base, _data;
380
+ blob.data._base64 += (_data$_base = (_data = part.data) == null ? void 0 : _data._base64) != null ? _data$_base : part;
380
381
  }
382
+ // }
383
+
381
384
  return blob;
382
385
  };
383
386
  }
@@ -1,9 +1,9 @@
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-594193f5.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-594193f5.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-0c28a0fd.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-0c28a0fd.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';
6
- import { PanResponder, PixelRatio, View, StyleSheet, Platform, NativeModules, Image } from 'react-native';
6
+ import { PanResponder, PixelRatio, View, StyleSheet, Platform, Image, NativeModules } from 'react-native';
7
7
  import { GLView } from 'expo-gl';
8
8
  import { FiberProvider, useContextBridge } from 'its-fine';
9
9
  import { Asset } from 'expo-asset';
@@ -338,7 +338,6 @@ function polyfills() {
338
338
  };
339
339
  const createFromParts = BlobManager.createFromParts;
340
340
  BlobManager.createFromParts = function (parts, options) {
341
- var _NativeModules$BlobMo2;
342
341
  parts = parts.map(part => {
343
342
  if (part instanceof ArrayBuffer || ArrayBuffer.isView(part)) {
344
343
  part = fromByteArray(new Uint8Array(part));
@@ -346,13 +345,17 @@ function polyfills() {
346
345
  return part;
347
346
  });
348
347
  const blob = createFromParts(parts, options);
349
- if (!((_NativeModules$BlobMo2 = NativeModules.BlobModule) != null && _NativeModules$BlobMo2.BLOB_URI_SCHEME)) {
350
- blob.data._base64 = '';
351
- for (const part of parts) {
352
- var _data$_base, _data;
353
- blob.data._base64 += (_data$_base = (_data = part.data) == null ? void 0 : _data._base64) != null ? _data$_base : part;
354
- }
348
+
349
+ // Always enable slow but safe path for iOS (previously for Android unauth)
350
+ // https://github.com/pmndrs/react-three-fiber/issues/3075
351
+ // if (!NativeModules.BlobModule?.BLOB_URI_SCHEME) {
352
+ blob.data._base64 = '';
353
+ for (const part of parts) {
354
+ var _data$_base, _data;
355
+ blob.data._base64 += (_data$_base = (_data = part.data) == null ? void 0 : _data._base64) != null ? _data$_base : part;
355
356
  }
357
+ // }
358
+
356
359
  return blob;
357
360
  };
358
361
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/fiber",
3
- "version": "8.15.8",
3
+ "version": "8.15.10",
4
4
  "description": "A React renderer for Threejs",
5
5
  "keywords": [
6
6
  "react",