Apache Fory 团队很高兴宣布 1.0.0 版本正式发布。这是一个里程碑版本,包含来自 11 位贡献者的 84 个 PR,并让跨语言运行时成为各支持语言的默认路径。请访问 Install 页面 获取各平台安装方式。
发布亮点
Apache Fory 1.0.0 标准化了跨语言序列化模型。统一的 xlang 类型系统现在成为各语言默认模式,并带来兼容模式读取、简化的字段排序,以及更好的 list/array 兼容性。本版本还为 xlang 序列化增加了 decimal 和 bfloat16 支持。
各语言运行时继续围绕统一的 Schema 和元信息模型收敛。Rust、C++、C#、Go、Dart、Python 和 Swift 都加入了嵌套容器和字段 codec 支持。Kotlin 增加 xlang、KSP 和 Schema IDL 支持,Scala 增加 Schema IDL 支持并更新了生成注解。
本版本也扩展了部署覆盖面并继续提升性能。Java 增加 Android 序列化支持、annotation processor 支持、Schema typed row 字段访问器,以及嵌套 type-use 序列化元信息。Dart typed-container fast path 和生成 struct 优化提升了吞吐,同时更新了基准图表。
关键特性:
- 统一 xlang 类型系统,并让 xlang 成为默认模式: https://github.com/apache/fory/pull/3644, https://github.com/apache/fory/pull/3685
- 为 xlang 序列化增加 decimal 和 bfloat16 支持: https://github.com/apache/fory/pull/3599, https://github.com/apache/fory/pull/3605
- 增加嵌套容器和字段 codec 支持: https://github.com/apache/fory/pull/3625, https://github.com/apache/fory/pull/3630, https://github.com/apache/fory/pull/3636, https://github.com/apache/fory/pull/3639, https://github.com/apache/fory/pull/3640, https://github.com/apache/fory/pull/3641, https://github.com/apache/fory/pull/3643
- 增加 Kotlin xlang、KSP 和 Schema IDL 支持: https://github.com/apache/fory/pull/3679, https://github.com/apache/fory/pull/3684
- 增加 Scala Schema IDL 支持并更新生成注解: https://github.com/apache/fory/pull/3681, https://github.com/apache/fory/pull/3682
- 增加 Android 序列化和 Java annotation processor 支持: https://github.com/apache/fory/pull/3667, https://github.com/apache/fory/pull/3670
- 改进 xlang 兼容模式: https://github.com/apache/fory/pull/3648, https://github.com/apache/fory/pull/3650, https://github.com/apache/fory/pull/3675
- 提升序列化性能: https://github.com/apache/fory/pull/3609, https://github.com/apache/fory/pull/3653, https://github.com/apache/fory/pull/3656, https://github.com/apache/fory/pull/3661
- 增加 Java row 访问器和嵌套 type-use 元信息: https://github.com/apache/fory/pull/3631, https://github.com/apache/fory/pull/3633
功能特性
- feat(ci): 修复 csharp 和 dart release,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3582
- feat(rust): 增加可配置的大小护栏,作者 @ayush00git,见 https://github.com/apache/fory/pull/3579
- refactor(rust): 将 Fory 配置移动到 builder,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3593
- feat(xlang): 为 xlang 增加 decimal 并对齐 serializer,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3599
- refactor(dart): 对齐 dart 内部实现,作者 @Geethapranay1,见 https://github.com/apache/fory/pull/3601
- feat(xlang): 增加 bfloat16 支持,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3605
- feat(dart): 支持 dart web 平台,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3608
- perf(dart): typed-container 写入 fast path 并消除 scan,作者 @yash-agarwa-l,见 https://github.com/apache/fory/pull/3609
- feat(swift): 为 swift 增加嵌套容器 override 支持,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3625
- feat(java): 增加 schema typed row 字段访问器,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3631
- feat: 为 rust 增加嵌套容器 codec,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3630
- feat(java): 支持嵌套 type-use 序列化元信息,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3633
- refactor(cpp): 移除 abseil 依赖,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3634
- feat(cpp): 增加嵌套字段 codec 支持,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3636
- feat(csharp): 支持嵌套容器字段 codec,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3639
- feat(go): 支持嵌套字段 annotation type spec,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3640
- feat(dart): 为 dart 支持嵌套容器字段 codec,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3641
- feat(python): 支持嵌套字段 schema encoding,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3643
- feat(xlang): 统一 xlang 类型系统,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3644
- feat(xlang): 增加全面的读取校验,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3647
- feat(xlang): 默认对 xlang 使用兼容模式,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3648
- feat(xlang): 支持 list 与 array 字段之间的兼容读取,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3650
- perf(dart): 移除 generated struct slot bridge,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3653
- perf: 优化序列化性能,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3656
- perf: 更新 benchmark 图表,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3661
- refactor(rust): 在生成的 Rust 代码中使用绝对路径,作者 @BaldDemian,见 https://github.com/apache/fory/pull/3666
- feat: 增加 android 支持,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3667
- feat(compiler): 增加用于生成统一 gRPC service/method 名称的 helper,作者 @BaldDemian,见 https://github.com/apache/fory/pull/3672
- feat(java): 为 android serialization 增加 annotation processor,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3670
- feat(xlang): 简化 xlang 字段排序,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3675
- feat(kotlin): 增加 kotlin xlang 和 ksp 支持,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3679
- refactor(java): 替换 static serializer SPI lookup,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3680
- feat(scala): 增加 scala schema IDL 支持,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3681
- feat(scala): 更新生成注解,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3682
- feat(rust): 将 rust chrono 设为可选依赖,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3683
- feat(kotlin): 为 kotlin 增加 schema IDL 支持,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3684
- feat(xlang): 让所有语言默认使用 xlang,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3685
Bug 修复
- fix(dart): 解决 fory pub.dev score 问题,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3585
- fix(dart): 修复 dart CI,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3586
- fix(dart): 使用 getUint32 正确编码 u64 值,作者 @ayush00git,见 https://github.com/apache/fory/pull/3592
- fix(c++): 修复 c++ duration 序列化,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3598
- fix(javascript): 将 TypeMeta preamble 常量与 python/java/rust/go xlang binding 对齐,作者 @emrul,见 https://github.com/apache/fory/pull/3603
- fix(javascript): 修复 javascript schema IDL 测试,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3604
- fix(dart): 增加
>>>以实现 uint 中正确的逻辑右移语义,作者 @ayush00git,见 https://github.com/apache/fory/pull/3607 - fix(go): 确保 unsafe varint fast path 有物理 buffer 空间,作者 @ayush00git,见 https://github.com/apache/fory/pull/3613
- fix(go): 为 refResolver 和 metaStringResolver 读取增加边界检查,作者 @ayush00git,见 https://github.com/apache/fory/pull/3615
- fix(go): 为 slice 和 string 增加预分配边界检查,作者 @ayush00git,见 https://github.com/apache/fory/pull/3618
- fix(go): 为 decimal 反序列化增加 maxBinarySize 限制,作者 @ayush00git,见 https://github.com/apache/fory/pull/3623
- fix(go): 增加可配置的 fieldCount 和 fieldDepth 护栏,作者 @ayush00git,见 https://github.com/apache/fory/pull/3620
- fix(java): 在 generated decode 中遵循 record field encoding,作者 @mandrean,见 https://github.com/apache/fory/pull/3626
- fix(java): 在兼容模式下保留 externalizable container,作者 @mandrean,见 https://github.com/apache/fory/pull/3628
- fix(python): 在读取时执行更多校验,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3632
- fix(xlang): 修复 xlang 类型系统,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3646
- fix(java): 对未注册的 writeReplace class 使用 REPLACE_STUB_ID,避免跨 JVM ClassNotFoundException,作者 @wakilurislam,见 https://github.com/apache/fory/pull/3638
- fix(java): 修复 set view 引用跟踪,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3649
- fix(java): 为兼容读取恢复 map declared serializer,作者 @mandrean,见 https://github.com/apache/fory/pull/3654
- fix: 将 TypeMeta header bits 纳入 hash,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3659
- fix(java): 序列化 suppressed exception,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3663
- fix(javascript): 在重新生成的 read serializer 中保留 getTypeInfo,作者 @xhzq233,见 https://github.com/apache/fory/pull/3669
- fix(java): 校验 subclass serializer layer 数量,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3676
- fix(java): 避免实例化 abstract meta-share type,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3677
- fix: 修复 release script,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3687
其他改进
- chore: 跳过以 go 开头 tag 的自动发布,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3584
- docs: 增加 NuGet badge,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3587
- docs(java): 更新 graalvm guide 位置,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3588
- docs: 将 graalvm_support.md 重命名为 graalvm-support.md,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3589
- chore(rust): 优化 varint read/write 方法名,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3590
- docs: 将 development guide 移动到 docs root,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3591
- chore(dart): 增加缺失的 license header,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3594
- chore(csharp): 增加更多 csharp 和 swift 测试,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3597
- chore(dart): 优化 dart xlang serialization,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3596
- docs: 增加更多 agent harness 规则,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3610
- chore(dart): 移除过期 dart note 文件,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3642
- chore(java): 配置默认 Fory log level,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3657
- chore: 清理代码并增加 compiler warning 检查,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3660
- docs: 收紧 benchmark throughput 图表,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3662
- docs: 更新 README,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3664
- docs: 增加 README schema IDL 示例,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3665
- docs: 更新 xlang/native serialization 文档,作者 @chaokunyang,见 https://github.com/apache/fory/pull/3686
新贡献者
- @emrul 在 https://github.com/apache/fory/pull/3603 中完成了首次贡献
- @wakilurislam 在 https://github.com/apache/fory/pull/3638 中完成了首次贡献
- @xhzq233 在 https://github.com/apache/fory/pull/3669 中完成了首次贡献
完整变更日志: https://github.com/apache/fory/compare/v0.17.0...v1.0.0
