Avoid incrementing the "RT" "last revealed boundary" throttle time when 'revealing' a boundary that is inside a hidden boundary#35777
Hidden character warning
Conversation
When setting the timeout for revealing completed boundaries, we should not be adding the 300ms throttle for "the last time we revealed a boundary" if the boundary we revealed was just moved inside of a "still suspended" boundary. Using the same logic here as what we do for View Transitions to determine if ParentInstance is a "hidden" boundary to avoid animation.
| continue; | ||
| } | ||
|
|
||
| const parentRect = parentInstance.getBoundingClientRect(); |
There was a problem hiding this comment.
I don't think we want to check getBoundingClientRect which can call a layout flush. My local fix instead just recurses up the tree and makes sure that the parent chain is mounted in the document and that none of the anchestor has a hidden attribute.
|
Comparing: 03ca38e...128f776 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
|
Here's the demo app that explain the issue more: https://github.com/bgirard/fizz-suspense-demo In particular read through: https://github.com/bgirard/fizz-suspense-demo/blob/master/src/app/page.tsx The issue here is we have a hero element. I expect Fizz to show it at 1.8s. But section E incorrectly starts the 300ms delay when it resolves at 1.75s. But Section E is never visible since its parent is still suspended. So starting a delay for this makes no sense.
This is showing up in a production app and causing a 200-300ms delay in some traces. |

When setting the timeout for revealing completed boundaries, we should not be adding the 300ms throttle for "the last time we revealed a boundary" if the boundary we revealed was just moved inside of a "still suspended" boundary. Using the same logic here as what we do for View Transitions to determine if ParentInstance is a "hidden" boundary to avoid animation.
Summary
How did you test this change?