Skip to content

chore: quickjs-kmp 0.1.4(16 KB 页面对齐),CLI 的 qjsc-kmp 只要求同一上游 commit(0.10.1) - #34

Merged
HarlonWang merged 3 commits into
mainfrom
chore/quickjs-kmp-0.1.4-engine
Oct 13, 2026
Merged

HarlonWang merged 3 commits into
mainfrom
chore/quickjs-kmp-0.1.4-engine

Conversation

@HarlonWang

@HarlonWang HarlonWang commented Oct 13, 2026 •

Copy link
Copy Markdown
Member
  • catalog quickjsKmp 0.1.2 → 0.1.4:Android .so 改为 16 KB 页面对齐链接;0.1.3、0.1.4 未改上游源码与编译器(native/UPSTREAM 仍是 04be246)
  • 删掉 qjsc.test.ts 的「CLI 依赖的 qjsc-kmp 版本 == quickjsKmp」:字节码绑定的是上游 commit 而不是版本号,真正的校验早已由 runtime:check + RuntimeBytecodeTest 完成(CLI 编出的运行时文件头必须等于链接引擎的 QuickJs.upstreamCommit);qjsc-kmp 0.1.4 暂未上 npm,CLI 继续用 0.1.2
  • hostVersion 规则限定为上游 commit 变化:只改构建参数或绑定层的 quickjs-kmp 升级不算换引擎
  • 版本 0.10.1;docs/build-chain.md §5、docs/updates.md 同步

本地验证:用 quickjs-kmp 0.1.4 tag 编的宿主 JNI 跑 CI 同款 gradle 任务全部通过(含 RuntimeBytecodeTest);sample APK 三个 ABI 的 libquickjs_kmp.so LOAD 段对齐均为 16384。

🤖 Generated with Claude Code

Summary by Sourcery

Upgrade TinyUI to QuickJS KMP 0.1.4 and release version 0.10.1 while validating bytecode compatibility by upstream engine commit.

Enhancements:

  • Align the QuickJS engine upgrade and bytecode compatibility rules around matching upstream commits rather than package versions.
  • Clarify that hostVersion changes only when the engine upstream commit or host contract changes, not for compatible binding or build updates.

Build:

  • Upgrade quickjs-kmp to 0.1.4 for 16 KB Android shared-library page alignment.

CI:

  • Replace the CLI qjsc version-equality check with existing runtime bytecode and upstream-commit compatibility validation.

Documentation:

  • Update build-chain, update-policy, and CLI documentation to describe upstream-commit compatibility and the new QuickJS alignment behavior.

Chores:

  • Release the CLI, core, and native packages as version 0.10.1 while retaining qjsc-kmp 0.1.2 compatibility.

…10.1)

- catalog quickjsKmp 0.1.2 → 0.1.4:Android .so 改为 16 KB 页面对齐链接;0.1.3、0.1.4 未改上游源码与编译器(native/UPSTREAM 仍是 04be246)
- 删掉 qjsc.test.ts 的「CLI 依赖的 qjsc-kmp 版本 == quickjsKmp」:字节码绑定的是上游 commit 而不是版本号,真正的校验早已由 runtime:check + RuntimeBytecodeTest 完成(CLI 编出的运行时文件头必须等于链接引擎的 QuickJs.upstreamCommit);qjsc-kmp 0.1.4 暂未上 npm,CLI 继续用 0.1.2
- hostVersion 规则限定为上游 commit 变化:只改构建参数或绑定层的 quickjs-kmp 升级不算换引擎
- 版本 0.10.1;docs/build-chain.md §5、docs/updates.md 同步

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

本 PR 发布 tinyui 0.10.1,将 quickjs-kmp 升至 0.1.4 以支持 Android 16 KB 页面对齐,但保留使用同一上游 commit 的 qjsc-kmp 0.1.2;同时移除基于工具版本号的 CLI 校验,改由运行时字节码与链接引擎的上游 commit 校验兼容性,并更新 hostVersion 规则与相关包版本。

Sequence diagram for bytecode engine compatibility validation

