Skip to content

test: optional title migration contract / 可选参数迁移验收 - #103

Merged
tiye merged 1 commit into
mainfrom
test/optional-title-contract
Sep 26, 2026
Merged

tiye merged 1 commit into
mainfrom
test/optional-title-contract

Conversation

@tiye

@tiye tiye commented Sep 26, 2026

Copy link
Copy Markdown
Member

中文

补齐 calcit-lang/calcit#1286 的真实旧可选参数迁移验收。生产迁移已经在 #101 合并,本 PR 不修改生产函数或依赖。

  • 在 comp-title :tests 中增加 5 个 Calcit 测试:尾部省略、显式 None、回调/子组件单次求值、每次点击一次回调,以及旧 nil/false 空回调行为。
  • JS 宿主直接执行这些测试的 AST,不复制业务断言;另验证裸 nil、false 和 Some(false) 被类型检查拒绝。
  • CI 执行 JS 测试;native server 测试排除 JS-only 标签,原有 90 个测试完整保留。
  • 中文迁移文档记录旧源码、当前查询命令、两个生产调用、空值映射和拒绝自动改写的边界。宏/未知消费者未被证明,故不扩大 fix 自动应用范围。

验证:Calcit / @calcit/procs 0.22.1、Node 24;5 个 JS Calcit 测试和 3 个非法参数检查通过;client 14、server 90 测试通过;compile-page、release-page、dayjs adapter、session messages、typed database 检查通过;格式化无变化、git diff --check 通过。Vite 仍提示 bundle 大小警告。

English

Complete the bounded legacy optional-parameter acceptance example for calcit-lang/calcit#1286. Production migration already landed in #101; this PR changes neither production functions nor dependencies.

  • Add five definition-attached Calcit tests covering trailing omission, explicit None, single evaluation of callback/child arguments, one callback per click, and legacy nil/false empty-handler behavior.
  • Execute the original test AST on the JS host without duplicating semantic assertions. Reject bare nil, false and Some(false) via compiler checks.
  • Run the JS tests in CI and exclude their JS-only tag from native execution, preserving all 90 existing native tests.
  • Document the original source, current query commands, both production callers, value mapping and refusal boundaries in Chinese. Unproved macro/external consumers do not justify broader automatic fixes.

Validation with Calcit / @calcit/procs 0.22.1 and Node 24: 5 JS Calcit tests, 3 invalid-argument checks, 14 client and 90 server tests pass; browser compile/build and dayjs/session-message/typed-database regressions pass. Canonical format unchanged and diff check clean. Existing bundle-size warning remains.

@tiye

tiye commented Sep 26, 2026

Copy link
Copy Markdown
Member Author

中文

已自行 review 当前 HEAD beaa83d:生产定义/依赖没有变动,JS 宿主直接运行 Calcit :tests,临时 snapshot 使用独立模块链接且 finally 清理;非法参数检查同时要求退出码和类型诊断。原有 90 个 native 测试保留,新增 5 个测试由独立 JS CI 覆盖。精确 HEAD CI 已成功,当前没有未处理评论。

English

Self-reviewed HEAD beaa83d: no production definition/dependency changes; JS executes Calcit definition tests from an isolated temporary Snapshot with finally cleanup. Negative checks require both failure status and a type diagnostic. All 90 existing native tests remain covered, and five new tests run in the JS CI step. Exact-head CI passed; no outstanding comments.

@tiye
tiye merged commit 4929231 into main Sep 26, 2026
1 check passed
@tiye
tiye deleted the test/optional-title-contract branch September 26, 2026 09:35
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.

1 participant