perf(iframe): lazy-load the iframe widget
Also from PR #6582. An iframe is an entire browsing context, so one scrolled off a tall board is the single most expensive thing a widget can load eagerly - and this one had no loading attribute at all. Records what else was mined from that PR and declined, notably its dynamic() for BoardItemMenu: that component already early-returns null outside edit mode, so there is no per-item overlay cost, and dynamic() fetches its chunk when the component renders rather than when it returns something - so the chunk would still load on every board render. It only pays off with the isEditMode guard hoisted to the call site, which is a board-rendering change worth measuring first rather than adopting on faith.
This commit is contained in:
2 files changed
+17
No files matched your search
@@ -26,6 +26,9 @@ export default function IFrameWidget({ options, isEditMode }: WidgetComponentPro
|
||||
style={isEditMode ? { userSelect: "none", pointerEvents: "none" } : undefined}
|
||||
className={classes.iframe}
|
||||
src={embedUrl}
|
||||
// An iframe is a whole browsing context, so one scrolled off a tall board is by far the most
|
||||
// expensive thing a widget can load eagerly.
|
||||
loading="lazy"
|
||||
title="widget iframe"
|
||||
allow={allowedPermissions}
|
||||
scrolling={allowScrolling ? "yes" : "no"}
|
||||
|
||||
Reference in new issue
Block a user