sequenceDiagram
    participant CLI as qjsc-kmp CLI
    participant RuntimeCheck as runtime:check
    participant RuntimeTest as RuntimeBytecodeTest
    participant Engine as Linked QuickJs engine

    CLI->>RuntimeCheck: runtime:check
    RuntimeCheck-->>RuntimeTest: Consistent embedded runtime bytecode
    RuntimeTest->>Engine: QuickJs.upstreamCommit
    RuntimeTest->>RuntimeTest: Compare bytecode header with upstreamCommit
    alt upstream commits match
        RuntimeTest-->>CLI: Compatibility validated
    else upstream commits differ
        RuntimeTest-->>CLI: CI failure
    end
Loading

Flow diagram for quickjs-kmp and qjsc-kmp version compatibility

flowchart LR
    A[quickjs-kmp 0.1.4] --> B[Android .so 16 KB page alignment]
    A --> C[Upstream commit 04be246]
    D[qjsc-kmp 0.1.2] --> C
    C --> E[Bytecode accepted]
    F[Version number mismatch] -. not authoritative .-> E
Loading

Flow diagram for hostVersion engine-change rule

flowchart TD
    A[quickjs-kmp upgrade] --> B{Upstream commit changed?}
    B -->|Yes| C[Engine change]
    C --> D[Increment hostVersion]
    B -->|No| E[Build or binding-only change]
    E --> F[No hostVersion change]
    F --> G[Existing bytecode remains accepted]
Loading

File-Level Changes

Change Details Files
升级 quickjs-kmp 并将字节码兼容性判断从版本号改为上游 commit,同时保持 CLI 编译器版本暂不跟随升级。
  • 将 catalog 中的 quickjs-kmp 从 0.1.2 升至 0.1.4,以获取 Android .so 的 16 KB 页面对齐;上游源码与编译器 commit 保持不变。
  • 删除要求 qjsc-kmp 版本必须等于 quickjsKmp 的测试,改由 runtime:check 与 RuntimeBytecodeTest 校验字节码文件头和链接引擎的 upstream commit。
  • 同步构建链文档,明确只有上游 commit 变化才构成引擎变化;仅改变构建参数或绑定层不触发 hostVersion 更新。
gradle/libs.versions.toml
packages/cli/test/qjsc.test.ts
docs/build-chain.md
docs/updates.md
发布 0.10.1 版本并同步各 JavaScript 包的版本声明。
  • 将 CLI、core 和 native 包版本从 0.10.0 更新至 0.10.1。
  • 同步 core 的运行时 VERSION 常量与包元数据。
packages/cli/package.json
packages/core/package.json
packages/core/src/version.ts
packages/native/package.json
packages/native/src/index.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a7b3c04c-5f5c-487e-b5cb-cff817061ff0
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeseerbot codeseerbot Bot 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.

CodeSeer 审查

结论:批准

摘要

本次改动将 Kotlin 侧的 quickjsKmp 升级至 0.1.4,并将各 npm 包版本同步至 0.10.1。与此同时,文档将 CLI 与宿主引擎的兼容性判定从包版本号调整为 QuickJS 上游 commit,并移除了对应的版本号一致性测试。根据给出的改动,未发现可由代码直接证实的逻辑、安全或兼容性问题。

整个 PR 至 eb419d2 · gpt-5.6-terra

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="packages/core/src/version.ts" line_range="2" />
<code_context>
 /** The tinyui-core version; a package records it as the runtime it needs (docs/updates.md §1.1). */
-export const VERSION = "0.10.0";
+export const VERSION = "0.10.1";
</code_context>
<issue_to_address>
**Runtime bytecode stays stale**

When `VERSION` changes but `RuntimeBytecode.kt` is not regenerated, `runtime:check` recompiles the core entry, which exports `VERSION`, and compares the result with the unchanged `RuntimeBytecode.kt`; the bytecode differs, so the CI build fails.

Regenerate and commit `RuntimeBytecode.kt` with `pnpm runtime`.
</issue_to_address>

