Skip to content

Releases: junerver/ComposeHooks

v2.4.0-beta-1

v2.4.0-beta-1 Pre-release
Pre-release

Choose a tag to compare

@junerver junerver released this 02 Jul 02:08

What's Changed

Compared with v2.3.0. The headline change is a new wasmJs (browser) target, bringing Compose Multiplatform to the Web so downstream projects (e.g. Palette) can run interactive previews in the browser. Now publishing four platforms: android · desktop (jvm) · ios · wasmJs.

2.4.0 is still in beta. Source compatibility with 2.3.0 is preserved (see API section); the beta mainly gathers wasmJs feedback before the stable release.

wasmJs Target (Web/WASM) 🌐

  • Add wasmJs { browser() } to the hooks library, publishing a wasmJs klib variant. Available since 2.4.0.
  • Sink the kotlin-reflect dependency from commonMain to commonJvmAndroidcommonMain only uses KClass/KFunction/KProperty from the stdlib (as map keys / delegate signatures), so wasmJs compiles cleanly; real reflection calls stay isolated in commonJvmAndroid.
  • Configure Karma ChromeHeadlessNoSandbox so wasmJs browser tests run reliably in headless/CI shells.
  • Add hooks/src/wasmJsTest smoke tests covering createStore / reducer / combineStores / middleware — 201 tests pass end-to-end in real headless Chrome (karma + webpack).
  • Downstream verified: Palette upgraded to 2.4.0-beta-1 and :palette:compileKotlinWasmJs succeeds against remote Maven Central.

API & Refactoring

  • Add missing remember* Compose-style aliases for all hooks.
  • Add standalone root-package re-exports of useDispatch / useSelector / useTable.
  • Migrate hooks into subpackages (useref/, useState/, timer & debounce groups, etc.); rename declare.kt facades to Hooks.kt / Ai.kt and centralize type re-exports.
  • Unify .kt filenames to PascalCase across hooks / app / ai.
  • Source compatibility preserved: after the subpackage migration, public API was restored so app / ai (and downstream consumers) compile with zero code changes.
  • Fix findings from the Compose audit.

CI, Quality Gates & Coverage

  • Add a GitHub Actions CI workflow (.github/workflows/ci.yml) gating merges on static checks, coverage, and library build.
  • Add Gradle quality-gate tasks consumed by CI: :hooks:runQualityChecks, :hooks:runCoverageChecks, and :hooks:verifyReleaseReadiness.
  • Add Kover test-coverage reporting and verification.

Tests

  • Add batch tests for useSorted, useImmutableList, useLastChanged, useSelectable, useTimestamp, and the math hooks.
  • Add low-coverage hooks tests across more packages.
  • Stabilize the test suite: move Compose UI tests to desktopTest (fixing Android unit-test failures), fix SmallHooksTest deadlock, and resolve Fetch-test hangs (SupervisorJob / advanceUntilIdle / backgroundScope).
  • Relax timer-test assertions (useInterval, useCountdown, useTimeoutPoll) for the runComposeUiTest virtual clock.

Full Changelog: v2.3.0...v2.4.0-beta-1

v2.3.0

Choose a tag to compare

@junerver junerver released this 18 Jun 00:40

What's Changed

Compared with hooks2:2.2.1 (hooks2_2.2.1).

Hooks

  • Add useSse for SSE and streaming connections.
  • Add the useTable headless table hook and declarative Table component, including sorting, filtering, grouping, expansion, row selection, column visibility, column sizing, and pagination support.
  • Add useTableRequest for paginated table requests, with fixes for cache keys, filter handling, and page-switch behavior.
  • Improve useForm with touched/dirty state, validation trigger control, submit handling, and expanded form instance/ref APIs.
  • Improve useStateMachine with action-only events, defect fixes, and expanded test coverage.
  • Fix useRequest Fetch/plugin behavior, nullable parameter handling, and related cache/polling cases.
  • Fix useReducer stale closure issues, dispatchAsync, usePrevious, debounce/throttle timing, timeout/countdown behavior, and related edge cases.

AI Hooks

  • Add useChat, useGenerateObject, useAgent, useAsr, and useTts.
  • Add multimodal input support, streaming parsing, JSON healing, tool calling, Anthropic Messages API support, and DeepSeek/MiMo reasoning-content compatibility.
  • Add multi-provider support with load balancing, failover, provider metrics, retry configuration, and reusable HTTP engine abstractions.
  • Add token usage tracking and update preset model IDs.

