Repository navigation
v1.1.0 - Modern EventEmitter & Thread-Safe Operations
🎉 What's New in v1.1.0
This release brings significant improvements to @pushpendersingh/react-native-otp-verify, focusing on modernizing event handling, adding thread-safety, and improving overall reliability and debuggability.
✨ Key Features
1. Modern Event Handling Pattern
- Migrated to TurboModule's native EventEmitter - Moved from legacy
NativeEventEmittertoCodegenTypes.EventEmitter<SmsMessage> - Better Performance - Reduced overhead in event emission path
- Type-Safe Events - Full TypeScript support with proper type definitions
- Improved Reliability - Better integration with React Native's new architecture
2. Thread-Safe Receiver Management
- ReentrantLock - Thread-safe receiver registration/unregistration
- AtomicBoolean - Concurrent-safe state tracking
- @volatile Annotations - Cross-thread visibility guarantees
- Race Condition Prevention - Eliminates potential concurrency issues
3. Enhanced Logging & Debugging
- Comprehensive Debug Logs - Track SMS receiver operations
- Warning Logs - Identify edge cases and potential issues
- Error Logs with Stack Traces - Easier troubleshooting and debugging
- Better Developer Experience - More visibility into what's happening
4. Code Quality Improvements
- KDoc Comments - Comprehensive inline documentation
- Better Error Handling - Graceful handling of edge cases
- Cleaner Dependencies - Removed unnecessary dependencies
- Improved Code Organization - More maintainable codebase
🐛 Bug Fixes
- Fixed potential race conditions in receiver registration/unregistration
- Improved cleanup in error scenarios
- Better handling of already-registered receivers
- Proper thread synchronization for concurrent operations
📈 Performance Improvements
- Reduced event emission overhead
- More efficient thread-safe operations
- Better memory management with proper cleanup
- Reduced risk of memory leaks from unregistered receivers
🔄 Breaking Changes
None! This is a fully backward-compatible update. All existing code continues to work without any modifications required.
📦 Installation
npm install @pushpendersingh/react-native-otp-verify@1.1.0or
yarn add @pushpendersingh/react-native-otp-verify@1.1.0🚀 Migration Guide
No migration needed! Your existing code will work as-is:
import { addSmsListener, startSmsRetriever } from '@pushpendersingh/react-native-otp-verify';
// This code works exactly the same, but now with better performance
const subscription = addSmsListener((message) => {
console.log('SMS received:', message);
});
await startSmsRetriever();📋 What's Changed
Native Module (Kotlin)
- Enhanced
ReactNativeOtpVerifyModule.ktwith thread-safe operations - Added comprehensive logging throughout
- Migrated to modern event emission pattern
- Improved error handling and cleanup
TypeScript/JavaScript
- Updated
NativeReactNativeOtpVerify.tswith new EventEmitter spec - Simplified
index.tsxby removing manual event emitter - Added proper type exports for
SmsMessage
Documentation
- Updated README.md with new features
- Added comprehensive CHANGELOG.md
- Improved inline code documentation
🔗 Full Changelog
See CHANGELOG.md for detailed technical changes.
📚 Documentation
🙏 Credits
Special thanks to the React Native community and everyone using this library!
📄 License
MIT © Pushpender Singh
⚡ Quick Links
What's Changed
- feat: migrate to modern EventEmitter and add thread-safe operations by @pushpender-singh-ap in #2
New Contributors
- @pushpender-singh-ap made their first contribution in #2
Full Changelog: 1.0.0...1.1.0