@react-three/fiber 8.15.17 → 8.15.19
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 +12 -0
- package/dist/declarations/src/core/index.d.ts +2 -2
- package/dist/declarations/src/core/loop.d.ts +9 -4
- package/dist/declarations/src/core/store.d.ts +2 -1
- package/dist/{index-e873c87f.cjs.prod.js → index-87af8422.cjs.prod.js} +1 -9
- package/dist/{index-38c9b12f.cjs.dev.js → index-b90e75f9.cjs.dev.js} +1 -9
- package/dist/{index-ca597524.esm.js → index-e6b5343a.esm.js} +1 -9
- package/dist/react-three-fiber.cjs.dev.js +1 -1
- package/dist/react-three-fiber.cjs.prod.js +1 -1
- package/dist/react-three-fiber.esm.js +2 -2
- package/native/dist/react-three-fiber-native.cjs.dev.js +1 -1
- package/native/dist/react-three-fiber-native.cjs.prod.js +1 -1
- package/native/dist/react-three-fiber-native.esm.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @react-three/fiber
|
|
2
2
|
|
|
3
|
+
## 8.15.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 74926b94: fix(types): avoid emitting THREE.XRFrame
|
|
8
|
+
|
|
9
|
+
## 8.15.18
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 8c01939a: fix: correctly pass frames in invalidate
|
|
14
|
+
|
|
3
15
|
## 8.15.17
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -5,13 +5,13 @@ import { UseBoundStore } from 'zustand';
|
|
|
5
5
|
import * as ReactThreeFiber from '../three-types';
|
|
6
6
|
import { Renderer, context, RootState, Size, Dpr, Performance, PrivateKeys } from './store';
|
|
7
7
|
import { extend, Root } from './renderer';
|
|
8
|
-
import { addEffect, addAfterEffect, addTail, flushGlobalEffects } from './loop';
|
|
8
|
+
import { addEffect, addAfterEffect, addTail, flushGlobalEffects, Invalidate, Advance } from './loop';
|
|
9
9
|
import { EventManager, ComputeFunction } from './events';
|
|
10
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>;
|
|
14
|
-
declare const invalidate:
|
|
14
|
+
declare const invalidate: Invalidate, advance: Advance;
|
|
15
15
|
declare const reconciler: import("react-reconciler").Reconciler<UseBoundStore<RootState, import("zustand").StoreApi<RootState>>, import("./renderer").Instance, void, import("./renderer").Instance, import("./renderer").Instance>, applyProps: typeof import("./utils").applyProps;
|
|
16
16
|
declare type GLProps = Renderer | ((canvas: Canvas) => Renderer) | Partial<Properties<THREE.WebGLRenderer> | THREE.WebGLRendererParameters> | undefined;
|
|
17
17
|
export declare type RenderProps<TCanvas extends Canvas> = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Root } from './renderer';
|
|
2
2
|
import { RootState } from './store';
|
|
3
|
+
import { _XRFrame } from './utils';
|
|
3
4
|
export declare type GlobalRenderCallback = (timeStamp: number) => void;
|
|
4
5
|
/**
|
|
5
6
|
* Adds a global render callback which is called each frame.
|
|
@@ -18,16 +19,20 @@ export declare const addAfterEffect: (callback: GlobalRenderCallback) => () => v
|
|
|
18
19
|
export declare const addTail: (callback: GlobalRenderCallback) => () => void;
|
|
19
20
|
export declare type GlobalEffectType = 'before' | 'after' | 'tail';
|
|
20
21
|
export declare function flushGlobalEffects(type: GlobalEffectType, timestamp: number): void;
|
|
21
|
-
export declare
|
|
22
|
+
export declare type Invalidate = (state?: RootState, frames?: number) => void;
|
|
23
|
+
export declare type Advance = (timestamp: number, runGlobalEffects?: boolean, state?: RootState, frame?: _XRFrame) => void;
|
|
24
|
+
interface Loop {
|
|
22
25
|
loop: (timestamp: number) => void;
|
|
23
26
|
/**
|
|
24
27
|
* Invalidates the view, requesting a frame to be rendered. Will globally invalidate unless passed a root's state.
|
|
25
28
|
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#invalidate
|
|
26
29
|
*/
|
|
27
|
-
invalidate:
|
|
30
|
+
invalidate: Invalidate;
|
|
28
31
|
/**
|
|
29
32
|
* Advances the frameloop and runs render effects, useful for when manually rendering via `frameloop="never"`.
|
|
30
33
|
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
31
34
|
*/
|
|
32
|
-
advance:
|
|
33
|
-
}
|
|
35
|
+
advance: Advance;
|
|
36
|
+
}
|
|
37
|
+
export declare function createLoop<TCanvas>(roots: Map<TCanvas, Root>): Loop;
|
|
38
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { GetState, SetState, StoreApi, UseBoundStore } from 'zustand';
|
|
4
4
|
import { DomEvent, EventManager, PointerCaptureTarget, ThreeEvent } from './events';
|
|
5
5
|
import { _XRFrame, Camera } from './utils';
|
|
6
|
+
import { Advance, Invalidate } from './loop';
|
|
6
7
|
export declare const privateKeys: readonly ["set", "get", "setSize", "setFrameloop", "setDpr", "events", "invalidate", "advance", "size", "viewport"];
|
|
7
8
|
export declare type PrivateKeys = typeof privateKeys[number];
|
|
8
9
|
export interface Intersection extends THREE.Intersection {
|
|
@@ -133,5 +134,5 @@ export declare type RootState = {
|
|
|
133
134
|
internal: InternalState;
|
|
134
135
|
};
|
|
135
136
|
declare const context: React.Context<UseBoundStore<RootState, StoreApi<RootState>>>;
|
|
136
|
-
declare const createStore: (invalidate:
|
|
137
|
+
declare const createStore: (invalidate: Invalidate, advance: Advance) => UseBoundStore<RootState>;
|
|
137
138
|
export { createStore, context };
|
|
@@ -1608,7 +1608,7 @@ function createLoop(roots) {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
function invalidate(state, frames = 1) {
|
|
1610
1610
|
var _state$gl$xr2;
|
|
1611
|
-
if (!state) return roots.forEach(root => invalidate(root.store.getState()
|
|
1611
|
+
if (!state) return roots.forEach(root => invalidate(root.store.getState(), frames));
|
|
1612
1612
|
if ((_state$gl$xr2 = state.gl.xr) != null && _state$gl$xr2.isPresenting || !state.internal.active || state.frameloop === 'never') return;
|
|
1613
1613
|
// Increase frames, do not go higher than 60
|
|
1614
1614
|
state.internal.frames = Math.min(60, state.internal.frames + frames);
|
|
@@ -1625,15 +1625,7 @@ function createLoop(roots) {
|
|
|
1625
1625
|
}
|
|
1626
1626
|
return {
|
|
1627
1627
|
loop,
|
|
1628
|
-
/**
|
|
1629
|
-
* Invalidates the view, requesting a frame to be rendered. Will globally invalidate unless passed a root's state.
|
|
1630
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#invalidate
|
|
1631
|
-
*/
|
|
1632
1628
|
invalidate,
|
|
1633
|
-
/**
|
|
1634
|
-
* Advances the frameloop and runs render effects, useful for when manually rendering via `frameloop="never"`.
|
|
1635
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
1636
|
-
*/
|
|
1637
1629
|
advance
|
|
1638
1630
|
};
|
|
1639
1631
|
}
|
|
@@ -1608,7 +1608,7 @@ function createLoop(roots) {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
function invalidate(state, frames = 1) {
|
|
1610
1610
|
var _state$gl$xr2;
|
|
1611
|
-
if (!state) return roots.forEach(root => invalidate(root.store.getState()
|
|
1611
|
+
if (!state) return roots.forEach(root => invalidate(root.store.getState(), frames));
|
|
1612
1612
|
if ((_state$gl$xr2 = state.gl.xr) != null && _state$gl$xr2.isPresenting || !state.internal.active || state.frameloop === 'never') return;
|
|
1613
1613
|
// Increase frames, do not go higher than 60
|
|
1614
1614
|
state.internal.frames = Math.min(60, state.internal.frames + frames);
|
|
@@ -1625,15 +1625,7 @@ function createLoop(roots) {
|
|
|
1625
1625
|
}
|
|
1626
1626
|
return {
|
|
1627
1627
|
loop,
|
|
1628
|
-
/**
|
|
1629
|
-
* Invalidates the view, requesting a frame to be rendered. Will globally invalidate unless passed a root's state.
|
|
1630
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#invalidate
|
|
1631
|
-
*/
|
|
1632
1628
|
invalidate,
|
|
1633
|
-
/**
|
|
1634
|
-
* Advances the frameloop and runs render effects, useful for when manually rendering via `frameloop="never"`.
|
|
1635
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
1636
|
-
*/
|
|
1637
1629
|
advance
|
|
1638
1630
|
};
|
|
1639
1631
|
}
|
|
@@ -1581,7 +1581,7 @@ function createLoop(roots) {
|
|
|
1581
1581
|
}
|
|
1582
1582
|
function invalidate(state, frames = 1) {
|
|
1583
1583
|
var _state$gl$xr2;
|
|
1584
|
-
if (!state) return roots.forEach(root => invalidate(root.store.getState()
|
|
1584
|
+
if (!state) return roots.forEach(root => invalidate(root.store.getState(), frames));
|
|
1585
1585
|
if ((_state$gl$xr2 = state.gl.xr) != null && _state$gl$xr2.isPresenting || !state.internal.active || state.frameloop === 'never') return;
|
|
1586
1586
|
// Increase frames, do not go higher than 60
|
|
1587
1587
|
state.internal.frames = Math.min(60, state.internal.frames + frames);
|
|
@@ -1598,15 +1598,7 @@ function createLoop(roots) {
|
|
|
1598
1598
|
}
|
|
1599
1599
|
return {
|
|
1600
1600
|
loop,
|
|
1601
|
-
/**
|
|
1602
|
-
* Invalidates the view, requesting a frame to be rendered. Will globally invalidate unless passed a root's state.
|
|
1603
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#invalidate
|
|
1604
|
-
*/
|
|
1605
1601
|
invalidate,
|
|
1606
|
-
/**
|
|
1607
|
-
* Advances the frameloop and runs render effects, useful for when manually rendering via `frameloop="never"`.
|
|
1608
|
-
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
1609
|
-
*/
|
|
1610
1602
|
advance
|
|
1611
1603
|
};
|
|
1612
1604
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-b90e75f9.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-
|
|
5
|
+
var index = require('./index-87af8422.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-
|
|
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-
|
|
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-e6b5343a.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-e6b5343a.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-
|
|
5
|
+
var index = require('../../dist/index-b90e75f9.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('../../dist/index-
|
|
5
|
+
var index = require('../../dist/index-87af8422.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, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-
|
|
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-
|
|
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-e6b5343a.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-e6b5343a.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';
|