Skip to content

Releases: intuit/hooks

v0.15.0

02 Jun 22:05
Compare
Choose a tag to compare

🎉 This release contains work from a new contributor! 🎉

Thank you, null@brocollie08, for all your work!

Release Notes

BailHook default handler (#33)

Allows for SyncBailHook to call with a default handler for when the taps do not bail and return nothing


🚀 Enhancement

Authors: 1

v0.14.1

06 Dec 00:09
Compare
Choose a tag to compare

⚠️ Pushed to main

Authors: 1

v0.14.0

05 Dec 23:34
Compare
Choose a tag to compare

Release Notes

make tap info mutable (#31)

Add data class APIs to TapInfo such that it can be mutated.

scope version properties to avoid conflicts (#30)

Scope metadata b/c it was conflicting w/ another Gradle plugin


🚀 Enhancement

🐛 Bug Fix

Authors: 1

v0.13.0

09 Jul 02:32
Compare
Choose a tag to compare

Release Notes

New Hooks DSL (#29)

💥 Breaking Change 💥

Relax typing specification when using the DSL. Hooks should always use the Hook superclass as the specified type and rely solely on the annotation to specify the actual constraints of the hook:

abstract class CarHooks : Hooks() {
    @Sync<() -> Unit>
    abstract val brake: Hook
    
    @Sync<(newSpeed: Int) -> Unit>
    abstract val accelerate: Hook
}

🚀 Enhancement

Authors: 1

v0.12.1

09 Jul 01:52
Compare
Choose a tag to compare

🐛 Bug Fix

Authors: 2

v0.12.0

23 Jun 00:19
Compare
Choose a tag to compare

Release Notes

Migrate from Arrow Meta to Kotlin Symbol Processor (#24)

💥 This is a breaking change 💥

Migration to KSP from Arrow Meta because they dropped support for source generation. This does improve the overall maturity of the codegen module (compiler-plugin -> processor). However, the KSP framework doesn't support the code typing introspection that we were doing in Arrow Meta. Instead, we have to rely strictly on typings and annotations, which changes the DSL we originally had.

internal abstract class GenericHooks : Hooks() {
    @Sync<(newSpeed: Int) -> Unit> abstract val sync: SyncHook<*>
    @SyncBail<(Boolean) -> BailResult<Int>> abstract val syncBail: SyncBailHook<*, *>
    @SyncLoop<(foo: Boolean) -> LoopResult> abstract val syncLoop: SyncLoopHook<*, *>
    @SyncWaterfall<(name: String) -> String> abstract val syncWaterfall: SyncWaterfallHook<*, *>
    @AsyncParallelBail<suspend (String) -> BailResult<String>> abstract val asyncParallelBail: AsyncParallelBailHook<*, *>
    @AsyncParallel<suspend (String) -> Int> abstract val asyncParallel: AsyncParallelHook<*>
    @AsyncSeries<suspend (String) -> Int> abstract val asyncSeries: AsyncSeriesHook<*>
    @AsyncSeriesBail<suspend (String) -> BailResult<String>> abstract val asyncSeriesBail: AsyncSeriesBailHook<*, *>
    @AsyncSeriesLoop<suspend (String) -> LoopResult> abstract val asyncSeriesLoop: AsyncSeriesLoopHook<*, *>
    @AsyncSeriesWaterfall<suspend (String) -> String> abstract val asyncSeriesWaterfall: AsyncSeriesWaterfallHook<*, *>
}

🚀 Enhancement

  • Migrate from Arrow Meta to Kotlin Symbol Processor #24 (@sugarmanz)

⚠️ Pushed to main

Authors: 1

v0.11.1

03 Nov 19:50
Compare
Choose a tag to compare

Release Notes

Add explicit visibility to satisfy Kotlin explicit API check (#20)

Generated source code will adhere to Kotlin explicit API check if hooks are public.


🐛 Bug Fix

  • Add explicit visibility to satisfy Kotlin explicit API check #20 (@sugarmanz)

Authors: 1

v0.11.0

27 Oct 02:47
Compare
Choose a tag to compare

Release Notes

Untap support & various fixes (#19)

Small fixes

  • Fix Gradle generation params
  • Modify async hook strategy to not take a scope, as this is already required to call the suspend method
  • Fix AsyncParallelHook to actually suspend properly until all callbacks complete
  • Replace mutable list containing TapInfo with a mutable var containing an immutable list (this fixes an issue when tapping a hook that is currently being called: ConcurrentModificationException)

Untapping

In order to allow calling sites to unregister stale callbacks and prevent memory leaks, the tap API now returns a String representing the ID of the specific "tap". The ID can then be passed into the new untap API to remove the callback from the hook. This ID can be randomly generated or manually passed when tapping a hook. Manually passing an ID is useful for when the tapper wants to replace a stale callback without calling needing to untap explicitly.


🚀 Enhancement

Authors: 1

0.10.4-next.2

27 Oct 02:35
Compare
Choose a tag to compare
0.10.4-next.2 Pre-release
Pre-release

⚠️ Pushed to next

Authors: 1

0.10.4-next.1

27 Oct 01:44
Compare
Choose a tag to compare
0.10.4-next.1 Pre-release
Pre-release

⚠️ Pushed to next

  • migrate interceptors to immutable lists and enhance id strategy (@sugarmanz)
  • better async parallel hook (@sugarmanz)

Authors: 1