# When is emitReadyEvent needed?

**URL:** <https://community.developer.atlassian.com/t/when-is-emitreadyevent-needed/94672>\
**Category:** Confluence Cloud\
**Created:** [August 20, 2025, 10:06am UTC](https://community.developer.atlassian.com/t/when-is-emitreadyevent-needed/94672 "2025-08-20T10:06:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonboileau](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jasonboileau](https://community.developer.atlassian.com/u/jasonboileau)\
**Post date:** [August 20, 2025, 10:06am UTC](https://community.developer.atlassian.com/t/when-is-emitreadyevent-needed/94672/1 "2025-08-20T10:06:34Z")

</div>

Forge macros have an optional emitReadyEvent property:

> This enables Confluence or other consumers, such as our PDF export service, to reliably detect when macros are fully loaded

Outside of exports of UI Kit macros (is that possible?), does that event serve any purpose? What is meant by “Confluence or other consumers” ?

---

<div class="post-metadata">

**Author:** ![rr1](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rr1/32/35984_2.png) [@rr1](https://community.developer.atlassian.com/u/rr1)\
**Post date:** [September 26, 2025, 12:14pm UTC](https://community.developer.atlassian.com/t/when-is-emitreadyevent-needed/94672/2 "2025-09-26T12:14:03Z")

</div>

I have basically the same question.

I have a macro with body that renders the result of a calculation. The Word Export of the page will always render the original macro body, while the PDF Export will always render the content generated by the macro. So the Word Export is broken, the PDF Export is as intended.

It makes no difference if I add the code as shown in the example for [emitReadyEvent](https://developer.atlassian.com/platform/forge/apis-reference/ui-api-bridge/view/#emitreadyevent), add a attribute, or do not emit the event at all.

Are there any Forge examples that show, how the use of this feature is intended? Would this feature fix the issue with the Word Export?

---

<div class="post-metadata">

**Author:** ![Chris\_at\_DigitalRose](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/chris_at_digitalrose/32/41070_2.png) [@Chris\_at\_DigitalRose](https://community.developer.atlassian.com/u/Chris_at_DigitalRose)\
**Post date:** [September 28, 2025, 8:51pm UTC](https://community.developer.atlassian.com/t/when-is-emitreadyevent-needed/94672/3 "2025-09-28T20:51:57Z")

</div>

Non Atlassian here, and I agree the documentation is very light. We tested view.emitReadyEvent() internally, and found that it helps the PDF export finish much faster. I think it is a flag for the background PDF renderer to know the macro is finished loading, rather than waiting for a some timeout.

Exporting a PDF page in confluence with 3 custom UI forge macros ( no export or adfExport functions defined ).

- without emitReadyEvent - ~100 seconds
- with emitReadyEvent - ~20 seconds

Chris

---

<div class="post-metadata">

**Author:** ![rr1](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rr1/32/35984_2.png) [@rr1](https://community.developer.atlassian.com/u/rr1)\
**Post date:** [September 29, 2025, 9:06am UTC](https://community.developer.atlassian.com/t/when-is-emitreadyevent-needed/94672/4 "2025-09-29T09:06:39Z")

</div>

Hi Chris,  
Thank you for your reply!

I do not see any performance improvements when I run my code exporting PDF. It is about 17 seconds with our without the emitReadyEvent callled. And the Word Export is never correct.

Now I wonder, if may code is correctly using the emitReadyEvent feature. I am very new to Forge and React. So I may be missing some basic concepts.

I have the **emitsReadyEvent: true** in my manifest with the macro definition. My code is like this, which is - at least to my limited knowledge - quite similar to the example found at [https://developer.atlassian.com/platform/forge/apis-reference/ui-api-bridge/view/#emitreadyevent](https://developer.atlassian.com/platform/forge/apis-reference/ui-api-bridge/view/#emitreadyevent)):

```auto
const [data, setData] = useState();
useEffect(() => {
  const loadData = async () => {
    invoke('getText', {example: 'my-invoke-variable'}).then(setData);
    await view.emitReadyEvent();
  };

  loadData();
}, [context]);

if (show()) {
  return data ?
    <>
      <Text>ok {data}!</Text>
    </>
    :
    <>
      <Text>Pending ...</Text>
    </>;
}
return (<>
</>);

```

But does this not emit the even prior to the end of the response generation?

Some AI proposed the following code where the event is signaled by an attribute with the generated code:

> if (!config.hide || “off” === (config.hide)) {  
> return data ?  
> \<Fragment **emitReadyEvent={true}** \>  
> ok {data}!  
> :  
> \<\> Pending … \</\>; }  
> return (\<\> \</\>);

But I have not found that in the documentation so it may be a hallucination?

So I probably using the **emitReadyEvent** wrong? Could you share the part of your code that works?

Cheers,  
Robert

---

<div class="post-metadata">

**Author:** ![Chris\_at\_DigitalRose](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/chris_at_digitalrose/32/41070_2.png) [@Chris\_at\_DigitalRose](https://community.developer.atlassian.com/u/Chris_at_DigitalRose)\
**Post date:** [September 29, 2025, 5:16pm UTC](https://community.developer.atlassian.com/t/when-is-emitreadyevent-needed/94672/5 "2025-09-29T17:16:21Z")

</div>

Hi, we are not using React for this custom UI, so this may be of limited use. The code snippet is very simple and called as the last item after the page rendering is complete:

```auto
import * as Bridge from '@forge/bridge'; 

async function render() {
  try {
    ...
  }
  catch {
  } 
  finally {
    // notify renderer for PDF export
    await Bridge.view.emitReadyEvent();
  }
}

```

Maybe somebody from Atlassian can chime in?

---

<div class="post-metadata">

**Author:** ![rr1](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rr1/32/35984_2.png) [@rr1](https://community.developer.atlassian.com/u/rr1)\
**Post date:** [September 30, 2025, 9:03am UTC](https://community.developer.atlassian.com/t/when-is-emitreadyevent-needed/94672/6 "2025-09-30T09:03:07Z")

</div>

Hi Chris,  
Thank you for your reply!

It seems to me that you create the response and just before it is returned emit the event in the finally block. This helps a lot since I can discard the “attribute stuff”. I’ll try this and check, it it makes any difference for my “Word Export” problem …

Thank you for sharing!

If there is information from the Atlassian Team, I’d be happy to have further information on this topic.

Cheers,  
Robert

---

<div class="post-metadata">

**Author:** ![rr1](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rr1/32/35984_2.png) [@rr1](https://community.developer.atlassian.com/u/rr1)\
**Post date:** [September 30, 2025, 3:37pm UTC](https://community.developer.atlassian.com/t/when-is-emitreadyevent-needed/94672/7 "2025-09-30T15:37:44Z")

</div>

Just a short follow up in case someone is as new to Forge as I am:

- It took me quite some time to learn that the **emitReadEvent fails when in the tunnel**. Otherwise the solution presented by Chris works like a charm!
- The “Word Export” still does not work. The issue here is probably somewhere else, since it works for “PDF Export”.
- The emitReadyEvent also does not prevent the body from being rendered (that is why I looked into this). It is a feature to improve performance (again see Chris’ post for figures) for the export (as advertised in the docs).
