π·οΈ KompKit v0.4.0-alpha.0
π Overview
Fourth alpha release of KompKit, adding two new cross-platform utilities β clamp and throttle β across all three platforms (Web/TypeScript, Android/Kotlin, Flutter/Dart), alongside a formatCurrency default currency fix, comprehensive documentation expansion with real-world examples, and full version alignment.
π§© Highlights
-
New utility:
clamp- Constrains a number within an inclusive
[min, max]range - Pure, synchronous, zero dependencies on all platforms
- Throws
RangeErroronNaN,Infinity, ormin > max - Identical API across TypeScript, Kotlin, and Dart
- Constrains a number within an inclusive
-
New utility:
throttle- Limits a function to execute at most once per wait period
- First call executes immediately; subsequent calls within the cooldown are ignored
- Returns a
Throttled<T>object withcancel()β mirrors theDebounced<T>shape - TypeScript:
throttle(fn, wait)returningT & { cancel(): void } - Kotlin: requires
CoroutineScope(same pattern asdebounce);waitin milliseconds - Dart:
waitis aDuration(idiomatic); returnsThrottled<T>withcancel() - Validates
wait > 0on all platforms β throws on invalid input
-
formatCurrencydefault currency fix (breaking)- Default changed from
EURβUSDto align with the existingen-USdefault locale - Affects all three platforms
- Pass
currency: "EUR"explicitly to restore previous behavior
- Default changed from
-
Documentation expansion
- All platform docs (web.md, android.md, flutter.md) expanded with real-world examples for
clampandthrottle - React
useEffect+useRefthrottle cleanup pattern added - Vue
onUnmountedthrottle cleanup pattern added - Jetpack Compose
LaunchedEffectthrottle scroll tracking example added - Flutter
StatefulWidgetwithinitState/disposelifecycle forthrottleanddebounce - Complete Flutter app example updated to demonstrate all 5 utilities
- recipes.md: new cross-platform "throttled scroll header with clamped opacity" recipe
- packages/core/web/README.md: expanded
clampandthrottlesections - README.md: Quick Start updated to show all 5 utilities across all platforms
- All platform docs (web.md, android.md, flutter.md) expanded with real-world examples for
π§ Technical Notes
- Node version: 20.x
- Java version: 17 (Temurin)
- Kotlin: 2.3.0
- TypeScript: 5.7+
- Flutter: 3.27.4 (stable)
- Dart SDK: >=3.0.0 <4.0.0
- Gradle: 8.5 via
setup-gradleaction
π§ͺ Validation
- β Web build/tests pass β 43/43 (Vitest, tsup)
- β Android build/tests pass β BUILD SUCCESSFUL (Kotlin 2.3.0, JUnit4)
- β Flutter build/tests pass β 50/50 (flutter_test, intl 0.20.2)
- β
CI workflows verified on
develop - β Documentation consistent across all platforms
- β
developandreleasebranches in sync atv0.4.0-alpha.0
β οΈ Breaking Changes
| Area | Change | Migration |
|---|---|---|
formatCurrency default currency |
EUR β USD |
Pass currency: "EUR" explicitly if needed |
throttle Kotlin |
Requires CoroutineScope parameter |
Pass active scope: throttle<T>(wait, scope) { ... } |
throttle Dart |
wait is Duration, not a number |
Use const Duration(milliseconds: 200) |
π§± Known Limitations (Alpha)
- Android module not yet published to Maven Central
- Dokka V1 deprecation warning (V2 migration planned)
- TypeScript/V8 silently falls back on unrecognized locale strings (documented platform divergence)
- Kotlin/JVM silently falls back on unrecognized locale strings (documented platform divergence)
π§© Changelog
[v0.4.0-alpha.0] β 2026-03-01
Added
clamp(value, min, max)utility on all platforms (TypeScript, Kotlin, Dart)throttle(fn, wait)utility on all platforms withcancel()supportThrottled<T>type/class on all platforms mirroringDebounced<T>shape- Real-world usage examples for
clampandthrottlein all platform docs - React
useRef+useEffectthrottle cleanup pattern in web.md - Vue
onUnmountedthrottle cleanup pattern in web.md - Jetpack Compose throttled scroll tracker example in android.md
- Flutter
StatefulWidgetthrottle + dispose example in flutter.md - Cross-platform "throttled scroll header with clamped opacity" recipe in recipes.md
throttleandclampentries in ARCHITECTURE.md API parity contractthrottleandclampFAQ entries in faq.mdthrottlerows in Platform Differences table in README.md
Changed
formatCurrencydefault currency:EURβUSDon all platforms- README.md Quick Start expanded to show all 5 utilities
docs/CHANGELOG.mdand packages/core/flutter/CHANGELOG.md updated- docs/roadmap.md updated β
0.4.0-alpha.0is now current state - SECURITY.md supported versions table updated
- Version bumped to
0.4.0-alpha.0inlerna.json,package.json,pubspec.yaml, and all docs
Fixed
developbranch synced withrelease(was 1 commit behind after merge commit)- Remote URL corrected to lowercase (
Kompkit/kompkit) - Stale Flutter version reference (
3.24.0β3.27.4) in README_CI.md - Wrong
formatCurrencyoutput ("1.234,56 β¬") in README.md Quick Start examples