### Comment 2
<location path="packages/cli/package.json" line_range="3" />
<code_context>
 {
   "name": "tinyui-cli",
-  "version": "0.10.0",
+  "version": "0.10.1",
   "description": "TinyUI build tool: TSX -> h() (ES2025) -> ESM module bytecode.",
   "license": "MIT",
</code_context>
<issue_to_address>
**Existing hosts reject patch bundles**

When a 0.10.1 bundle targets an existing host snapshot whose tinyui floor is 0.10.0, `tinyuiVersion` stamps the bundle as 0.10.1, so `publish` rejects it against the frozen 0.10.0 floor and hosts cannot publish patch bundles under their existing `hostVersion`.

Keep patch-only releases compatible with existing 0.10.0 floors by adjusting version stamping or compatibility checks so those snapshots still accept the bundle.

Also at `packages/core/package.json:3`, `docs/updates.md:168`, `packages/core/src/version.ts:2`.
</issue_to_address>

### Comment 3
<location path="docs/build-chain.md" line_range="81" />
<code_context>
+字节码绑定引擎构建(文件头记上游 commit,quickjs-kmp `docs/native-build.md`"字节码与宿主工具"),CLI 用的 `qjsc-kmp` 必须与 App 链接的 quickjs-kmp 同一上游 commit。`tinyui-cli` 依赖的 `qjsc-kmp` 通常与 catalog 的 `quickjsKmp` 同版本,但校验的是上游 commit 而不是版本号:内置运行时由 CLI 的 `qjsc-kmp` 编出(`pnpm runtime:check` 保证入库的与现编一致),`RuntimeBytecodeTest` 核对它的文件头与链接引擎的 `QuickJs.upstreamCommit` 相等,两边 commit 不同 CI 即失败。所以上游 commit 不变的 quickjs-kmp 版本两边可以不同步:0.10.1 起 catalog 为 0.1.4,`qjsc-kmp` 仍是 0.1.2(0.1.3、0.1.4 只把 Android `.so` 改成 16 KB 页面对齐,编译器源码未动,npm 上也没有这两版)。JS 工程的 `tinyui-cli` 与 App 的 `tinyui` 之间,只要两边的上游 commit 相同,引擎就对得上;JS 工程的 `tinyui-cli` 须与目标宿主的 tinyui 下限兼容:同 major 且不高于它(updates.md §1.1、§1.3)。某个 tinyui 版本升级了 `quickjsKmp` 且上游 commit 随之改变(即 `manifest.engine` 变了)时,宿主升到它就是换引擎,按 updates.md §4.1 加 `hostVersion`,下限随之抬到这个版本;只改构建参数或绑定层、上游 commit 不变的升级(如 0.10.1 的 quickjs-kmp 0.1.4)不算换引擎,旧字节码照常被接受,不加。
</code_context>
<issue_to_address>
**README rejects supported compiler pairing**

When CLI users consult the README for compiler-version guidance, `packages/cli/README.md` says `qjsc-kmp` must match the exact `quickjs-kmp` version, so users treat the supported 0.1.2 compiler and 0.1.4 SDK pairing as incompatible and may seek an unavailable npm version.

Update the README to explain that the upstream commits must match, and document that `qjsc-kmp` 0.1.2 works with `quickjs-kmp` 0.1.4.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: packages/core/src/version.ts:2, packages/cli/package.json:3


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread packages/core/src/version.ts
Comment thread packages/cli/package.json
Comment thread docs/build-chain.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@codeseerbot codeseerbot Bot 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.

CodeSeer 审查

结论:批准

摘要

更新了生成的 RuntimeBytecode,其中 core 和 native 字节码内嵌版本从 0.10.0 同步到 0.10.1。字节码头中的 QuickJS upstream commit 保持不变,符合本次仅调整构建/绑定版本而非更换上游引擎的描述。

增量 eb419d2..6d8d7be · gpt-5.6-terra

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@codeseerbot codeseerbot Bot 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.

CodeSeer 审查

结论:批准

摘要

本次增量仅更新了 CLI README 中对 qjsc-kmp 与 App 所链接 quickjs-kmp 兼容关系的说明。文档将兼容性依据从包版本号调整为共同的上游 commit,并补充了不同包版本的示例。给出的改动范围内未发现可确认的问题。

增量 6d8d7be..4020d1c · gpt-5.6-terra

@HarlonWang
HarlonWang merged commit d7d4bf8 into main Oct 13, 2026
5 checks passed
@HarlonWang
HarlonWang deleted the chore/quickjs-kmp-0.1.4-engine branch October 13, 2026 14:19
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