Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Changelog

## 1.3.0(开发中,未发布)
## 1.3.0(发布准备,未发布)

新增具体订阅建立通知、独立通道实际配置与分流订阅数诊断、Android Java 入口和可选 flowbus-compose 模块。旧方法与投递/所有权语义保留,基础两个坐标不增加 Compose 依赖。候选版本为 1.3.0-SNAPSHOT,正式安装仍为 1.2.0;行为、回退与验收边界见[开发说明](docs/release-notes-1.3.0.md)。
新增具体订阅建立通知、独立通道实际配置与分流订阅数诊断、Android Java 入口和可选 flowbus-compose 模块。旧方法与投递/所有权语义保留,基础两个坐标不增加 Compose 依赖。候选版本为 1.3.0,正式安装仍为 1.2.0;行为、回退与验收边界见[开发说明](docs/release-notes-1.3.0.md)。

## 1.2.0(2026-10-15)

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ repositories {
}
```

Android 使用 `implementation("io.github.logan0817:flowbus:1.3.0-SNAPSHOT")`;纯 JVM 使用 `implementation("io.github.logan0817:flowbus-core:1.3.0-SNAPSHOT")`。若使用集中仓库管理,将仓库配置放入消费者 `settings.gradle.kts` 的 `dependencyResolutionManagement.repositories`。不要把本地候选安装成功当作正式发布或完整设备验收。
Android 使用 `implementation("io.github.logan0817:flowbus:1.3.0")`;纯 JVM 使用 `implementation("io.github.logan0817:flowbus-core:1.3.0")`。若使用集中仓库管理,将仓库配置放入消费者 `settings.gradle.kts` 的 `dependencyResolutionManagement.repositories`。不要把本地候选安装成功当作正式发布或完整设备验收。

当前源码开发版本为 1.3.0-SNAPSHOT,尚未发布;Compose 消费者按需添加 `io.github.logan0817:flowbus-compose:1.3.0-SNAPSHOT`。正式用户继续使用 1.2.0,本地候选验收不等于公开发布。
当前源码发布候选版本为 1.3.0,尚未发布;Compose 消费者按需添加 `io.github.logan0817:flowbus-compose:1.3.0`。正式用户继续使用 1.2.0,本地候选验收不等于公开发布。
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ viewLifecycleOwner.collectEvent(eventFlow<RefreshHomeEvent>()) { event ->
- Maven Central 坐标:使用 `io.github.logan0817:flowbus:1.2.0` 或 `io.github.logan0817:flowbus-core:1.2.0`
- [变化、迁移、验证证据与性能边界](docs/release-notes-1.2.0.md)

## 1.3.0 开发版
## 1.3.0 发布候选

当前源码开发版本为 **1.3.0-SNAPSHOT**,尚未发布。新增具体订阅建立通知、Java 友好入口、通道实际配置诊断和可选 [Compose 模块](library-compose/README.md)。正式安装仍使用上面的 1.2.0;候选用法与验收边界见 [1.3.0 开发说明](docs/release-notes-1.3.0.md)。
当前源码发布候选版本为 **1.3.0**,尚未发布。新增具体订阅建立通知、Java 友好入口、通道实际配置诊断和可选 [Compose 模块](library-compose/README.md)。正式安装仍使用上面的 1.2.0;候选用法与验收边界见 [1.3.0 发布说明](docs/release-notes-1.3.0.md)。

## 兼容与发布状态

Expand Down
4 changes: 2 additions & 2 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ The latest stable version is **1.2.0**, published to Maven Central on 2026-10-15
- Maven Central coordinates: `io.github.logan0817:flowbus:1.2.0` or `io.github.logan0817:flowbus-core:1.2.0`
- [Changes, migration, verification, and performance limits](docs/en/release-notes-1.2.0.md)

## 1.3.0 development version
## 1.3.0 release candidate

Current sources target **1.3.0-SNAPSHOT**, not a public release. New capabilities include per-collection registration notification, Java convenience APIs, effective channel diagnostics and an optional [Compose module](library-compose/README_EN.md). Public installation remains 1.2.0; see the [development notes](docs/en/release-notes-1.3.0.md) for local candidate usage and verification boundaries.
Current sources target the **1.3.0 release candidate**, not a public release. New capabilities include per-collection registration notification, Java convenience APIs, effective channel diagnostics and an optional [Compose module](library-compose/README_EN.md). Public installation remains 1.2.0; see the [development notes](docs/en/release-notes-1.3.0.md) for local candidate usage and verification boundaries.

## Compatibility and release status

Expand Down
2 changes: 1 addition & 1 deletion TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ inspect().config 显示 bus 默认值;tryPostResult/tryPostStickyResult.overfl

## 1.3.0 开发版的订阅、Java 与 Compose 排查

以下仅适用于尚未发布的 `1.3.0-SNAPSHOT` 本地候选,正式 1.2.0 不提供这些新接口。
以下仅适用于尚未发布的 `1.3.0` 本地候选,正式 1.2.0 不提供这些新接口。

- 需要确认自己的订阅已登记时,使用 `onSubscribed` 重载;不要用 inspector 总订阅数或 `Flow.onStart` 充当屏障。通知只执行短操作,让独立生产协程继续;它不表示 replay 或业务完成,每次生命周期重新收集都会再次通知,通知后仍可能取消。
- 查询某条通道的实际配置与普通/sticky 各自订阅数,使用来源的 `inspectChannel(key)`;旧 `inspect().config` 仍是默认值。未知 core 查询不创建通道;Android 静态入口首次获取来源可以初始化 bus。快照不能作为正式业务控制或就绪依据。
Expand Down
4 changes: 2 additions & 2 deletions app/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.3.0-SNAPSHOT">
android:versionCode="2"
android:versionName="1.3.0">

<application android:label="FlowBus sample tests" />

Expand Down
8 changes: 4 additions & 4 deletions benchmarks/jvm/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FlowBus JVM 性能基准

独立 Gradle 工程,不属于根项目 settings,不进入生产依赖或 Maven 发布产物。当前对照为固定 SHA-256 的 Maven Central **1.2.0**、隔离仓库 **1.3.0-SNAPSHOT** 开发候选和原生 SharedFlow。Kotlin 1.9.25、Coroutines 1.8.1、JMH 1.37、JDK 17 固定,fork heap 为 -Xms512m -Xmx512m;JMH 采用 [GPLv2 with Classpath Exception](https://github.com/openjdk/jmh/blob/1.37/LICENSE),仅为开发测量工具,FlowBus 发布许可证仍为 MIT。`results/current/` 目前仍保存 **1.2.0 对照 1.1.0 的历史完整报告**,不代表本开发版的性能结果。
独立 Gradle 工程,不属于根项目 settings,不进入生产依赖或 Maven 发布产物。当前对照为固定 SHA-256 的 Maven Central **1.2.0**、隔离仓库 **1.3.0** 发布候选和原生 SharedFlow。Kotlin 1.9.25、Coroutines 1.8.1、JMH 1.37、JDK 17 固定,fork heap 为 -Xms512m -Xmx512m;JMH 采用 [GPLv2 with Classpath Exception](https://github.com/openjdk/jmh/blob/1.37/LICENSE),仅为开发测量工具,FlowBus 发布许可证仍为 MIT。`results/current/` 目前仍保存 **1.2.0 对照 1.1.0 的历史完整报告**,不代表本开发版的性能结果。

## 运行

Expand All @@ -19,7 +19,7 @@
python3 benchmarks/jvm/summarize.py
```

