@react-three/test-renderer 8.1.3 → 8.1.4

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,11 @@
1
1
  # @react-three/test-renderer
2
2
 
3
+ ## 8.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 53ba22d3: fix(RTTR): fallback to canvas shim
8
+
3
9
  ## 8.1.3
4
10
 
5
11
  ### Patch Changes
@@ -603,9 +603,7 @@ const createCanvas = ({
603
603
  height = 800
604
604
  } = {}) => {
605
605
  var _globalThis$WebGLRend, _globalThis$WebGL2Ren;
606
- const canvas = {
607
- width,
608
- height,
606
+ const canvas = typeof document !== 'undefined' && typeof document.createElement === 'function' ? document.createElement('canvas') : {
609
607
  style: {},
610
608
  addEventListener: () => {},
611
609
  removeEventListener: () => {},
@@ -613,6 +611,8 @@ const createCanvas = ({
613
611
  clientHeight: height,
614
612
  getContext: () => new WebGL2RenderingContext(canvas)
615
613
  };
614
+ canvas.width = width;
615
+ canvas.height = height;
616
616
  beforeReturn == null ? void 0 : beforeReturn(canvas);
617
617
  class WebGLRenderingContext extends WebGL2RenderingContext {}
618
618
  // @ts-ignore
@@ -603,9 +603,7 @@ const createCanvas = ({
603
603
  height = 800
604
604
  } = {}) => {
605
605
  var _globalThis$WebGLRend, _globalThis$WebGL2Ren;
606
- const canvas = {
607
- width,
608
- height,
606
+ const canvas = typeof document !== 'undefined' && typeof document.createElement === 'function' ? document.createElement('canvas') : {
609
607
  style: {},
610
608
  addEventListener: () => {},
611
609
  removeEventListener: () => {},
@@ -613,6 +611,8 @@ const createCanvas = ({
613
611
  clientHeight: height,
614
612
  getContext: () => new WebGL2RenderingContext(canvas)
615
613
  };
614
+ canvas.width = width;
615
+ canvas.height = height;
616
616
  beforeReturn == null ? void 0 : beforeReturn(canvas);
617
617
  class WebGLRenderingContext extends WebGL2RenderingContext {}
618
618
  // @ts-ignore
@@ -579,9 +579,7 @@ const createCanvas = ({
579
579
  height = 800
580
580
  } = {}) => {
581
581
  var _globalThis$WebGLRend, _globalThis$WebGL2Ren;
582
- const canvas = {
583
- width,
584
- height,
582
+ const canvas = typeof document !== 'undefined' && typeof document.createElement === 'function' ? document.createElement('canvas') : {
585
583
  style: {},
586
584
  addEventListener: () => {},
587
585
  removeEventListener: () => {},
@@ -589,6 +587,8 @@ const createCanvas = ({
589
587
  clientHeight: height,
590
588
  getContext: () => new WebGL2RenderingContext(canvas)
591
589
  };
590
+ canvas.width = width;
591
+ canvas.height = height;
592
592
  beforeReturn == null ? void 0 : beforeReturn(canvas);
593
593
  class WebGLRenderingContext extends WebGL2RenderingContext {}
594
594
  // @ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/test-renderer",
3
- "version": "8.1.3",
3
+ "version": "8.1.4",
4
4
  "description": "Test Renderer for react-three-fiber",
5
5
  "author": "Josh Ellis",
6
6
  "license": "MIT",