fix(lynx): prefer native animation frames - #2101
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 这个分支是...
🔗 相关 issue 连接
N/A
🐞 Bugserver 用例 id
N/A
💡 问题的背景&解决方案
Lynx 环境此前直接复用了基于
setTimeout的rafBasedSto。这段逻辑来自通用小程序环境的历史兼容实现,没有使用 Lynx runtime 已提供的原生requestAnimationFrame/cancelAnimationFrame,导致动画调度无法跟随宿主帧节奏。本 PR 在
LynxEnvContribution.configure()的低频配置阶段选择并缓存调度器:this;rafBasedSto,保持兼容;新增单测覆盖原生 scheduler、runtime receiver、handle 透传、原子 fallback 与 native → fallback 的重复配置场景。
📝 Changelog
☑️ 自测
验证:
rush build -t @visactor/vrenderpackages/vrender-kits: 30 suites / 98 tests passedpackages/vrender-kits:rushx compilepackages/vrender: entry/shared-app 2 suites / 15 tests passedpackages/vrender:rushx compilerush test --only tag:packagepassed for all 7 published packages未执行:Lynx 真机/宿主 smoke(当前环境没有 Lynx 宿主)。
🚀 Summary
copilot:summary
🔍 Walkthrough
copilot:walkthrough