Skip to content

v0.4.0

Latest

Choose a tag to compare

@tiye tiye released this 04 Sep 01:22
f2cd556

中文

v0.4.0 将 React MoonBit 绑定与已发布的 tiye/dom-ffi@0.4.0 对齐,重点改善
事件载荷和表单数据的类型安全,同时保留 React SyntheticEvent 自身的语义。

主要变化

  • 新增公开且不透明的 NativeEvent 视图。DOMEvent::native_pointer_event
    DOMEvent::native_wheel_event 会验证实际使用的完整字段结构,再返回 dom-ffi
    PointerEvent / WheelEvent;事件族不匹配或载荷不完整时返回 None
  • React DOMEvent 仍然是 SyntheticEvent;prevent_default
    stop_propagation 继续走 React 事件对象,不会因原生载荷适配而改变传播行为。
  • 新增 ReactFormData::to_dom_form_data 零复制桥接,允许直接使用 dom-ffi
    FormData 的文本/文件联合值;get_string 不再重复手写 JavaScript
    FormData.get
  • 移除本地 Array.isArray FFI,改用 dom-ffi 已验证的
    JsObscure::is_array
  • 下游发布验证不再硬编码旧版 dom-ffi;它从 moon.mod 解析精确版本,以严格
    Semantic Versioning 2.0.0 规则校验,并按完整 package/version token 验证
    dependency tree 同时包含目标 React 与 dom-ffi 版本。

可验证指标

  • MoonBit tests:59/59。
  • Chromium conformance:12/12;新增真实 pointermovewheel 场景,各精确
    触发 1 次,非预期 React warnings/errors、page errors 和 unhandled
    rejections 为 0。
  • Pointer 精确载荷:pointerId 17、button 1、buttons 3、pressure 0.5
    clientX 24.5、clientY 48.5
  • Wheel 精确载荷:deltaX 1.5、deltaY -2.5、deltaMode 1
  • 公共 API 文档:235/235(100%),缺失 0。
  • 发布验证单测:3/3;覆盖 7 个合法与 9 个非法 SemVer 样例,并验证 RC 后缀不能
    冒充精确稳定版本。
  • Node Web Streams SSR、生成代码一致性、生产构建和严格 18 文件发布包门禁通过后
    才允许发布。
  • 发布后独立模块必须精确解析 tiye/react@0.4.0
    tiye/dom-ffi@0.4.0,并通过 check/build、Node SSR、Chromium
    render/hydration 和零 diagnostics 验证。

完整变更见 CHANGELOG.md。本项目仍处于实验阶段,不建议用于生产环境。


English

v0.4.0 aligns the React MoonBit bindings with the released
tiye/dom-ffi@0.4.0, focusing on type-safe event payloads and form data while
preserving React SyntheticEvent semantics.

Highlights

  • Adds a public opaque NativeEvent view. DOMEvent::native_pointer_event and
    DOMEvent::native_wheel_event validate the complete consumed payload shape
    before returning dom-ffi PointerEvent / WheelEvent; mismatched or partial
    event families return None.
  • React DOMEvent remains a SyntheticEvent. prevent_default and
    stop_propagation continue to use the React event object, so the native
    payload adapter does not change propagation semantics.
  • Adds a zero-copy ReactFormData::to_dom_form_data bridge for dom-ffi's
    text/file-aware FormData values. get_string no longer duplicates a direct
    JavaScript FormData.get accessor.
  • Removes the local Array.isArray FFI in favor of dom-ffi's tested
    JsObscure::is_array predicate.
  • Removes the stale dom-ffi hardcode from downstream release verification. The
    verifier derives the exact version from moon.mod, validates it with strict
    Semantic Versioning 2.0.0 rules, and matches complete package/version tokens
    for both target React and dom-ffi versions in the dependency tree.

Verifiable metrics

  • MoonBit tests: 59/59.
  • Chromium conformance: 12/12; adds real pointermove and wheel scenarios,
    each invoked exactly once, with zero unexpected React warnings/errors, page
    errors, or unhandled rejections.
  • Exact Pointer payload: pointerId 17, button 1, buttons 3, pressure
    0.5, clientX 24.5, and clientY 48.5.
  • Exact Wheel payload: deltaX 1.5, deltaY -2.5, and deltaMode 1.
  • Public API documentation: 235/235 (100%), with zero missing comments.
  • Release-verification unit tests: 3/3, covering 7 valid and 9 invalid SemVer
    samples plus rejection of an RC suffix masquerading as an exact stable
    version.
  • Node Web Streams SSR, generated-source consistency, production build, and
    the strict 18-file release package gate must pass before publication.
  • After publication, a fresh downstream module must resolve exact
    tiye/react@0.4.0 and tiye/dom-ffi@0.4.0, then pass check/build, Node SSR,
    Chromium render/hydration, and zero-diagnostics verification.

See CHANGELOG.md for the complete change list. This project remains
experimental and is not recommended for production use.