This is an automated email from the ASF dual-hosted git repository. chaokunyang pushed a commit to branch release_1.5.0 in repository https://gitbox.apache.org/repos/asf/fory-site.git
commit 7e71f51be320f1b2fee966d8d78f34eeb54b7ebd Author: chaokunyang <[email protected]> AuthorDate: Fri Jul 31 14:33:16 2026 +0800 docs: prepare Fory 1.5.0 release --- AGENTS.md | 4 + blog/2026-07-31-fory_1_5_0_released.md | 215 +++++++++++++++++++++ docs/guide/swift/index.md | 2 +- docs/start/install.md | 30 +-- src/components/home/HomepageLanding.tsx | 18 +- src/pages/download/index.md | 12 +- .../blog/fory_1_5_0_release/string_throughput.png | Bin 0 -> 51989 bytes .../fory_1_5_0_release/utf8_bytes_throughput.png | Bin 0 -> 53649 bytes 8 files changed, 250 insertions(+), 31 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 7cd142405d..3f46e52aa4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -116,6 +116,10 @@ This means Chinese docs may be a mix of translated content and English fallback - `CONTRIBUTING.md` states that `docs/guide` and `docs/specification` are mainly synced from `apache/fory`. For those sections, confirm whether changes should go to the main `apache/fory` repo instead. +- Do not run benchmarks during `fory-site` release, documentation, or blog work. + Use existing benchmark reports, data, and figures checked into the relevant + documentation as the source of truth. Run or regenerate a benchmark only + when the user explicitly asks for a benchmark run. - `scripts/unified-docs/script.py` uses `i18n/eu-US/...` paths (not `en-US`); treat this as existing behavior and validate intent before changing. - Since link-check is not effectively active, external link regressions may pass PR checks. - The repo has substantial versioned/mirrored docs; avoid accidental bulk edits in `versioned_docs` and `i18n/version-*`. diff --git a/blog/2026-07-31-fory_1_5_0_released.md b/blog/2026-07-31-fory_1_5_0_released.md new file mode 100644 index 0000000000..130f0610e8 --- /dev/null +++ b/blog/2026-07-31-fory_1_5_0_released.md @@ -0,0 +1,215 @@ +--- +slug: fory_1_5_0_release +title: Fory v1.5.0 Released +authors: [chaokunyang] +tags: [fory, java, rust, csharp, swift, dart] +--- + +The Apache Fory team is pleased to announce the 1.5.0 release. This release includes [25 PRs](https://github.com/apache/fory/compare/v1.4.0...v1.5.0) from 2 distinct contributors. See the [Install](https://fory.apache.org/docs/start/install) page to get the libraries for your platform. + +## Highlights + +* Fory JSON reached up to 5.6× Jackson throughput and 10× Gson throughput in the published Java JSON benchmark. +* External-type serialization now covers Rust, Dart, Swift, and C#, allowing generated serializers for third-party structural types while preserving normal xlang wire identities and encodings. +* C# and Dart now generate flattened schemas for inherited classes, with Dart also supporting intentional omission of inherited private fields. + +## Faster Fory JSON + +Introduced in 1.4.0, Fory JSON receives a substantial performance upgrade in 1.5.0. The generated readers and writers, UTF-8 collection paths, codec resolution, and reusable execution-state paths were optimized for both serialization and deserialization. + +The published benchmark compares Fory JSON, Jackson, and Gson with the same `MediaContent` workload. The String cases exclude UTF-8 conversion. The UTF-8 byte cases use direct byte-array APIs where available; Gson includes String-to-UTF-8 encoding and UTF-8-to-String decoding. + +<img src="/img/blog/fory_1_5_0_release/string_throughput.png" width="90%"/> + +<img src="/img/blog/fory_1_5_0_release/utf8_bytes_throughput.png" width="90%"/> + +| Representation | Operation | fory-json ops/sec | Jackson ops/sec | Gson ops/sec | vs. Jackson | vs. Gson | +| -------------- | ----------- | ----------------: | --------------: | -----------: | ----------: | -------: | +| String | Serialize | 7,387,465 | 2,049,368 | 1,084,042 | 3.60× | 6.81× | +| String | Deserialize | 2,897,955 | 1,074,885 | 902,772 | 2.70× | 3.21× | +| UTF-8 bytes | Serialize | 10,375,498 | 1,868,614 | 1,037,211 | 5.55× | 10.00× | +| UTF-8 bytes | Deserialize | 3,077,158 | 1,268,397 | 933,079 | 2.43× | 3.30× | + +These results were recorded on an Apple M4 Pro running macOS 15.7.2 and JDK 26.0.1, using JMH 1.37 with one fork and one thread. Each case used three 2-second warmup iterations followed by five 2-second measurement iterations. Throughput is reported in operations per second, so higher is better. Results are specific to this workload and environment; see the [complete Java JSON benchmark report](/docs/benchmarks/java/json/) for the source commit, command, and methodology. + +Add the 1.5.0 artifact and reuse one thread-safe `ForyJson` instance: + +```xml +<dependency> + <groupId>org.apache.fory</groupId> + <artifactId>fory-json</artifactId> + <version>1.5.0</version> +</dependency> +``` + +```java +import org.apache.fory.json.ForyJson; + +ForyJson json = ForyJson.builder().build(); +byte[] bytes = json.toJsonBytes(user); +User decoded = json.fromJson(bytes, User.class); +``` + +See the [Fory JSON documentation](/docs/guide/java/json_support) for supported Java types, object mapping, annotations, mix-ins, custom codecs, and platform setup. + +## External-Type Serialization Across Four Runtimes + +Fory 1.5.0 adds external-type serialization to Rust, Dart, Swift, and C#. Applications can define a local serializer or schema declaration for a third-party structural type that cannot be modified to carry Fory annotations. Fory then reads and writes the target value directly—without requiring a wrapper or intermediate mirror object. + +The generated declaration preserves the runtime's normal registration and wire model. In xlang mode, external structs, enums, and unions use the same applicable identities and encodings as directly supported types. Private, opaque, or invariant-bearing targets can still use a custom serializer when structural generation is not appropriate. + +In Rust, the local derive names the target type and is selected explicitly for root values: + +```rust +use fory::{Fory, ForyStruct}; + +#[derive(ForyStruct)] +#[fory(target = third_party::User)] +struct UserSerializer { + name: String, + age: u32, +} + +let mut fory = Fory::builder().xlang(true).build(); +fory.register::<UserSerializer>(100)?; +let bytes = fory.serialize_with::<UserSerializer>(&user)?; +let decoded = + fory.deserialize_with::<UserSerializer>(&bytes)?; +``` + +Dart generates a serializer from a local `target` declaration, then registers the third-party target through the generated module: + +```dart +@ForyStruct(target: third_party.User) +abstract final class UserSerializer { + @ForyField(id: 1) + late final String name; + + @ForyField(id: 2, type: Int32Type()) + late final int age; +} + +ExternalSerializersForyModule.register( + fory, + third_party.User, + id: 100, +); +``` + +Swift registers and selects the external serializer while the application continues to pass `ThirdParty.User` values: + +```swift +@ForyStruct(target: ThirdParty.User.self) +struct UserSerializer { + var name: String + var age: UInt32 +} + +try fory.register(UserSerializer.self, id: 100) +let bytes = try fory.serialize(user, with: UserSerializer.self) +let decoded = try fory.deserialize(bytes, with: UserSerializer.self) +``` + +C# source generation uses a local abstract declaration and registers the target type through the normal API: + +```csharp +using Apache.Fory; +using S = Apache.Fory.Schema.Types; + +[ForyStruct(Target = typeof(ThirdParty.User))] +internal abstract class UserSerializer +{ + [ForyField(1)] + public abstract string Name { get; } + + [ForyField(2, Type = typeof(S.Int32))] + public abstract int Age { get; } +} + +fory.Register<ThirdParty.User>(100); +byte[] bytes = fory.Serialize(user); +``` + +For construction requirements, nested containers, dynamic values, and advanced mappings, see the dedicated guides for [Rust](/docs/guide/rust/external_types), [Dart](/docs/guide/dart/external_types), [Swift](/docs/guide/swift/external_types), and [C#](/docs/guide/csharp/external_types). + +## Generated Class Inheritance for C# and Dart + +Fory 1.5.0 extends generated serializers across class hierarchies in C# and Dart. In both runtimes, inherited and child storage is represented as one flattened schema rather than a nested base object, so ordinary field ordering, schema evolution, reference tracking, and graph-memory checks continue to apply to the concrete type. + +In C#, annotate every participating class directly because `[ForyStruct]` is not inherited. Abstract annotated bases provide schema fields for their concrete descendants, while only the concrete derived type is registered: + +```csharp +[ForyStruct] +public abstract class Entity +{ + [ForyField(1)] + private long _id; + + public long Id => _id; +} + +[ForyStruct] +public sealed class User : Entity +{ + [ForyField(2)] + public string Name { get; set; } = string.Empty; +} + +fory.Register<User>(102); +``` + +Dart generation discovers superclass and applied-mixin storage. Public inherited fields need no annotation on the parent, and a concrete child can intentionally omit inherited private fields: + +```dart +class MessageBase { + int sequence = 0; + String _cache = ''; +} + +@ForyStruct(ignoreInheritedPrivateFields: true) +class TextMessage extends MessageBase { + TextMessage(); + + String text = ''; +} +``` + +The generated `TextMessage` schema contains `sequence` and `text`, but not the inherited private `_cache`. The option does not omit inherited public fields or private fields declared by the child itself. + +See [C# class inheritance](/docs/guide/csharp/basic_serialization#class-inheritance) and [Dart inheritance](/docs/guide/dart/inheritance) for constructor rules, private-field access across packages, mixins, generics, references, and schema compatibility. + +## Features + +* feat(java): add configurable JSON benchmark reports by @chaokunyang in https://github.com/apache/fory/pull/3870 +* feat(java): optimize json perf by @chaokunyang in https://github.com/apache/fory/pull/3871 +* feat(rust): support external-type serialization by @chaokunyang in https://github.com/apache/fory/pull/3881 +* feat(dart): add external-type serialization by @chaokunyang in https://github.com/apache/fory/pull/3886 +* feat(swift): support external-type serialization by @chaokunyang in https://github.com/apache/fory/pull/3888 +* feat(csharp): support external type serialization by @chaokunyang in https://github.com/apache/fory/pull/3889 +* feat(xlang): harden external type support by @chaokunyang in https://github.com/apache/fory/pull/3890 +* feat(csharp): support generated class inheritance by @chaokunyang in https://github.com/apache/fory/pull/3893 +* feat(dart): add dart inheriance support by @chaokunyang in https://github.com/apache/fory/pull/3892 +* feat(dart): allow omitting inherited private fields by @chaokunyang in https://github.com/apache/fory/pull/3894 + +## Bug Fix + +* fix(cpp): validate tagged struct field reads by @chaokunyang in https://github.com/apache/fory/pull/3884 +* fix(xlang): reject malformed meta strings by @chaokunyang in https://github.com/apache/fory/pull/3885 +* fix(cpp): validate polymorphic smart pointer reads by @chaokunyang in https://github.com/apache/fory/pull/3887 +* fix: fix release errors by @chaokunyang in https://github.com/apache/fory/pull/3891 + +## Other Improvements + +* chore: fix release script by @chaokunyang in https://github.com/apache/fory/pull/3867 +* chore: Bump protobufjs from 7.6.2 to 7.6.3 in /javascript by @dependabot[bot] in https://github.com/apache/fory/pull/3868 +* chore: Bump com.fasterxml.jackson.core:jackson-databind from 2.22.0 to 2.22.1 in /benchmarks/java by @dependabot[bot] in https://github.com/apache/fory/pull/3869 +* chore(release): bump versions for 1.4.0 by @chaokunyang in https://github.com/apache/fory/pull/3874 +* docs: add java json serialization doc by @chaokunyang in https://github.com/apache/fory/pull/3875 +* chore: fix package metadata links by @chaokunyang in https://github.com/apache/fory/pull/3876 +* chore: Bump protobufjs from 7.6.3 to 7.6.5 in /javascript by @dependabot[bot] in https://github.com/apache/fory/pull/3878 +* chore: Bump tar from 7.5.16 to 7.5.20 in /javascript by @dependabot[bot] in https://github.com/apache/fory/pull/3879 +* chore: Bump com.fasterxml.jackson.core:jackson-core from 2.18.6 to 2.18.8 in /java/fory-testsuite by @dependabot[bot] in https://github.com/apache/fory/pull/3880 +* chore: Bump tar from 7.5.20 to 7.5.22 in /javascript by @dependabot[bot] in https://github.com/apache/fory/pull/3882 +* chore(deps): upgrade test deps by @chaokunyang in https://github.com/apache/fory/pull/3883 + +**Full Changelog**: https://github.com/apache/fory/compare/v1.4.0...v1.5.0 diff --git a/docs/guide/swift/index.md b/docs/guide/swift/index.md index 6caa1a5798..c2607e0bbf 100644 --- a/docs/guide/swift/index.md +++ b/docs/guide/swift/index.md @@ -37,7 +37,7 @@ Add Fory Swift from the Apache Fory GitHub repository: ```swift dependencies: [ - .package(url: "https://github.com/apache/fory.git", exact: "$version") + .package(url: "https://github.com/apache/fory.git", exact: "1.5.0") ], targets: [ .target( diff --git a/docs/start/install.md b/docs/start/install.md index 1226cc9568..d36071ed5d 100644 --- a/docs/start/install.md +++ b/docs/start/install.md @@ -16,14 +16,14 @@ Use Maven to add Apache Fory™: <dependency> <groupId>org.apache.fory</groupId> <artifactId>fory-core</artifactId> - <version>1.4.0</version> + <version>1.5.0</version> </dependency> <!-- Optional row format support --> <!-- <dependency> <groupId>org.apache.fory</groupId> <artifactId>fory-format</artifactId> - <version>1.4.0</version> + <version>1.5.0</version> </dependency> --> ``` @@ -36,7 +36,7 @@ Scala 2.13 with Maven: <dependency> <groupId>org.apache.fory</groupId> <artifactId>fory-scala_2.13</artifactId> - <version>1.4.0</version> + <version>1.5.0</version> </dependency> ``` @@ -46,20 +46,20 @@ Scala 3 with Maven: <dependency> <groupId>org.apache.fory</groupId> <artifactId>fory-scala_3</artifactId> - <version>1.4.0</version> + <version>1.5.0</version> </dependency> ``` Scala 2.13 with sbt: ```sbt -libraryDependencies += "org.apache.fory" % "fory-scala_2.13" % "1.4.0" +libraryDependencies += "org.apache.fory" % "fory-scala_2.13" % "1.5.0" ``` Scala 3 with sbt: ```sbt -libraryDependencies += "org.apache.fory" % "fory-scala_3" % "1.4.0" +libraryDependencies += "org.apache.fory" % "fory-scala_3" % "1.5.0" ``` ## Kotlin @@ -70,7 +70,7 @@ Add Apache Fory™ Kotlin with Maven: <dependency> <groupId>org.apache.fory</groupId> <artifactId>fory-kotlin</artifactId> - <version>1.4.0</version> + <version>1.5.0</version> </dependency> ``` @@ -78,7 +78,7 @@ Add Apache Fory™ Kotlin with Maven: ```bash python -m pip install --upgrade pip -pip install pyfory==1.4.0 +pip install pyfory==1.5.0 ``` ## Go @@ -86,7 +86,7 @@ pip install pyfory==1.4.0 Use the full Go module path `github.com/apache/fory/go/fory`: ```bash -go get github.com/apache/fory/go/[email protected] +go get github.com/apache/fory/go/[email protected] ``` If your Go proxy has not picked up the new submodule tag yet, retry later or use `GOPROXY=direct` temporarily. @@ -95,13 +95,13 @@ If your Go proxy has not picked up the new submodule tag yet, retry later or use ```toml [dependencies] -fory = "1.4.0" +fory = "1.5.0" ``` Or use `cargo add`: ```bash -cargo add [email protected] +cargo add [email protected] ``` ## JavaScript / TypeScript @@ -124,7 +124,7 @@ Add Apache Fory™ Dart to `pubspec.yaml`: ```yaml dependencies: - fory: ^1.4.0 + fory: ^1.5.0 dev_dependencies: build_runner: ^2.4.13 @@ -141,12 +141,12 @@ dart run build_runner build --delete-conflicting-outputs Install the `Apache.Fory` NuGet package. It includes both the runtime and the source generator for `[ForyStruct]` types. ```bash -dotnet add package Apache.Fory --version 1.4.0 +dotnet add package Apache.Fory --version 1.5.0 ``` ```xml <ItemGroup> - <PackageReference Include="Apache.Fory" Version="1.4.0" /> + <PackageReference Include="Apache.Fory" Version="1.5.0" /> </ItemGroup> ``` @@ -156,7 +156,7 @@ Add Apache Fory™ from the GitHub repository with Swift Package Manager: ```swift dependencies: [ - .package(url: "https://github.com/apache/fory.git", exact: "1.4.0") + .package(url: "https://github.com/apache/fory.git", exact: "1.5.0") ], targets: [ .target( diff --git a/src/components/home/HomepageLanding.tsx b/src/components/home/HomepageLanding.tsx index 16760918ea..1ebca545f0 100644 --- a/src/components/home/HomepageLanding.tsx +++ b/src/components/home/HomepageLanding.tsx @@ -138,7 +138,7 @@ const runtimeExamples: RuntimeExample[] = [ install: `<dependency> <groupId>org.apache.fory</groupId> <artifactId>fory-core</artifactId> - <version>1.4.0</version> + <version>1.5.0</version> </dependency>`, codeLanguage: "java", guide: "/docs/guide/java/", @@ -181,7 +181,7 @@ out = fory.deserialize(data)`, id: "rust", label: "Rust", installLanguage: "bash", - install: `cargo add [email protected]`, + install: `cargo add [email protected]`, codeLanguage: "rust", guide: "/docs/guide/rust/", summary: "Rust uses derive macros for type-safe structs and supports both xlang and native payloads.", @@ -230,7 +230,7 @@ _ = f.Deserialize(payload, &out)`, FetchContent_Declare( fory GIT_REPOSITORY https://github.com/apache/fory.git - GIT_TAG v1.4.0 + GIT_TAG v1.5.0 SOURCE_SUBDIR cpp ) FetchContent_MakeAvailable(fory)`, @@ -278,7 +278,7 @@ const out = deserialize(payload);`, id: "csharp", label: "C#", installLanguage: "bash", - install: `dotnet add package Apache.Fory --version 1.4.0`, + install: `dotnet add package Apache.Fory --version 1.5.0`, codeLanguage: "csharp", guide: "/docs/guide/csharp/", summary: ".NET support uses source-generated serializers for Fory structs, enums, and unions.", @@ -301,7 +301,7 @@ Person out = fory.Deserialize<Person>(payload);`, id: "swift", label: "Swift", installLanguage: "swift", - install: `.package(url: "https://github.com/apache/fory.git", exact: "1.4.0")`, + install: `.package(url: "https://github.com/apache/fory.git", exact: "1.5.0")`, codeLanguage: "swift", guide: "/docs/guide/swift/", summary: "Swift uses @ForyStruct, @ForyEnum, and @ForyUnion macros for xlang-compatible models.", @@ -324,7 +324,7 @@ let out: Person = try fory.deserialize(payload)`, label: "Dart", installLanguage: "yaml", install: `dependencies: - fory: ^1.4.0 + fory: ^1.5.0 dev_dependencies: build_runner: ^2.4.13`, @@ -359,7 +359,7 @@ final out = fory.deserialize<Person>(payload);`, id: "scala", label: "Scala", installLanguage: "sbt", - install: `libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.4.0"`, + install: `libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.5.0"`, codeLanguage: "scala", guide: "/docs/guide/scala/", summary: "Scala builds on Fory Java with optimized serializers for case classes, collections, tuples, and Option.", @@ -379,8 +379,8 @@ val out = fory.deserialize(payload).asInstanceOf[Person]`, id: "kotlin", label: "Kotlin", installLanguage: "kotlin", - install: `implementation("org.apache.fory:fory-kotlin:1.4.0") -ksp("org.apache.fory:fory-kotlin-ksp:1.4.0")`, + install: `implementation("org.apache.fory:fory-kotlin:1.5.0") +ksp("org.apache.fory:fory-kotlin-ksp:1.5.0")`, codeLanguage: "kotlin", guide: "/docs/guide/kotlin/", summary: "Kotlin adds data-class support, Android guidance, and KSP static serializers for xlang/schema mode.", diff --git a/src/pages/download/index.md b/src/pages/download/index.md index f81e0a8969..f6391a22ad 100644 --- a/src/pages/download/index.md +++ b/src/pages/download/index.md @@ -9,11 +9,11 @@ For binary install, please see Apache Fory™ [install](/docs/start/install/) do ## The latest release -The latest source release is 1.4.0: +The latest source release is 1.5.0: | Version | Date | Source | Release Notes | | ------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------- | -| 1.4.0 | 2026-07-20 | [source](https://www.apache.org/dyn/closer.lua/fory/1.4.0/apache-fory-1.4.0-src.tar.gz?action=download) [asc](https://downloads.apache.org/fory/1.4.0/apache-fory-1.4.0-src.tar.gz.asc) [sha512](https://downloads.apache.org/fory/1.4.0/apache-fory-1.4.0-src.tar.gz.sha512) | [release notes](https://github.com/apache/fory/releases/tag/v1.4.0) | +| 1.5.0 | 2026-07-31 | [source](https://www.apache.org/dyn/closer.lua/fory/1.5.0/apache-fory-1.5.0-src.tar.gz?action=download) [asc](https://downloads.apache.org/fory/1.5.0/apache-fory-1.5.0-src.tar.gz.asc) [sha512](https://downloads.apache.org/fory/1.5.0/apache-fory-1.5.0-src.tar.gz.sha512) | [release notes](https://github.com/apache/fory/releases/tag/v1.5.0) | ## All archived releases @@ -31,13 +31,13 @@ These files are named after the files they relate to but have `.sha512/.asc` ext To verify the SHA digests, you need the `.tar.gz` file and its associated `.tar.gz.sha512` file. An example command: ```bash -sha512sum --check apache-fory-1.4.0-src.tar.gz.sha512 +sha512sum --check apache-fory-1.5.0-src.tar.gz.sha512 ``` It should output something like: ```bash -apache-fory-1.4.0-src.tar.gz: OK +apache-fory-1.5.0-src.tar.gz: OK ``` ### Verifying Signatures @@ -54,13 +54,13 @@ gpg --import KEYS Then you can verify signature: ```bash -gpg --verify apache-fory-1.4.0-src.tar.gz.asc apache-fory-1.4.0-src.tar.gz +gpg --verify apache-fory-1.5.0-src.tar.gz.asc apache-fory-1.5.0-src.tar.gz ``` If something like the following appears, it means the signature is correct: ```bash -gpg: Signature made Fri Jul 17 00:41:13 2026 CST +gpg: Signature made Tue Jul 28 13:13:48 2026 CST gpg: using RSA key 1E2CDAE4C08AD7D694D1CB139D7BE8E45E580BA4 gpg: Good signature from "chaokunyang (CODE SIGNING KEY) <[email protected]>" [unknown] ``` diff --git a/static/img/blog/fory_1_5_0_release/string_throughput.png b/static/img/blog/fory_1_5_0_release/string_throughput.png new file mode 100644 index 0000000000..95effcaea0 Binary files /dev/null and b/static/img/blog/fory_1_5_0_release/string_throughput.png differ diff --git a/static/img/blog/fory_1_5_0_release/utf8_bytes_throughput.png b/static/img/blog/fory_1_5_0_release/utf8_bytes_throughput.png new file mode 100644 index 0000000000..7f2aacc375 Binary files /dev/null and b/static/img/blog/fory_1_5_0_release/utf8_bytes_throughput.png differ --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
