@forge/bridge

5.15.2-next.0-experimental-5b726e65.16.0-next.1
out/view/emitReadyEvent.js
~out/view/emitReadyEvent.jsModified
+5
Index: package/out/view/emitReadyEvent.js
===================================================================
--- package/out/view/emitReadyEvent.js
+++ package/out/view/emitReadyEvent.js
@@ -6,15 +6,20 @@
 const bridge_1 = require("../bridge");
 const callBridge = (0, bridge_1.getCallBridge)();
 const EXTENSION_READY = 'EXTENSION_READY';
 const emitReadyEvent = async () => {
+    // Confluence export relies on events instead of `callBridge`
     const context = await view_1.view.getContext();
+    // dispatches event 'forge.bridge.EXTENSION_READY' on product window
     await events_1.events.emit(EXTENSION_READY, {
         localId: context.localId
     });
+    // TODO: Consider using the above event for static macros as well for to avoid two calls
+    // `callBridge` is used for static macros in XEP to signal that the forgeDoc is ready to be snapshotted
     try {
         await callBridge('emitReadyEvent');
     }
     catch {
+        // Silently ignore the error as this app may be calling this method in Confluence view mode where the method is not supported.
     }
 };
 exports.emitReadyEvent = emitReadyEvent;