mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user