-
Notifications
You must be signed in to change notification settings - Fork 47k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect loops caused by updates during prerender
When Meta tried rolling out enableSiblingPrerendering internally, there were reports of infinite render loops that we suspect were caused by updates triggered during the render phase. While we don't have an exact repro, we know that theoretically this is possible because any update, included one triggered as a side effect of rendering, will interrupt an in-progress prerender. Although we already have warnings and protections against updates that occur during the render phase, the sibling prerendering experiment introduces new scenarios that could cause previously working (though technically incorrect) product code to regress. The solution in this PR is to maintain a counter of how many times a prerender is interrupted before it successfully completes. Once the counter reaches that threshold, we disable the prerendering mechanism, effectively reverting to the behavior that's in canary today. The counter is reset the next time the update queue is exhausted, allowing for subsequent prerenders to work as before.
- Loading branch information
Showing
5 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters