@react-three/test-renderer 10.0.0-canary.39882dd → 10.0.0-canary.42caa10
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/README.md +10 -22
- package/dist/index.cjs +398 -82
- package/dist/index.mjs +402 -72
- package/dist/legacy.cjs +7 -19
- package/dist/legacy.mjs +8 -6
- package/dist/webgpu/index.cjs +7 -29
- package/dist/webgpu/index.d.cts +1 -1
- package/dist/webgpu/index.d.mts +1 -1
- package/dist/webgpu/index.d.ts +1 -1
- package/dist/webgpu/index.mjs +9 -7
- package/package.json +4 -3
package/dist/webgpu/index.cjs
CHANGED
|
@@ -3,23 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const react = require('react');
|
|
6
|
-
const THREE = require('three/webgpu');
|
|
7
6
|
const webgpu = require('@react-three/fiber/webgpu');
|
|
8
7
|
|
|
9
|
-
function _interopNamespaceCompat(e) {
|
|
10
|
-
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
11
|
-
const n = Object.create(null);
|
|
12
|
-
if (e) {
|
|
13
|
-
for (const k in e) {
|
|
14
|
-
n[k] = e[k];
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
n.default = e;
|
|
18
|
-
return n;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const THREE__namespace = /*#__PURE__*/_interopNamespaceCompat(THREE);
|
|
22
|
-
|
|
23
8
|
var __defProp$2 = Object.defineProperty;
|
|
24
9
|
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
25
10
|
var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -1210,6 +1195,11 @@ class WebGL2RenderingContext {
|
|
|
1210
1195
|
getExtension(ext) {
|
|
1211
1196
|
return extensions[ext];
|
|
1212
1197
|
}
|
|
1198
|
+
// WebGPURenderer's WebGL2 fallback backend lists the supported extensions up front and checks
|
|
1199
|
+
// them with `.includes()`, so this has to return an array rather than the no-op stub's undefined
|
|
1200
|
+
getSupportedExtensions() {
|
|
1201
|
+
return Object.keys(extensions);
|
|
1202
|
+
}
|
|
1213
1203
|
}
|
|
1214
1204
|
|
|
1215
1205
|
function setupWebGLMocking() {
|
|
@@ -1398,6 +1388,7 @@ const createVirtualInstance = (object, parent) => {
|
|
|
1398
1388
|
object,
|
|
1399
1389
|
eventCount: 0,
|
|
1400
1390
|
handlers: {},
|
|
1391
|
+
previousVisible: void 0,
|
|
1401
1392
|
isHidden: false
|
|
1402
1393
|
};
|
|
1403
1394
|
if (object.children && object.children.length > 0) {
|
|
@@ -1481,8 +1472,7 @@ async function waitFor(callback, { interval = 50, timeout = 5e3 } = {}) {
|
|
|
1481
1472
|
}
|
|
1482
1473
|
|
|
1483
1474
|
function createTestRenderer(deps) {
|
|
1484
|
-
const {
|
|
1485
|
-
extend(THREE2);
|
|
1475
|
+
const { createRoot, mockRoots, reconciler, act, mode } = deps;
|
|
1486
1476
|
const create = async (element, options) => {
|
|
1487
1477
|
const canvas = createCanvas({ ...options, mode });
|
|
1488
1478
|
const _root = createRoot(canvas);
|
|
@@ -1572,29 +1562,17 @@ const index$1 = {
|
|
|
1572
1562
|
|
|
1573
1563
|
mockWebGPU();
|
|
1574
1564
|
const renderer = createTestRenderer({
|
|
1575
|
-
THREE: THREE__namespace,
|
|
1576
1565
|
createRoot: webgpu.createRoot,
|
|
1577
1566
|
mockRoots: webgpu._roots,
|
|
1578
1567
|
reconciler: webgpu.reconciler,
|
|
1579
1568
|
act: react.act,
|
|
1580
|
-
extend: webgpu.extend,
|
|
1581
1569
|
mode: "webgpu"
|
|
1582
1570
|
});
|
|
1583
1571
|
const { create } = renderer;
|
|
1584
1572
|
const index = { create, act: react.act, waitFor };
|
|
1585
1573
|
|
|
1586
1574
|
exports.act = react.act;
|
|
1587
|
-
exports.clearNodeScope = webgpu.clearNodeScope;
|
|
1588
|
-
exports.clearRootNodes = webgpu.clearRootNodes;
|
|
1589
|
-
exports.clearRootUniforms = webgpu.clearRootUniforms;
|
|
1590
|
-
exports.clearScope = webgpu.clearScope;
|
|
1591
|
-
exports.removeNodes = webgpu.removeNodes;
|
|
1592
|
-
exports.removeUniforms = webgpu.removeUniforms;
|
|
1593
|
-
exports.useLocalNodes = webgpu.useLocalNodes;
|
|
1594
|
-
exports.useNodes = webgpu.useNodes;
|
|
1595
1575
|
exports.useTextures = webgpu.useTextures;
|
|
1596
|
-
exports.useUniform = webgpu.useUniform;
|
|
1597
|
-
exports.useUniforms = webgpu.useUniforms;
|
|
1598
1576
|
exports.ReactThreeTest = index$1;
|
|
1599
1577
|
exports.create = create;
|
|
1600
1578
|
exports.default = index;
|
package/dist/webgpu/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { act } from 'react';
|
|
|
2
2
|
export { act } from 'react';
|
|
3
3
|
import { Instance, RenderProps, Camera, Act } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
export {
|
|
5
|
+
export { TextureEntry, TextureNode, UseTexturesReturn, useTextures } from '@react-three/fiber/webgpu';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Renderer mode for test canvas
|
package/dist/webgpu/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { act } from 'react';
|
|
|
2
2
|
export { act } from 'react';
|
|
3
3
|
import { Instance, RenderProps, Camera, Act } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
export {
|
|
5
|
+
export { TextureEntry, TextureNode, UseTexturesReturn, useTextures } from '@react-three/fiber/webgpu';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Renderer mode for test canvas
|
package/dist/webgpu/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { act } from 'react';
|
|
|
2
2
|
export { act } from 'react';
|
|
3
3
|
import { Instance, RenderProps, Camera, Act } from '@react-three/fiber';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
export {
|
|
5
|
+
export { TextureEntry, TextureNode, UseTexturesReturn, useTextures } from '@react-three/fiber/webgpu';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Renderer mode for test canvas
|
package/dist/webgpu/index.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { act } from 'react';
|
|
2
2
|
export { act } from 'react';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
export { clearNodeScope, clearRootNodes, clearRootUniforms, clearScope, removeNodes, removeUniforms, useLocalNodes, useNodes, useTextures, useUniform, useUniforms } from '@react-three/fiber/webgpu';
|
|
3
|
+
import { createRoot, _roots, reconciler } from '@react-three/fiber/webgpu';
|
|
4
|
+
export { useTextures } from '@react-three/fiber/webgpu';
|
|
6
5
|
|
|
7
6
|
var __defProp$2 = Object.defineProperty;
|
|
8
7
|
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -1194,6 +1193,11 @@ class WebGL2RenderingContext {
|
|
|
1194
1193
|
getExtension(ext) {
|
|
1195
1194
|
return extensions[ext];
|
|
1196
1195
|
}
|
|
1196
|
+
// WebGPURenderer's WebGL2 fallback backend lists the supported extensions up front and checks
|
|
1197
|
+
// them with `.includes()`, so this has to return an array rather than the no-op stub's undefined
|
|
1198
|
+
getSupportedExtensions() {
|
|
1199
|
+
return Object.keys(extensions);
|
|
1200
|
+
}
|
|
1197
1201
|
}
|
|
1198
1202
|
|
|
1199
1203
|
function setupWebGLMocking() {
|
|
@@ -1382,6 +1386,7 @@ const createVirtualInstance = (object, parent) => {
|
|
|
1382
1386
|
object,
|
|
1383
1387
|
eventCount: 0,
|
|
1384
1388
|
handlers: {},
|
|
1389
|
+
previousVisible: void 0,
|
|
1385
1390
|
isHidden: false
|
|
1386
1391
|
};
|
|
1387
1392
|
if (object.children && object.children.length > 0) {
|
|
@@ -1465,8 +1470,7 @@ async function waitFor(callback, { interval = 50, timeout = 5e3 } = {}) {
|
|
|
1465
1470
|
}
|
|
1466
1471
|
|
|
1467
1472
|
function createTestRenderer(deps) {
|
|
1468
|
-
const {
|
|
1469
|
-
extend(THREE2);
|
|
1473
|
+
const { createRoot, mockRoots, reconciler, act, mode } = deps;
|
|
1470
1474
|
const create = async (element, options) => {
|
|
1471
1475
|
const canvas = createCanvas({ ...options, mode });
|
|
1472
1476
|
const _root = createRoot(canvas);
|
|
@@ -1556,12 +1560,10 @@ const index$1 = {
|
|
|
1556
1560
|
|
|
1557
1561
|
mockWebGPU();
|
|
1558
1562
|
const renderer = createTestRenderer({
|
|
1559
|
-
THREE,
|
|
1560
1563
|
createRoot,
|
|
1561
1564
|
mockRoots: _roots,
|
|
1562
1565
|
reconciler,
|
|
1563
1566
|
act,
|
|
1564
|
-
extend,
|
|
1565
1567
|
mode: "webgpu"
|
|
1566
1568
|
});
|
|
1567
1569
|
const { create } = renderer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-three/test-renderer",
|
|
3
|
-
"version": "10.0.0-canary.
|
|
3
|
+
"version": "10.0.0-canary.42caa10",
|
|
4
4
|
"description": "Test Renderer for react-three-fiber",
|
|
5
5
|
"author": "Josh Ellis",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@react-three/fiber": ">=10.0.0-alpha.0",
|
|
39
|
-
"react": ">=19.0 <19.
|
|
39
|
+
"react": ">=19.0 <19.4",
|
|
40
40
|
"three": ">=0.185.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@webgpu/types": "^0.1.64",
|
|
49
49
|
"three": ">=0.185.0",
|
|
50
|
-
"@react-three/fiber": "10.0.0-canary.
|
|
50
|
+
"@react-three/fiber": "10.0.0-canary.42caa10",
|
|
51
|
+
"@react-three/tsl": "10.0.0-canary.42caa10"
|
|
51
52
|
},
|
|
52
53
|
"files": [
|
|
53
54
|
"dist",
|