Build, Examples, and Docs

  • Upgrade Kotlin, KSP, AGP, Gradle, Compose Multiplatform, navigation, and related dependencies; align JVM targets to 17.
  • Add and update showcase examples for AI hooks, SSE, table, table requests, and existing hooks.
  • Add broader test coverage for hooks, table features, useRequest plugins, form behavior, and AI flows.
  • Expand documentation and local contributor/agent guidance.

Full Changelog: hooks2_2.2.1...v2.3.0

hooks2:2.2.2-beta-1

hooks2:2.2.2-beta-1 Pre-release
Pre-release

Choose a tag to compare

@junerver junerver released this 06 Jan 02:02

What's Changed

  • add new hook: useChat - Chat with AI
  • add new hook: useGenerateObject - Structured data generation with AI
  • add multimodal support (text + image/file input) for AI hooks
  • add cross-platform file picker utility
  • refactor type definitions and add operator overloads
  • refactor examples to use hooks consistently

Full Changelog: hooks2_2.2.1...v2.2.2-beta-1

hooks2:2.2.1

Choose a tag to compare

@junerver junerver released this 21 Jul 08:21

What's Changed

  • refactor useRequest, provides type-safe request functions by @junerver in #41
  • add new hook: useSorted
  • add new hook: useDateFormat
  • add new hook: useControllable
  • fix #37
  • fix #38
  • refactor useStateAsync
  • add new hook: useMemoizedFn
  • refactor useDebounceFn and useThrottleFn, provides type-safe return functions
  • optimize useDateFormat
  • fix #42
  • update example

Full Changelog: hooks2_2.2.0...hooks2_2.2.1

hooks2:2.2.0

Choose a tag to compare

@junerver junerver released this 10 Jul 00:58

What's Changed

  • ✨: add new hook: useSelectable by @AKAAE86 in #32
  • ✨: add new hook: useStateMachine by @AKAAE86 in #34
  • ✨: add new hook: useTimeAgo
  • ✨: add new hook: useLastChanged
  • ✨: add new hook: useListReduce
  • ✨: add new hook: useTimeoutFn
  • ✨: add new hook: useTimeoutPoll
  • ✨: add new hook: useCancelableAsync
  • ✨: add new hook: useStateAsync
  • ✨: add new hook: usePausableEffect
  • ✨: add new hook: useCycleList
  • ✨: add new hooks set useMath contains: useAbs, useCeil, useFloor, useRound, useTrunc, useMin, useMax, usePow, useSqrt

New Contributors

Full Changelog: hooks2_2.1.0...hooks2_2.2.0


变更内容

  • ✨:添加新钩子:useSelectable,由 @AKAAE86#32 中发布
  • ✨:添加新钩子:useStateMachine,由 @AKAAE86#34 中发布
  • ✨:添加新钩子:useTimeAgo
  • ✨:添加新钩子:useLastChanged
  • ✨:添加新钩子:useListReduce
  • ✨:添加新钩子:useTimeoutFn
  • ✨:添加新钩子:useTimeoutPoll
  • ✨:添加新钩子:useCancelableAsync
  • ✨:添加新钩子:useStateAsync
  • ✨:添加新钩子:usePausableEffect
  • ✨:添加新钩子:useCycleList
  • ✨:添加新hooks 集合 useMath 包含:useAbsuseCeiluseFlooruseRounduseTruncuseMinuseMaxusePowuseSqrt

新贡献者

完整更新日志hooks2_2.1.0...hooks2_2.2.0**

hooks2:2.1.0

Choose a tag to compare

@junerver junerver released this 16 Feb 06:02

NOTE: This project has been migrated to Kotlin Mutliplatform, and the artifact id uploaded to Maven central has been changed to hooks2

Please see the wiki for migration notes

  • upgrade kotlin -> 2.1.0
  • fix #25
  • optimization
  • migrate to KMP #26
  • Reduced the use of tuples as return types for hooks
  • Introduced new parameters debounceOptionsOf and throttleOptionsOf in RequestOptions
  • Extended set/get delegate functions for PersistentHolder, Ref, and MutableRef
  • Refactored usePersistent
  • Refactored unwrap
  • Exposed HooksEventManager to allow communication between non-Compose and Compose sides via events
  • Added a new hook: useImmutableList
  • Refactored useRequest
  • fix: #29
  • deprecated hooks are marked as private
  • breaking change: use State<T>to wrap the return value of hooks
  • breaking change: Some set function property types changed from StateValueFn<T> to StateValueFn<Either<T, (T) -> T>>

