npm package diff
Package: @forge/react
Versions: 10.7.1-next.1 - 10.7.1-next.2
File: package/out/reconciler.js
Index: package/out/reconciler.js
===================================================================
--- package/out/reconciler.js
+++ package/out/reconciler.js
@@ -32,8 +32,17 @@
}
}
return props;
};
+const handleReconcilerError = async (error) => {
+ try {
+ await self?.__bridge?.callBridge('onError', { error });
+ }
+ catch (e) {
+ // eslint-disable-next-line no-console
+ console.log('error calling bridge onError', e);
+ }
+};
const callBridge = function (cmd, data) {
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-floating-promises
self?.__bridge?.callBridge(cmd, data);
@@ -213,9 +222,16 @@
const container = reconciler.createContainer(rootElement, 0, null, false, null, 'root', (err) => {
// eslint-disable-next-line no-console
console.log(err);
}, null);
- reconciler.updateContainer(element, container, null, null);
+ try {
+ reconciler.updateContainer(element, container, null, null);
+ }
+ catch (e) {
+ // only report errors that are not recoverable
+ void handleReconcilerError(e);
+ throw e;
+ }
},
addConfig: (element) => {
const macroConfigElement = (0, exports.createElement)({ type: 'MacroConfig', props: {}, forgeReactMajorVersion: 10 });
const container = reconciler.createContainer(macroConfigElement, 0, null, false, null, 'macroConfig', (err) => {