@reactunity/renderer 0.14.3 → 0.14.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.
@@ -7,9 +7,11 @@ import { asyncReconciler } from './async/reconciler';
7
7
  import { isDevelopment } from './constants';
8
8
  import { syncReconciler } from './sync/reconciler';
9
9
  var containerMap = new Map();
10
+ var renderCount = 0;
10
11
  export var Renderer = {
11
12
  render: function (element, options) {
12
13
  if (options === void 0) { options = {}; }
14
+ renderCount++;
13
15
  var hostContainer = (options === null || options === void 0 ? void 0 : options.hostContainer) || HostContainer;
14
16
  var cacheKey = hostContainer.InstanceId >= 0 ? hostContainer.InstanceId : hostContainer;
15
17
  var isAsync = !(options === null || options === void 0 ? void 0 : options.disableBatchRendering);
@@ -38,7 +40,7 @@ export var Renderer = {
38
40
  }
39
41
  return Array.prototype.push.apply(commands_1, args);
40
42
  };
41
- var hostContainerInstance = {
43
+ var hostContainerInstance_1 = {
42
44
  type: 'native',
43
45
  commands: commands_1,
44
46
  component: hostContainer,
@@ -51,9 +53,9 @@ export var Renderer = {
51
53
  return;
52
54
  var serialized = JSON.stringify(commands_1);
53
55
  commands_1.length = 0;
54
- hostContainer.Context.FlushCommands(serialized);
56
+ hostContainerInstance_1.context.FlushCommands(serialized);
55
57
  };
56
- hostRoot = asyncReconciler.createContainer(hostContainerInstance, mode, null, false, undefined, '', function (error) { return console.error(error); }, null);
58
+ hostRoot = asyncReconciler.createContainer(hostContainerInstance_1, mode, null, false, undefined, '', function (error) { return console.error(error); }, null);
57
59
  }
58
60
  else {
59
61
  hostRoot = syncReconciler.createContainer(hostContainer, mode, null, false, undefined, '', function (error) { return console.error(error); }, null);
@@ -64,6 +66,7 @@ export var Renderer = {
64
66
  if (shouldWrapWithHelpers) {
65
67
  var viewWrapperProps = {
66
68
  withHelpers: !(options === null || options === void 0 ? void 0 : options.disableHelpers),
69
+ renderCount: renderCount,
67
70
  };
68
71
  element = createElement(DefaultView, viewWrapperProps, element);
69
72
  }
@@ -1 +1 @@
1
- export declare const version = "0.14.3";
1
+ export declare const version = "0.14.4";
@@ -1 +1 @@
1
- export var version = '0.14.3';
1
+ export var version = '0.14.4';
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
  interface Props {
3
3
  children?: ReactNode;
4
4
  withHelpers: boolean;
5
+ renderCount: number;
5
6
  }
6
- export declare function DefaultView({ children, withHelpers }: Props): JSX.Element;
7
+ export declare function DefaultView({ children, withHelpers, renderCount }: Props): JSX.Element;
7
8
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { ErrorBoundary } from './error-boundary';
3
3
  export function DefaultView(_a) {
4
- var children = _a.children, withHelpers = _a.withHelpers;
4
+ var children = _a.children, withHelpers = _a.withHelpers, renderCount = _a.renderCount;
5
5
  return _jsx(_Fragment, { children: !withHelpers ? children :
6
- _jsx(ErrorBoundary, { children: children }) });
6
+ _jsx(ErrorBoundary, { children: children }, renderCount) });
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactunity/renderer",
3
- "version": "0.14.3",
3
+ "version": "0.14.4",
4
4
  "description": "React renderer for Unity3D",
5
5
  "types": "dist/index.d.ts",
6
6
  "typings": "dist/index.d.ts",