注意:该项目已迁移到 Kotlin Mutliplatform,上传到 Maven central 的工件 ID 已更改为 hooks2

请参阅 wiki 了解迁移说明

  • 升级 kotlin -> 2.1.0
  • 修复 #25
  • 优化
  • 迁移到 KMP #26
  • 减少了使用元组作为钩子的返回类型
  • RequestOptions 中引入了新参数 debounceOptionsOfthrottleOptionsOf
  • 扩展了 PersistentHolderRefMutableRef 的 set/get 委托函数
  • 重构了 usePersistent
  • 重构了 unwrap
  • 公开了 HooksEventManager 以允许非 Compose 端和 Compose 端通过事件进行通信
  • 添加了新钩子:useImmutableList
  • 重构了 useRequest
  • 修复:#29
  • 弃用的钩子被标记为私有
  • 重大更改:使用 State<T> 包装 hooks 的返回值
  • 重大更改:一些设置函数属性类型从 StateValueFn<T> 更改为 StateValueFn<Either<T, (T) -> T>>

2.0.3

Choose a tag to compare

@junerver junerver released this 11 Dec 11:35

hooks bugfix

hooks2:2.1.0-beta1

Choose a tag to compare

@junerver junerver released this 29 Nov 08:14

NOTE: This project has been migrated to Kotlin Mutliplatform, and the artifact id uploaded to Maven central has been changed to hooks2

Please see the wiki for migration notes

  • fix: #29
  • deprecated hooks are marked as private,
  • upgrade kotlin to 2.1.0
  • Some set function property types changed from StateValueFn<T> to StateValueFn<Either<T, (T) -> T>> (break change)

注意:该项目已迁移到 Kotlin Mutliplatform,上传到 Maven central 的工件 ID 已更改为 hooks2

请参阅 wiki 了解迁移说明

  • 修复:#29
  • 弃用的钩子被标记为私有
  • 将 kotlin 升级到 2.1.0
  • 一些设置函数属性类型从 StateValueFn<T> 更改为 StateValueFn<Either<T, (T) -> T>> (破坏性更新)

hooks2:2.1.0-alpha1

Choose a tag to compare

@junerver junerver released this 08 Oct 00:31
  • Reduced the use of tuples as return types for hooks
  • Introduced new parameters debounceOptionsOf and throttleOptionsOf in RequestOptions
  • Extended set/get delegate functions for PersistentHolder, Ref, and MutableRef
  • Refactored usePersistent
  • Refactored unwrap
  • Exposed HooksEventManager to allow communication between non-Compose and Compose sides via events
  • Added a new hook: useImmutableList
  • Refactored useRequest

  • 减少了使用元组作为钩子的返回类型
  • RequestOptions 中引入了新参数 debounceOptionsOfthrottleOptionsOf
  • 扩展了 PersistentHolderRefMutableRef 的 set/get 委托函数
  • 重构了 usePersistent
  • 重构了 unwrap
  • 公开了 HooksEventManager 以允许非 Compose 端和 Compose 端通过事件进行通信
  • 添加了新钩子:useImmutableList
  • 重构了 useRequest

hooks2:2.1.0-alpha0

Choose a tag to compare

@junerver junerver released this 11 Dec 10:52

NOTE: This project has been migrated to Kotlin Mutliplatform, and the artifact id uploaded to Maven central has been changed to hooks2

Please see the wiki for migration notes

  • upgrade kotlin -> 2.0.20
  • fix #25
  • optimization
  • migrate to KMP
  • breaking change:use State<T>to wrap the return value of hooks

注意:该项目已迁移到 Kotlin Mutliplatform,上传到 Maven central 的工件 ID 已更改为 hooks2

请参阅 wiki 了解迁移说明

  • 升级 kotlin -> 2.0.20
  • 修复 #25
  • 优化
  • 迁移到 KMP
  • 重大更改:使用 State<T> 包装 hooks 的返回值