Skip to content

Conversation

@mCodex
Copy link
Owner

@mCodex mCodex commented Oct 27, 2025

No description provided.

Introduces a comprehensive React hooks API for secure storage, including new hooks in src/hooks.ts, shared utilities in src/hook-utils.ts, and error helpers in src/errors.ts. Updates the README with documentation and usage examples for the new hooks, adds a detailed HOOKS.md, and refactors the example app to use the new hooks-based API. Also updates ESLint config for improved compatibility and disables the 'import/extensions' rule.
Replaces Bun with Yarn for dependency management and scripts in Android, iOS, and release GitHub Actions workflows. Updates lockfile and Xcode project to reflect new dependency versions and NitroModules upgrade.
Changed the TypeScript compiler option 'noEmit' from false to true to prevent emitting output files during compilation. This is useful for type-checking only workflows.
Replaces legacy hooks implementation with modular, strongly-typed hooks in the src/hooks directory. Introduces a new core storage API in src/core/storage.ts and updates usage in example/App.tsx. Removes deprecated files and reorganizes internal modules for better maintainability. Adds babel-plugin-react-compiler to dev dependencies.
Copilot AI review requested due to automatic review settings October 27, 2025 15:59
Copy link
Contributor

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 comprehensive React hooks API for react-native-sensitive-info, providing a modern, reactive interface with automatic memory management, loading states, and error handling. The implementation refactors the existing imperative API into a modular architecture while maintaining backward compatibility.

Key changes:

  • Added six new React hooks (useSecretItem, useSecret, useHasSecret, useSecureStorage, useSecurityAvailability, useSecureOperation) with automatic cleanup and memory leak prevention
  • Refactored core storage logic into a modular structure separating internal utilities, native bridge, and public API
  • Migrated the example app from imperative API to hooks-based implementation

Reviewed Changes

Copilot reviewed 26 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/hooks/*.ts New hook implementations with lifecycle management and async state handling
src/internal/*.ts Extracted shared utilities for options normalization, native instance management, and error handling
src/core/storage.ts Refactored imperative API with cleaner structure and improved documentation
src/index.ts Updated main entry point to export both imperative API and hooks
example/App.tsx Converted example app to use new hooks API
docs/HOOKS.md Comprehensive documentation for the hooks API
package.json Added React Compiler plugin
babel.config.js Enabled React Compiler plugin
*.yml Migrated CI from Bun to Yarn

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mCodex mCodex self-assigned this Oct 27, 2025
@mCodex mCodex merged commit 9c82e81 into master Oct 27, 2025
4 of 5 checks passed
@mCodex mCodex deleted the feat/addHookSupport branch October 27, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants