Skip to content

fix(vue-vapor): skip onFrame scheduling - #141

Merged
doodlewind merged 1 commit into
pocket-stack:mainfrom
zhiyuanzmj:fix/on-frame
Jul 22, 2026
Merged

fix(vue-vapor): skip onFrame scheduling#141
doodlewind merged 1 commit into
pocket-stack:mainfrom
zhiyuanzmj:fix/on-frame

Conversation

@zhiyuanzmj

Copy link
Copy Markdown
Contributor

Remove dynamic-prop detection and the onFrame call so primitive nodes no longer register per-frame callbacks, preventing unnecessary frame updates.

Remove dynamic-prop detection and the onFrame call so primitive nodes
no longer register per-frame callbacks, preventing unnecessary frame
updates.
Copilot AI review requested due to automatic review settings July 21, 2026 17:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Vue Vapor component layer to stop scheduling per-frame onFrame() re-application for primitive nodes, relying on watchEffect() only to avoid unnecessary frame updates.

Changes:

  • Removed dynamic-prop detection for primitive nodes (createPrimitiveNode).
  • Removed onFrame(apply) scheduling so primitive nodes no longer register per-frame callbacks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 235 to 246
const apply = () => {
const extra = typeof opts.extra === "function" ? opts.extra() : (opts.extra ?? {});
const next = { ...cleanProps(rawProps, omit), ...cleanExtraProps(extra) };
for (const key of Object.keys(next)) setProp(node, key, next[key], prev[key]);
for (const key of Object.keys(prev)) {
if (!(key in next)) setProp(node, key, undefined, prev[key]);
}
prev = next;
assignRef(rawProps.nodeRef ?? rawProps.ref, node);
};
const hasFrameDynamicProps =
typeof opts.extra === "function" ||
Object.keys(rawProps).some((key) => !omit.has(key) && typeof rawProps[key] === "function");
watchEffect(apply);
if (hasFrameDynamicProps) onFrame(apply);
return node;
@doodlewind
doodlewind merged commit 4bc4d3a into pocket-stack:main Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants