Skip to content

Conversation

@pushpender-singh-ap
Copy link
Owner

📱 React Native Scanner v1.6.0-beta.1

🎯 Overview

This PR introduces a complete implementation of @pushpendersingh/react-native-scanner, a powerful QR code & Barcode scanner for React Native with full New Architecture support (Turbo Modules & Fabric).


✨ Key Features

🏗️ New Architecture Ready

  • ✅ Built with Turbo Modules for native module communication
  • ✅ Fabric Native Components for rendering
  • ✅ Fully compatible with React Native 0.81+

📷 Scanner Capabilities

  • ✅ Real-time camera preview
  • ✅ Support for 13+ barcode formats (QR, EAN, Code128, UPC, etc.)
  • ✅ Flashlight toggle for low-light scanning
  • ✅ Event-based scan result handling
  • ✅ Automatic lifecycle management

🔧 Platform-Specific Implementation

  • Android: CameraX + ML Kit Barcode Scanning
  • iOS: AVFoundation + Vision Framework
  • Native bridges written in Kotlin (Android) and Swift/Objective-C++ (iOS)

📦 Project Structure

  • ✅ Complete TypeScript source code
  • ✅ Native Android module with CameraX
  • ✅ Native iOS module with AVFoundation
  • ✅ Comprehensive example app
  • ✅ Full test suite
  • ✅ CI/CD with GitHub Actions

📋 Changes Made

Source Code (src/)

  • CameraView.tsx - React component for camera preview
  • NativeReactNativeScanner.ts - Native module interface
  • ReactNativeScannerViewNativeComponent.ts - Fabric component spec
  • index.tsx - Main package export
  • __tests__/ - Unit tests

Android Implementation (android/)

  • CameraManager.kt - Camera lifecycle and configuration
  • ReactNativeScannerView.kt - Camera preview view
  • ReactNativeScannerViewManager.kt - View manager for Fabric
  • ReactNativeScannerModule.kt - Turbo module implementation
  • ReactNativeScannerPackage.kt - Package registration
  • Gradle build configuration

iOS Implementation (ios/)

  • CameraView.swift - Camera view implementation
  • CameraManager.swift - Camera session management
  • CameraViewManager.mm - Objective-C++ view manager
  • ReactNativeScanner.mm - Turbo module implementation
  • ReactNativeScanner.h - Public header
  • ReactNativeScanner-Bridging-Header.h - Swift bridge
  • Podspec configuration

Example Application (example/)

  • Complete React Native app demonstrating scanner usage
  • iOS and Android configurations
  • Platform-specific build setups

CI/CD & Workflows (.github/workflows/)

  • ci.yml - Continuous integration pipeline
  • check-repro.yml - Issue reproduction checker
  • semantic-pr.yml - PR title validation
  • stale.yml - Stale issue management
  • triage.yaml - Issue triage automation
  • versions.yml - Version compatibility checks

Configuration Files

  • .editorconfig - Code editor configuration
  • .gitignore - Git ignore rules
  • .nvmrc - Node version specification
  • .yarnrc.yml - Yarn 3 configuration
  • babel.config.js - Babel configuration
  • eslint.config.mjs - ESLint configuration
  • tsconfig.json - TypeScript configuration
  • turbo.json - Turborepo configuration
  • lefthook.yml - Git hooks configuration

Documentation

  • README.md - Comprehensive usage guide
  • CONTRIBUTING.md - Contribution guidelines
  • CODE_OF_CONDUCT.md - Community guidelines
  • LICENSE - MIT License
  • Issue templates for bugs, features, and questions

🔢 Statistics

  • Files Added: 100+
  • Languages: TypeScript, Kotlin, Swift, Objective-C++
  • Platforms: iOS & Android
  • React Native Version: 0.81+
  • Node Version: 20.19.0

🚀 Type of Change

  • ✨ New feature (non-breaking change that adds functionality)
  • 📦 New package version release
  • 🏗️ New Architecture implementation
  • 🐛 Bug fix
  • 💥 Breaking change

