@kubb/react-fabric 0.9.0 → 0.9.2

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.
@@ -69,19 +69,15 @@ var ErrorBoundary = class extends import_react.Component {
69
69
  _defineProperty(ErrorBoundary, "displayName", "KubbErrorBoundary");
70
70
  const RootContext = (0, import_react.createContext)({ exit: () => {} });
71
71
  function Root({ onError, onExit: onExit$1, children }) {
72
- try {
73
- return /* @__PURE__ */ jsx(ErrorBoundary, {
74
- onError: (error) => {
75
- onError(error);
76
- },
77
- children: /* @__PURE__ */ jsx(RootContext.Provider, {
78
- value: { exit: onExit$1 },
79
- children
80
- })
81
- });
82
- } catch (_e) {
83
- return null;
84
- }
72
+ return /* @__PURE__ */ jsx(ErrorBoundary, {
73
+ onError: (error) => {
74
+ onError(error);
75
+ },
76
+ children: /* @__PURE__ */ jsx(RootContext.Provider, {
77
+ value: { exit: onExit$1 },
78
+ children
79
+ })
80
+ });
85
81
  }
86
82
  Root.Context = RootContext;
87
83
  Root.displayName = "KubbRoot";
@@ -15438,6 +15434,7 @@ function _classPrivateFieldSet2(s, a, r) {
15438
15434
  //#region src/Runtime.tsx
15439
15435
  var _options = /* @__PURE__ */ new WeakMap();
15440
15436
  var _isUnmounted = /* @__PURE__ */ new WeakMap();
15437
+ var _renderError = /* @__PURE__ */ new WeakMap();
15441
15438
  var _container = /* @__PURE__ */ new WeakMap();
15442
15439
  var _rootNode = /* @__PURE__ */ new WeakMap();
15443
15440
  var _renderPromise = /* @__PURE__ */ new WeakMap();
@@ -15447,6 +15444,7 @@ var Runtime = class {
15447
15444
  _classPrivateMethodInitSpec(this, _Runtime_brand);
15448
15445
  _classPrivateFieldInitSpec(this, _options, void 0);
15449
15446
  _classPrivateFieldInitSpec(this, _isUnmounted, void 0);
15447
+ _classPrivateFieldInitSpec(this, _renderError, void 0);
15450
15448
  _defineProperty(this, "exitPromise", void 0);
15451
15449
  _classPrivateFieldInitSpec(this, _container, void 0);
15452
15450
  _classPrivateFieldInitSpec(this, _rootNode, void 0);
@@ -15474,7 +15472,6 @@ var Runtime = class {
15474
15472
  });
15475
15473
  _classPrivateFieldSet2(_renderPromise, this, task.catch((error) => {
15476
15474
  this.onError(error);
15477
- throw error;
15478
15475
  }));
15479
15476
  return _classPrivateFieldGet2(_renderPromise, this);
15480
15477
  });
@@ -15484,11 +15481,10 @@ var Runtime = class {
15484
15481
  _classPrivateFieldGet2(_rootNode, this).onImmediateRender = this.onRender;
15485
15482
  _classPrivateFieldSet2(_isUnmounted, this, false);
15486
15483
  this.unmount.bind(this);
15487
- const originalError = console.error;
15488
15484
  console.error = (data) => {
15489
15485
  const message = typeof data === "string" ? data : data === null || data === void 0 ? void 0 : data.message;
15490
15486
  if ((message === null || message === void 0 ? void 0 : message.match(/Encountered two children with the same key/gi)) || (message === null || message === void 0 ? void 0 : message.match(/React will try to recreat/gi)) || (message === null || message === void 0 ? void 0 : message.match(/Each child in a list should have a unique/gi)) || (message === null || message === void 0 ? void 0 : message.match(/The above error occurred in the <KubbErrorBoundary/gi)) || (message === null || message === void 0 ? void 0 : message.match(/A React Element from an older version of React was render/gi))) return;
15491
- originalError(data);
15487
+ console.log(data);
15492
15488
  };
15493
15489
  const logRecoverableError = typeof reportError === "function" ? reportError : console.error;
15494
15490
  const rootTag = import_constants.ConcurrentRoot;
@@ -15507,7 +15503,7 @@ var Runtime = class {
15507
15503
  }
15508
15504
  onError(error) {
15509
15505
  if (process$1.env.NODE_ENV === "test") console.warn(error);
15510
- throw error;
15506
+ _classPrivateFieldSet2(_renderError, this, error);
15511
15507
  }
15512
15508
  onExit(error) {
15513
15509
  this.unmount(error);
@@ -15521,6 +15517,11 @@ var Runtime = class {
15521
15517
  Renderer.updateContainerSync(element, _classPrivateFieldGet2(_container, this), null, null);
15522
15518
  Renderer.flushSyncWork();
15523
15519
  await _classPrivateFieldGet2(_renderPromise, this);
15520
+ if (_classPrivateFieldGet2(_renderError, this)) {
15521
+ const error = _classPrivateFieldGet2(_renderError, this);
15522
+ _classPrivateFieldSet2(_renderError, this, void 0);
15523
+ throw error;
15524
+ }
15524
15525
  }
15525
15526
  async renderToString(node) {
15526
15527
  const element = /* @__PURE__ */ jsx(Root, {
@@ -15532,6 +15533,11 @@ var Runtime = class {
15532
15533
  Renderer.flushSyncWork();
15533
15534
  await _classPrivateFieldGet2(_renderPromise, this);
15534
15535
  this.fileManager.clear();
15536
+ if (_classPrivateFieldGet2(_renderError, this)) {
15537
+ const error = _classPrivateFieldGet2(_renderError, this);
15538
+ _classPrivateFieldSet2(_renderError, this, void 0);
15539
+ throw error;
15540
+ }
15535
15541
  return _assertClassBrand(_Runtime_brand, this, _getOutput).call(this, _classPrivateFieldGet2(_rootNode, this));
15536
15542
  }
15537
15543
  unmount(error) {
@@ -15593,4 +15599,4 @@ const reactPlugin = definePlugin({
15593
15599
 
15594
15600
  //#endregion
15595
15601
  export { _classPrivateFieldInitSpec as a, _classPrivateFieldGet2 as i, Runtime as n, Root as o, _classPrivateFieldSet2 as r, RootContext as s, reactPlugin as t };
15596
- //# sourceMappingURL=reactPlugin-CNfZ6eQk.js.map
15602
+ //# sourceMappingURL=reactPlugin-ixOr00MK.js.map