Skip to content

Use sb3 in playground & Remove duplicated method & Fix typo in comment - #13

Closed
BenPaoDeXiaoZhi wants to merge 4 commits into
Gandi-IDE:developfrom
open-ccw:develop
Closed

Use sb3 in playground & Remove duplicated method & Fix typo in comment#13
BenPaoDeXiaoZhi wants to merge 4 commits into
Gandi-IDE:developfrom
open-ccw:develop

Conversation

@BenPaoDeXiaoZhi

Copy link
Copy Markdown
Contributor

改了一个注释中错误的拼写(whit)…

BenPaoDeXiaoZhi and others added 3 commits October 17, 2025 07:26
改了一个错误的拼写(whit)…
remove a duplicated "_convertLabelForScratchBlocks" method in "runtime.js"
use file to solve the ccw server-side encryption
@BenPaoDeXiaoZhi BenPaoDeXiaoZhi changed the title Fix typo in comment for startHatsWithParams Use sb3 in playground & Remove duplicated method & Fix typo in comment May 16, 2026
@sylarhcn

Copy link
Copy Markdown
Contributor

Review 结论:需要修改

基于当前 head 6bbabb7a6be4de84c0280f8dbb3ec1d05f687e92 审查,发现 5 个需要处理的问题:

[P1] 不要用空对象表示“尚未 attach storage”

src/engine/runtime.js:609

这里原本依赖 undefined/falsy 作为未挂载状态:convertToPackagedRuntime()this.storage 为 truthy 时会直接抛错,所以 new Runtime().convertToPackagedRuntime() 以及现有 test/unit/engine_runtime_tw.js 用例都会失败;resetRunId() 等路径也会把 {} 当成真实 storage 并解引用 scratchFetch。请保持为 undefined/null,直到 attachStorage() 写入真实实例。

[P1] 文件输入替换后会让分享报告页直接崩溃

src/playground/index.html:37

ProfilerRun.render() 仍在 benchmark.js:601 执行 document.querySelector('[type=text]').value = ...,但这个改动后页面里已经没有 type=text。打开运行结果生成的 #view/... 分享链接时,选择器返回 null,表格渲染前就会抛异常。需要同步修改 render 路径,或保留兼容的文本节点。

[P2] 文件模式下不要在未选文件时预先调用 run()

src/playground/benchmark.js:690

loadProject() 在没有 files[0] 时永远不 resolve,但 ProfilerRun.run() 仍会注册持久的 workspaceUpdate 监听器。页面初始化时这次调用先留下一个监听器;用户选文件再点 Run 时又注册一次,随后一次 workspaceUpdate 会把 warm-up/record/complete 全部调度两遍,继续运行还会持续累积。请移除文件模式下的自动 run,并对每次加载使用一次性监听/显式清理。

[P2] 当前 Run 不再应用 Compiler 复选框的值

src/playground/benchmark.js:72

enableCompiler 只在页面加载时从 query string 读取,并只在创建 VM 时调用一次 setCompilerOptions;这里把原来的 reload/query 更新注释掉后,用户切换 Enable compiler 再点击 Run 不会改变任何运行配置。请在运行前用 compilerInput.checked 更新 VM,或恢复能保留所选 sb3 的重载方案。

[P2] CI 脚本删除错了对象层级

.github/workflows/node.js.yml:37

package.jsonscratch-parser 位于 dependencies,根对象没有这个 key,所以 delete this['scratch-parser'] 是 no-op;随后 npm install 仍会先安装声明的 GitHub 依赖,再被 npm link 覆盖。请与 deploy workflow 保持一致,改为 delete this.dependencies['scratch-parser'],并确认两条 workflow 对 scratch-storage 的处理也一致。

验证状态

  • 当前 CI run #23npm run lint 阶段失败(324 errors),后续 build/test 均被跳过,因此这个 head 目前没有通过自动构建或测试。
  • 重复 _convertLabelForScratchBlocks 的删除与注释拼写修正确认没有问题。

@sylarhcn sylarhcn closed this Jul 13, 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.

2 participants