中文
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.isArrayFFI,改用 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;新增真实
pointermove与wheel场景,各精确
触发 1 次,非预期 React warnings/errors、page errors 和 unhandled
rejections 为 0。 - Pointer 精确载荷:pointerId
17、button1、buttons3、pressure0.5、
clientX24.5、clientY48.5。 - Wheel 精确载荷:deltaX
1.5、deltaY-2.5、deltaMode1。 - 公共 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
NativeEventview.DOMEvent::native_pointer_eventand
DOMEvent::native_wheel_eventvalidate the complete consumed payload shape
before returning dom-ffiPointerEvent/WheelEvent; mismatched or partial
event families returnNone. - React
DOMEventremains a SyntheticEvent.prevent_defaultand
stop_propagationcontinue to use the React event object, so the native
payload adapter does not change propagation semantics. - Adds a zero-copy
ReactFormData::to_dom_form_databridge for dom-ffi's
text/file-awareFormDatavalues.get_stringno longer duplicates a direct
JavaScriptFormData.getaccessor. - Removes the local
Array.isArrayFFI in favor of dom-ffi's tested
JsObscure::is_arraypredicate. - Removes the stale dom-ffi hardcode from downstream release verification. The
verifier derives the exact version frommoon.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
pointermoveandwheelscenarios,
each invoked exactly once, with zero unexpected React warnings/errors, page
errors, or unhandled rejections. - Exact Pointer payload: pointerId
17, button1, buttons3, pressure
0.5, clientX24.5, and clientY48.5. - Exact Wheel payload: deltaX
1.5, deltaY-2.5, and deltaMode1. - 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.0andtiye/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.