✅ Testing Checklist

  • TypeScript compilation passes
  • ESLint checks pass
  • Unit tests included
  • Example app runs on Android
  • Example app runs on iOS
  • Scanner detects QR codes successfully
  • Scanner detects barcodes successfully
  • Flashlight toggle works correctly
  • Camera permissions handled properly

📱 Platform Support

Platform Version Status
Android 5.0+ ✅ Supported
iOS 13.0+ ✅ Supported
React Native 0.81+ ✅ Supported

🔗 Dependencies

Runtime Dependencies

  • React Native 0.81+
  • React 19.1.0+

Native Dependencies

  • Android: CameraX, ML Kit Barcode Scanning
  • iOS: AVFoundation, Vision Framework

📖 Documentation

Complete documentation includes:

  • Installation instructions
  • Usage examples
  • API reference
  • Platform-specific setup
  • Troubleshooting guide
  • Contribution guidelines

🎨 Code Quality

  • ✅ TypeScript with strict mode
  • ✅ ESLint configuration
  • ✅ Prettier formatting
  • ✅ Lefthook git hooks
  • ✅ Commitlint for conventional commits
  • ✅ CI/CD pipelines configured

Add complete implementation of @pushpendersingh/react-native-scanner package with:
- New Architecture support (Turbo Modules & Fabric)
- Cross-platform QR & Barcode scanner for iOS and Android
- CameraX integration for Android
- AVFoundation integration for iOS
- Support for 13+ barcode formats
- Flashlight toggle feature
- Real-time camera preview
- Example app with full implementation
- CI/CD workflows and GitHub Actions
- Comprehensive documentation and setup guides
Copilot AI review requested due to automatic review settings September 30, 2025 16:55
@pushpender-singh-ap pushpender-singh-ap self-assigned this Sep 30, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a complete implementation of @pushpendersingh/react-native-scanner v1.6.0-beta.1, a QR code and barcode scanner library for React Native with full New Architecture support (Turbo Modules & Fabric).

  • Comprehensive implementation with 13+ barcode format support using CameraX (Android) and AVFoundation (iOS)
  • Complete project structure including TypeScript source, native implementations, example app, tests, and CI/CD workflows
  • New Architecture ready with Turbo Module and Fabric component specifications

Reviewed Changes

Copilot reviewed 84 out of 105 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/ TypeScript implementation with camera view component and native module interfaces
ios/ Swift/Objective-C++ native implementation using AVFoundation and Vision frameworks
android/ Kotlin native implementation using CameraX and ML Kit for barcode scanning
example/ Complete React Native example application demonstrating scanner usage
package.json Package configuration with React Native 0.81+ support and New Architecture setup
.github/ CI/CD workflows for testing, building, and maintaining the project
Files not reviewed (1)
  • example/ios/ReactNativeScannerExample.xcworkspace/contents.xcworkspacedata: Language not supported
Comments suppressed due to low confidence (1)

android/src/main/java/com/pushpendersingh/reactnativescanner/CameraManager.kt:1

  • [nitpick] Debug logging statements should be removed or use proper logging levels. Consider using Android's Log class with appropriate log levels instead of print statements.
package com.pushpendersingh.reactnativescanner

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- Add comprehensive permission handling section to README
- Recommend react-native-permissions for production apps
- Document built-in method limitations
- Add Known Limitations section
- Add Roadmap with planned enhancements
- Update inline code comments in ReactNativeScannerModule.kt

This addresses reviewer feedback about incomplete permission implementation
while providing users with industry-standard alternatives.

Ref: #51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 84 out of 105 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • example/ios/ReactNativeScannerExample.xcworkspace/contents.xcworkspacedata: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- Add global type declaration for __turboModuleProxy
- Fix event listener callback type mismatch in BarcodeScanner
- Remove unused React import from example app
- Suppress exhaustive-deps ESLint warning

The library was working correctly but TypeScript strict mode was
preventing successful builds with react-native-builder-bob.
@pushpender-singh-ap pushpender-singh-ap merged commit e83df9d into main Sep 30, 2025
5 of 6 checks passed
@pushpender-singh-ap pushpender-singh-ap deleted the feat/react-native-scanner-v1.6-beta branch September 30, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant