Skip to content

fix: export Buffer from react-native-quick-crypto#899

Merged
boorad merged 8 commits intomainfrom
fix/896-buffer-import
Feb 1, 2026
Merged

fix: export Buffer from react-native-quick-crypto#899
boorad merged 8 commits intomainfrom
fix/896-buffer-import

Conversation

@boorad
Copy link
Copy Markdown
Collaborator

@boorad boorad commented Feb 1, 2026

Summary

Allows users to import Buffer directly from react-native-quick-crypto instead of requiring a separate import from @craftzdog/react-native-buffer. This ensures a single Buffer instance across the app, avoiding instanceof Buffer issues across module boundaries.

Changes

  • Library: Export Buffer from @craftzdog/react-native-buffer in the main entry point
  • Example app: Update all 23 test/benchmark files to import Buffer from react-native-quick-crypto
  • Example app: Remove direct @craftzdog/react-native-buffer dependency (now provided transitively)
  • Documentation: Update README and docs to recommend react-native-quick-crypto as the buffer alias
  • Tooling: Add /review and /pr slash commands for Claude Code

Testing

  • bun tsc passes for both library and example app
  • All existing tests continue to work (they now use the new import pattern)

Fixes #896

Resolves #896

The example app was importing Buffer directly from @craftzdog/react-native-buffer,
which caused instanceof Buffer checks to fail across module boundaries in React Native
since bun installs separate instances of the Buffer package.

Changes:
- Export Buffer from react-native-quick-crypto's index.ts
- Update all 23 example app test files to import Buffer from react-native-quick-crypto
- Merge Buffer imports into existing rnqc imports where applicable
- Remove @craftzdog/react-native-buffer from example app dependencies
- /review: Add check for fresh context/session to avoid self-review bias
- /pr: Add step to check for related issues and include Fixes/Closes references
Update documentation to recommend using 'react-native-quick-crypto' as the
buffer alias instead of '@craftzdog/react-native-buffer' directly. This
ensures a single Buffer instance across the app, avoiding instanceof
check failures across module boundaries.

The library re-exports Buffer from @craftzdog/react-native-buffer, so
both options work, but using the library directly is now preferred.
@boorad boorad self-assigned this Feb 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 1, 2026

🤖 End-to-End Test Results - Android

Status: ✅ Passed
Platform: Android
Run: 21568683402

📸 Final Test Screenshot

Maestro Test Results - android

Screenshot automatically captured from End-to-End tests and will expire in 30 days


This comment is automatically updated on each test run.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 1, 2026

🤖 End-to-End Test Results - iOS

Status: ✅ Passed
Platform: iOS
Run: 21568683413

📸 Final Test Screenshot

Maestro Test Results - ios

Screenshot automatically captured from End-to-End tests and will expire in 30 days


This comment is automatically updated on each test run.

Cache should restore the last CI build state so incremental builds
can apply changes. Using hashFiles() in cache keys causes misses
when files change, defeating the purpose of incremental builds.

- iOS: Remove hashFiles from Pods and DerivedData cache keys
- Android: Remove hashFiles from Gradle cache key
- Use separate restore/save for Pods cache (was using combined action)
@boorad boorad force-pushed the fix/896-buffer-import branch from 2afd75f to a87de82 Compare February 1, 2026 18:58
The Pods cache references paths in ios/libsodium-stable and deps
(OpenSSL.xcframework) that are downloaded during pod install.
Without caching these, restored Pods have broken references.
@boorad boorad merged commit 08104ea into main Feb 1, 2026
5 checks passed
@boorad boorad deleted the fix/896-buffer-import branch February 1, 2026 19:36
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.

Example app should use Buffer from react-native-quick-crypto

1 participant