Skip to content

Commit 78cfbbd

Browse files
Merge branch 'master' into v9
2 parents 765ae04 + f2e9bcb commit 78cfbbd

File tree

6 files changed

+98
-9
lines changed

6 files changed

+98
-9
lines changed

docs/advanced/pitfalls.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ If you must use intervals, use references as well, but keep in mind that this is
7171
7272
```jsx
7373
useEffect(() => {
74-
const interval = setInterval(() => ref.current.position.x += 0.1), 1)
74+
const interval = setInterval(() => ref.current.position.x += 0.1, 1)
7575
return () => clearInterval(interval)
7676
}, [])
7777
```

packages/fiber/CHANGELOG.md

+73
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,78 @@
11
# @react-three/fiber
22

3+
## 8.16.0
4+
5+
### Minor Changes
6+
7+
- 6b0ea6eb: feat: add childadded event dispatch
8+
9+
## 8.15.19
10+
11+
### Patch Changes
12+
13+
- 74926b94: fix(types): avoid emitting THREE.XRFrame
14+
15+
## 8.15.18
16+
17+
### Patch Changes
18+
19+
- 8c01939a: fix: correctly pass frames in invalidate
20+
21+
## 8.15.17
22+
23+
### Patch Changes
24+
25+
- 16c2ee97: fix(types): support @types/three@0.162.0
26+
27+
## 8.15.16
28+
29+
### Patch Changes
30+
31+
- 71cd8f96: fix: tonemapping config overwrites userland
32+
- 0bb12fd1: fix(types): remove usage of THREE.Vector
33+
34+
## 8.15.14
35+
36+
### Patch Changes
37+
38+
- 0afc9c12: fix: portal events, update examples
39+
40+
## 8.15.13
41+
42+
### Patch Changes
43+
44+
- 0a399f6d: fix(native): use MSAA for antialias on iOS
45+
46+
## 8.15.12
47+
48+
### Patch Changes
49+
50+
- 496d6f0d: fix: useLoader and XRFrame type fixes
51+
52+
## 8.15.11
53+
54+
### Patch Changes
55+
56+
- 3d9af04d: fix: update import from three examples
57+
58+
## 8.15.10
59+
60+
### Patch Changes
61+
62+
- 49158164: fix: don't recursively dispose primitives
63+
64+
## 8.15.9
65+
66+
### Patch Changes
67+
68+
- 4cbc5530: fix(native): deopt iOS blob URI path
69+
70+
## 8.15.8
71+
72+
### Patch Changes
73+
74+
- 70680832: fix: revert stable sort
75+
376
## 8.15.7
477

578
### Patch Changes

packages/fiber/src/core/hooks.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ function loadingFn<T>(extensions?: Extensions<T>, onProgress?: (event: ProgressE
118118
}
119119
}
120120

121+
type GLTFLike = { scene: THREE.Object3D }
122+
121123
/**
122124
* Synchronously loads and caches assets with a three loader.
123125
*

packages/fiber/src/native/polyfills.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,14 @@ export function polyfills() {
100100

101101
const blob = createFromParts(parts, options)
102102

103-
if (!NativeModules.BlobModule?.BLOB_URI_SCHEME) {
104-
blob.data._base64 = ''
105-
for (const part of parts) {
106-
blob.data._base64 += (part as any).data?._base64 ?? part
107-
}
103+
// Always enable slow but safe path for iOS (previously for Android unauth)
104+
// https://github.com/pmndrs/react-three-fiber/issues/3075
105+
// if (!NativeModules.BlobModule?.BLOB_URI_SCHEME) {
106+
blob.data._base64 = ''
107+
for (const part of parts) {
108+
blob.data._base64 += (part as any).data?._base64 ?? part
108109
}
110+
// }
109111

110112
return blob
111113
}

packages/fiber/tests/hooks.test.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,31 @@ describe('hooks', () => {
8888
})
8989

9090
it('can handle useLoader hook', async () => {
91+
let gltf!: Stdlib.GLTF & ObjectMap
92+
9193
const MockMesh = new THREE.Mesh()
94+
MockMesh.name = 'Scene'
95+
9296
jest.spyOn(Stdlib, 'GLTFLoader').mockImplementation(
9397
() =>
9498
({
9599
load: jest.fn().mockImplementation((_url, onLoad) => {
96-
onLoad(MockMesh)
100+
onLoad({ scene: MockMesh })
97101
}),
98102
} as unknown as Stdlib.GLTFLoader),
99103
)
100104

101105
const Component = () => {
102-
const model = useLoader(Stdlib.GLTFLoader, '/suzanne.glb')
103-
return <primitive object={model} />
106+
gltf = useLoader(Stdlib.GLTFLoader, '/suzanne.glb')
107+
return <primitive object={gltf.scene} />
104108
}
105109

106110
const store = await act(async () => root.render(<Component />))
107111
const { scene } = store.getState()
108112

109113
expect(scene.children[0]).toBe(MockMesh)
114+
expect(gltf.scene).toBe(MockMesh)
115+
expect(gltf.nodes.Scene).toBe(MockMesh)
110116
})
111117

112118
it('can handle useLoader hook with an array of strings', async () => {

packages/test-renderer/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @react-three/test-renderer
22

3+
## 8.2.1
4+
5+
### Patch Changes
6+
7+
- 020bb194: fix(RTTR): set initial size for NaN in viewport
8+
39
## 8.2.0
410

511
### Minor Changes

0 commit comments

Comments
 (0)