Releases: JiangJie/happy-rusty
Releases · JiangJie/happy-rusty
v1.9.2
[1.9.2] - 2026-04-12
Changed
- Performance: Added
/*#__PURE__*/annotations to all top-level function call expressions for better tree-shaking support in consumer bundlers
Fixed
- Build: Migrated
treeshakeconfig from deprecated'smallest'string to object form for Vite 8 (Rolldown) compatibility - Build: Added
topLevelVar: falseto output options to preserveconstdeclarations in bundled output
Chores
- Upgraded devDependencies: vite, vitest, eslint, typedoc, typescript-eslint
Full Changelog: v1.9.1...v1.9.2
v1.9.1
[1.9.1] - 2026-01-16
Changed
- Performance:
Channelbuffer replacedArraywithQueuefor O(1) shift operations
Documentation
- Added
@sincetags to all public APIs - Improved JSDoc consistency and formatting
CI
- Changed JSR publish to trigger on release instead of push to main
Full Changelog: v1.9.0...v1.9.1
v1.9.0
[1.9.0] - 2026-01-04
Added
- Try Extensions for Result:
andTryAsync<U>- LikeandThenAsync, but auto-catches exceptions/Promise rejections and converts them toErrorTryAsync<F>- LikeorElseAsync, but auto-catches exceptions in recovery logic
Changed
- Performance:
map()andmapErr()now returnthiswhen the Result variant doesn't match, avoiding unnecessary object creation
Removed
promiseToAsyncResult()- UsetryAsyncResult()instead (deprecated since v1.7.0)
Full Changelog: v1.8.0...v1.9.0
v1.8.0
[1.8.0] - 2025-12-31
Added
- New Sync Primitives:
OnceAsync<T>- Async-first one-time initialization with concurrent call handlingRwLock<T>- Async read-write lock (multiple concurrent readers or single writer)Channel<T>- MPMC (multi-producer multi-consumer) async message passing with optional bounded capacity
- New Function Types:
FnOnce<A, R>- One-time callable sync function wrapperFnOnceAsync<A, R>- One-time callable async function wrapper
- New Methods:
Option.reduce()- Rust API alignment for reducing Option to its contained valueResult.intoOk()/Result.intoErr()- Infallible extraction forResult<T, never>andResult<never, E>ControlFlow.intoValue()- Extract value when both branches have the same typeOnce.tryInsert()/Once.waitAsync()- Additional initialization controlMutex.get()/Mutex.set()/Mutex.replace()- Convenience methods
- New Type Aliases:
SafeResult<T>-Result<T, never>for operations that cannot failAsyncSafeResult<T>- Async version of SafeResult
- Iterator Protocol -
OptionandResultnow implementSymbol.iteratorforfor...ofloops:for (const value of Some(42)) { console.log(value); } // 42 for (const value of None) { /* never executes */ }
- Rust Documentation Links - All Rust-equivalent interfaces now link to official Rust docs via
@seetags
Changed
- Module Reorganization - Source code restructured into
core/(Option, Result) andstd/(sync, ops) directories, mirroring Rust's stdlib organization - Async Callback Types - All async methods now accept
PromiseLike<T> | Tinstead of justPromise<T>, allowing mixed sync/async callbacks - Async Return Types - Use
Awaited<T>to properly flatten nested Promises in async method return types - Internal Optimizations - Cached Promise constants (
ASYNC_NONE, etc.) for better runtime performance
Fixed
thisbinding issue inOnce.getOrTryInitAsync- Nested Promise flattening in async methods
Full Changelog: v1.7.1...v1.8.0
v1.7.1
[1.7.1] - 2025-12-26
Added
- Argument passing - All
try*functions now support passing arguments likePromise.try:tryOption(JSON.parse, jsonString)instead oftryOption(() => JSON.parse(jsonString))tryResult(decodeURIComponent, str)instead oftryResult(() => decodeURIComponent(str))
- Unified sync/async returns -
tryAsyncOptionandtryAsyncResultnow accept functions that returnT | PromiseLike<T>, allowing mixed sync/async logic
Full Changelog: v1.7.0...v1.7.1
v1.7.0
[1.7.0] - 2025-12-26
Added
tryOption()- Capture synchronous exceptions as Option (success → Some, exception → None)tryAsyncOption()- Capture async/Promise exceptions as OptiontryResult()- Capture synchronous exceptions as Result (success → Ok, exception → Err)tryAsyncResult()- Capture async/Promise exceptions as Result
Deprecated
promiseToAsyncResult()- UsetryAsyncResult()instead (same functionality, more consistent naming)
Full Changelog: v1.6.2...v1.7.0
v1.6.2
[1.6.2] - 2025-12-25
Changed
promiseToAsyncResultnow acceptsPromiseLike<T>instead ofPromise<T>for broader compatibility with thenable objects- Use
AsyncResulttype alias in function signatures for consistency
Removed
- Removed unused
sourcefield from package.json (Parcel legacy) - Removed redundant
@internaltags from private (non-exported) functions
Full Changelog: v1.6.1...v1.6.2
v1.6.1
[1.6.1] - 2025-12-19
Changed
- License changed from GPL-3.0 to MIT for broader adoption and easier integration
Added
- Navigation links (GitHub, npm, JSR) in TypeDoc documentation header
Full Changelog: v1.6.0...v1.6.1
v1.6.0
[1.6.0] - 2025-12-18
Added
- Sync Primitives:
Once<T>,Lazy<T>,LazyAsync<T>,Mutex<T>for Rust-style synchronization - Control Flow:
ControlFlow<B, C>withBreakandContinuevariants Symbol.toStringTagproperty to all types for better type identification- Custom
toString()method to all types for debugging isControlFlow()type guard utilityisNoneOr()andisNoneOrAsync()methods for Optionexportsfield in package.json for modern Node.js module resolution- GitHub Pages workflow for automatic API documentation deployment
- Immutability tests to verify
Object.freeze()is working correctly - 100% test coverage
- CHANGELOG.md with full version history
Changed
- All instances are now frozen with
Object.freeze()for runtime immutability - TypeDoc output format from Markdown to HTML for GitHub Pages compatibility
- Migrated from Deno test to Vitest
- Build process split into Vite (JS) and Rollup (dts)
Fixed
- Symbol property syntax and duplicate declaration issues
- Type inference improvements for
Noneinterface methods
Full Changelog: v1.5.0...v1.6.0
v1.5.0
Full Changelog: v1.4.0...v1.5.0