同一工作区的 Gradle 调用串行,不能同时运行多个正式基准或构建。CI 在独立 `consumers` job 内依次运行三组默认 smoke,再单独选择候选 SubscriptionBenchmark 生成 `subscription-smoke.json`;候选从本次 `prepare` artifact 下载并校验,不重新发布。其余编译器/设备使用独立工作区并行。基准报告位于该 job 的 `flowbus-verification-consumers-<workflow SHA>-<attempt>`,候选一致性和收集方式见[发布清单](../../docs/release-checklist.md#ci-任务关系与候选边界)。使用 Android Studio 时,与 IDE 复用相同的 Gradle JDK、Android SDK 和 Gradle user home。baseline 单独运行正式 1.2.0 JAR,SHA-256 固定为 `525c10846d00e7a41f932ac0ce45dba47b7b8b1da58bc68266e33df4a4b974f2`;candidate 使用 `build/candidate-maven/io/github/logan0817/flowbus-core/1.3.0-SNAPSHOT/flowbus-core-1.3.0-SNAPSHOT.jar`(版本读取根 gradle.properties),shared 依赖相同但收发直接使用 MutableSharedFlow。不允许用当前源码重建正式基线。
同一工作区的 Gradle 调用串行,不能同时运行多个正式基准或构建。CI 在独立 `consumers` job 内依次运行三组默认 smoke,再单独选择候选 SubscriptionBenchmark 生成 `subscription-smoke.json`;候选从本次 `prepare` artifact 下载并校验,不重新发布。其余编译器/设备使用独立工作区并行。基准报告位于该 job 的 `flowbus-verification-consumers-<workflow SHA>-<attempt>`,候选一致性和收集方式见[发布清单](../../docs/release-checklist.md#ci-任务关系与候选边界)。使用 Android Studio 时,与 IDE 复用相同的 Gradle JDK、Android SDK 和 Gradle user home。baseline 单独运行正式 1.2.0 JAR,SHA-256 固定为 `525c10846d00e7a41f932ac0ce45dba47b7b8b1da58bc68266e33df4a4b974f2`;candidate 使用 `build/candidate-maven/io/github/logan0817/flowbus-core/1.3.0/flowbus-core-1.3.0.jar`(版本读取根 gradle.properties),shared 依赖相同但收发直接使用 MutableSharedFlow。不允许用当前源码重建正式基线。

默认筛选:shared 仅 `BusBenchmark`,baseline 为 `BusBenchmark|BusLifecycleBenchmark`,candidate 为这两类加 `CandidateConfigBenchmark`。默认任务保留原完整报告范围,不自动混入仅候选支持的 `SubscriptionBenchmark`。新参数均为可选:`benchmark.filter` 替换类名正则,`benchmark.scenarios` 以逗号选择该类支持的 scenario,`benchmark.report` 选择 `build/reports/<名称>.json`,避免定向报告覆盖完整数据。仅包含所选类真实参数的组合才有效。

Expand All @@ -33,7 +33,7 @@ python3 benchmarks/jvm/summarize.py
./gradlew -p benchmarks/jvm jmh -Pbenchmark.target=candidate '-Pbenchmark.filter=.*SubscriptionBenchmark.*' -Pbenchmark.scenarios=plain,hook -Pbenchmark.report=candidate-subscription-1.3.0
```

2026-10-30 已完成上述五组以及稳定发送/首次注册的两组反向复测,共九组定向正式测量,见 [1.3.0 定向报告](results/1.3.0/report.md)。工作站负载未受控,注册吞吐的快慢关系在复测中反转,发布前仍需空闲环境确认;不能据此宣称提速或完全无回退。不要将多个定向结果拼成完整三组基准。
2026-10-30 使用当时的 **1.3.0-SNAPSHOT** 完成五组以及稳定发送/首次注册的两组反向复测,共九组定向正式测量,见 [开发版定向报告](results/1.3.0/report.md)。这些历史测量不验证当前 `1.3.0` 制品;上方命令按当前版本生成新结果。工作站负载未受控,注册吞吐的快慢关系在复测中反转,不能据此宣称提速或完全无回退。不要将多个定向结果拼成完整三组基准。

JMH 成功后生成同名 `.identity.json`,绑定报告摘要、实际 JAR、源码与基准构建脚本。`summarize.py` 在写入结果前验证三份完整报告及身份;缺少标记、输入变化或摘要不符均拒绝。旧无标记报告保留为历史,不能手工补标记后改称当前测量。

Expand Down Expand Up @@ -65,7 +65,7 @@ SubscriptionBenchmark 两组都使用相同 Deferred/发送/取消工作量。pl

## 历史完整结果与注册 profile

[实测报告](results/current/report.md)、[分析](results/current/analysis.md)、[环境](results/current/environment.json)记录 1.2.0 对照 1.1.0 的已测快照,保留原始含义,不用于证明 1.3.0-SNAPSHOT 性能。当前配置下重新定位注册开销时使用以下入口,不改变生产依赖:
[实测报告](results/current/report.md)、[分析](results/current/analysis.md)、[环境](results/current/environment.json)记录 1.2.0 对照 1.1.0 的已测快照,保留原始含义,不用于证明 1.3.0 性能。当前配置下重新定位注册开销时使用以下入口,不改变生产依赖:

```bash
./gradlew -p benchmarks/jvm profileRegistration -Pbenchmark.target=baseline
Expand Down
8 changes: 4 additions & 4 deletions compatibility/android-consumer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ release 使用 R8,未配置签名。预期输出为:
- APK:`build/maven-local-consumer/app/build/outputs/apk/release/app-release-unsigned.apk`
- mapping:`build/maven-local-consumer/app/build/outputs/mapping/release/mapping.txt`

此目录验证本地源码生成的 **1.3.0-SNAPSHOT** 开发候选,尚未正式发布;Maven Central 当前正式安装仍使用 **1.2.0**。兼容基线包含 1.0.7、1.1.0 和正式 1.2.0;本 APK 的旧版实际调用 fixture 仍单独固定为 1.1.0,其他基线按相应静态符号或 core 二进制入口验证,不混称本 APK 已运行全部旧 Android 字节码。本地候选验收不能替代公开仓库验证。
此目录验证本地源码生成的 **1.3.0** 发布候选,尚未正式发布;Maven Central 当前正式安装仍使用 **1.2.0**。兼容基线包含 1.0.7、1.1.0 和正式 1.2.0;本 APK 的旧版实际调用 fixture 仍单独固定为 1.1.0,其他基线按相应静态符号或 core 二进制入口验证,不混称本 APK 已运行全部旧 Android 字节码。本地候选验收不能替代公开仓库验证。

## 本地测试签名

Expand Down Expand Up @@ -88,7 +88,7 @@ CI 已新增该驱动回归步骤,并在既有 API 21 库层 instrumentation

各组通过 finally 清理自己持有的 owner、订阅、source 或 channel;显式 lifecycle 组先取消订阅并同步关闭 source/channel,再 join,避免已取消协程在挂起等待时跳过资源关闭。Activity onDestroy 取消验证 scope。正常销毁导致的取消既不生成 PASS,也不误报 FAIL;验证中途关闭 Activity 应重新冷启动完成验证。

历史 1.1.0/1.2.0 的结果见兼容性评估;它们不证明当前七阶段开发候选已通过设备验证。API 21 或其他设备必须核对最终候选的实际报告,APK 名称、签名或静态检查不代表最低系统通过。完整已测组合与未认证范围见[兼容性评估](../../docs/compatibility.md)。
历史 1.1.0/1.2.0 的结果见兼容性评估;它们不证明当前七阶段发布候选已通过设备验证。API 21 或其他设备必须核对最终候选的实际报告,APK 名称、签名或静态检查不代表最低系统通过。完整已测组合与未认证范围见[兼容性评估](../../docs/compatibility.md)。

## 已发布 1.0.7 AAR 的 JVM 符号核对

Expand All @@ -113,7 +113,7 @@ PY

python3 -B compatibility/core-binary-consumer/verify_symbols.py \
--baseline-artifact build/published-baseline/flowbus-1.0.7.aar \
--candidate-artifact build/candidate-maven/io/github/logan0817/flowbus/1.3.0-SNAPSHOT/flowbus-1.3.0-SNAPSHOT.aar \
--candidate-artifact build/candidate-maven/io/github/logan0817/flowbus/1.3.0/flowbus-1.3.0.aar \
--baseline-api-snapshot compatibility/android-consumer/api/flowbus-1.0.7.api \
--javap /path/to/jdk17/bin/javap \
--output build/android-jvm-symbol-verification.json
Expand All @@ -125,7 +125,7 @@ python3 -B compatibility/core-binary-consumer/verify_symbols.py \

## 1.1.0 原版编译的 Android 消费者

legacy/src/main 是独立 Android library fixture,compileOnly 只含正式 1.1.0 的 core JAR/AAR classes.jar 和原有 Lifecycle;prepare 先核对 baselines.json 中的固定 SHA-256,候选 APK 只将其编译好的 class 与当前 1.3.0-SNAPSHOT runtime 一起交给 R8。旧实现代码不引用新配置 API。
legacy/src/main 是独立 Android library fixture,compileOnly 只含正式 1.1.0 的 core JAR/AAR classes.jar 和原有 Lifecycle;prepare 先核对 baselines.json 中的固定 SHA-256,候选 APK 只将其编译好的 class 与当前 1.3.0 runtime 一起交给 R8。旧实现代码不引用新配置 API。

verifyMavenLocalConsumer 先执行 :legacy:testReleaseUnitTest,再构建 minified APK。单测使用候选 Maven Android/core 依赖并明确剔除原版 compileOnly JAR,校验实际加载的 FlowBus/FlowEventBus class 字节与候选制品一致,运行旧挂起回调及 root/shared/owned/owner 入口,检查旧 main class 全部摘要在执行前后不变。报告为 build/maven-local-consumer/legacy/build/reports/binary-android-compatibility.txt。JVM 单测使用可控 Main dispatcher 和 createUnsafe LifecycleRegistry,不代表 Android Main/设备运行;设备七阶段还会执行同一旧 fixture。

Expand Down
4 changes: 2 additions & 2 deletions compatibility/android-consumer/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This directory holds source fixtures for an independent consumer of the real candidate Maven artifacts after release R8. It is not a standalone Gradle project or a published library. It does not add production dependencies, raise minSdk, or configure production signing.

The current candidate is **1.3.0-SNAPSHOT**, built from local source and not released. The current Maven Central installation remains **1.2.0**. Historical evidence does not establish that this candidate passes.
The current candidate is **1.3.0**, built from local source and not released. The current Maven Central installation remains **1.2.0**. Historical evidence does not establish that this candidate passes.

## Generate and build

Expand Down Expand Up @@ -93,7 +93,7 @@ Android API snapshots for 1.0.7, 1.1.0, and 1.2.0 remain in `api/`; do not repla
```bash
python3 -B compatibility/core-binary-consumer/verify_symbols.py \
--baseline-artifact build/published-baseline/flowbus-1.0.7.aar \
--candidate-artifact build/candidate-maven/io/github/logan0817/flowbus/1.3.0-SNAPSHOT/flowbus-1.3.0-SNAPSHOT.aar \
--candidate-artifact build/candidate-maven/io/github/logan0817/flowbus/1.3.0/flowbus-1.3.0.aar \
--baseline-api-snapshot compatibility/android-consumer/api/flowbus-1.0.7.api \
--javap /path/to/jdk17/bin/javap \
--output build/android-jvm-symbol-verification.json
Expand Down
2 changes: 1 addition & 1 deletion compatibility/compose-consumer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[English](README_EN.md)

此目录是独立消费者模板,用于评估当前 Kotlin 1.9.25 基线的 Compose 编译和 release R8 接入,现通过候选 Maven 坐标调用正式模块源码中的 [FlowBusEffect](../../library-compose/README.md)。当前 `flowbus-compose:1.3.0-SNAPSHOT` 是尚未发布的本地开发候选;公开 1.2.0 不包含该坐标。模板的生成、构建和验证由主仓验证任务负责,本目录没有独立发布任务。
此目录是独立消费者模板,用于评估当前 Kotlin 1.9.25 基线的 Compose 编译和 release R8 接入,现通过候选 Maven 坐标调用正式模块源码中的 [FlowBusEffect](../../library-compose/README.md)。当前 `flowbus-compose:1.3.0` 是尚未发布的本地发布候选;公开 1.2.0 不包含该坐标。模板的生成、构建和验证由主仓验证任务负责,本目录没有独立发布任务。

消费者默认使用 activity-compose `1.8.2`、Compose runtime/ui `1.5.4`、Compose compiler `1.5.15`,直接声明 Lifecycle `2.6.2`,消费当前候选 FlowBus 产物。另可选择 runtime/ui `1.7.8` 进行新版实验。全部仅作用于此消费者;基础库不传递引入 Compose,也不改变基础依赖、SDK 或 Kotlin 要求。两种组合的结果必须分开记录,声明版本不能代替实际解析或设备证据。

Expand Down
2 changes: 1 addition & 1 deletion compatibility/compose-consumer/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[中文](README.md)

This directory is an isolated consumer template for evaluating Compose compilation and release R8 on the existing Kotlin 1.9.25 baseline. It now resolves candidate Maven artifacts and calls [FlowBusEffect](../../library-compose/README_EN.md) from the production module source. `flowbus-compose:1.3.0-SNAPSHOT` is an unpublished local development candidate; public 1.2.0 does not include this coordinate. Repository verification tasks generate and build the consumer; this template has no publication task.
This directory is an isolated consumer template for evaluating Compose compilation and release R8 on the existing Kotlin 1.9.25 baseline. It now resolves candidate Maven artifacts and calls [FlowBusEffect](../../library-compose/README_EN.md) from the production module source. `flowbus-compose:1.3.0` is an unpublished local release candidate; public 1.2.0 does not include this coordinate. Repository verification tasks generate and build the consumer; this template has no publication task.

The default consumer uses activity-compose `1.8.2`, Compose runtime/ui `1.5.4`, compiler `1.5.15`, and a direct Lifecycle `2.6.2` declaration with the current candidate FlowBus artifact. Runtime/ui `1.7.8` is a separate optional experiment. These dependencies apply only to the consumer; the base library does not add Compose or change its dependency, SDK, or Kotlin requirements. Keep evidence for the two combinations separate: declared versions do not establish resolved dependencies or device compatibility.

Expand Down
Loading
Loading