fix(core): remove late-bind polling from runtime — engine handles it

The setInterval-based late-bind polling in init.ts caused visual
regressions across all style-prod tests. Even with the sawMissing
guard, the mere presence of the interval registration altered
event loop timing enough to shift rendered frames.

The engine's pollSubCompositionTimelines + conditional
__hfForceTimelineRebind already handles async timeline detection
for renders. The runtime only needs to expose the rebind hook —
it shouldn't poll on its own.

For studio preview of async compositions, the engine's rebind
call (via __hfForceTimelineRebind) is the correct mechanism.
This commit is contained in:
Miguel Ángel
2026-05-18 05:50:08 -04:00
parent d10b2f4ded
commit 0ff6296d64
-29
View File
@@ -1469,35 +1469,6 @@ export function initSandboxRuntimeModular(): void {
applyCaptionOverrides();
postTimeline();
postState(true);
let lateBindChecks = 0;
let sawMissing = false;
const lateBindInterval = setInterval(() => {
if (++lateBindChecks > 50) {
clearInterval(lateBindInterval);
return;
}
const hosts = document.querySelectorAll("[data-composition-id]");
let allBound = true;
for (let i = 0; i < hosts.length; i++) {
const id = hosts[i].getAttribute("data-composition-id");
if (id && !timelines[id]) {
allBound = false;
sawMissing = true;
break;
}
}
if (allBound && !sawMissing) {
clearInterval(lateBindInterval);
return;
}
if (!allBound) return;
childrenBound = false;
bindRootTimelineIfAvailable();
postTimeline();
postState(true);
clearInterval(lateBindInterval);
}, 100);
});
} else {
// No external/inline compositions to load — apply caption overrides immediately