feat: React Native New Architecture (Bridgeless) support v8.0.0-rc.1#343
Open
feat: React Native New Architecture (Bridgeless) support v8.0.0-rc.1#343
Conversation
156c118 to
96f8f02
Compare
- Update version to 8.0.0-rc.1 - Update peer dependencies: RN >= 0.70.0, React >= 18.0.0 - Add playground/ to .npmignore - Update description for New Architecture
- Add TypeScript spec for Codegen (specs/NativeZipArchive.ts) - Migrate iOS from RCTBridgeModule to TurboModule protocol - Migrate Android from ReactContextBaseJavaModule to NativeZipArchiveSpec - Update JS entry point to use TurboModuleRegistry with Legacy fallback - Update podspec to include .mm files
- Add complete Expo playground with expo-dev-client - Include 7 demo screens for all library features - Add Jest test suite with 27 passing tests - Add TurboModule integration tests - Configure Metro for local module linking
- Rewrite README with New Architecture focus - Add MIGRATION.md with step-by-step guide - Add CHANGELOG.md with v8.0.0 release notes - Document Expo Development Build requirements - Preserve all existing API documentation
- Explain why Expo Go is not supported - Add step-by-step Development Build setup - Include comparison table for clarity - Link to playground example
- iOS: Extend RCTEventEmitter to support progress events (critical fix) - Podspec: Add install_modules_dependencies for modern RN support - index.d.ts: Fix unzipWithPassword parameter name - Android: Remove outdated AGP buildscript block - CHANGELOG: Update release date - .npmignore: Exclude dev files from npm package - Mock: Remove non-existent native method from mock
…layground This commit migrates react-native-zip-archive to support React Native 0.76 New Architecture (Fabric + TurboModules) with Bridgeless mode enabled. Library changes: - iOS: add RCT_EXPORT_MODULE() and getTurboModule: returning NativeZipArchiveSpecJSI for Bridgeless registration - iOS: fix podspec install_modules_dependencies check and flatten subspec - Android: add conditional com.facebook.react plugin and codegen sourceSets when newArchEnabled=true - Android: add Paper (Old Architecture) fallback spec - Android: fix illegal switch-on-double in getCompressionLevel() - JS: implement lazy TurboModule loading to avoid Bridgeless init crash - JS: update unit tests for lazy loading behavior Playground (new Expo 52 app): - Create Expo dev-client playground with expo-router - Enable newArchEnabled in app.json - Add demo screens: zip, unzip, password, progress, benchmarks, assets - Fix nested file creation (ensureDir before writeAsStringAsync) - Add expo-linking explicitly (pnpm transitive dep fix) - Add accessibilityLabel for E2E automation E2E testing: - Add Maestro flows for iOS and Android - Handle iOS dev-client launcher (tap Metro URL) - Handle Android cold-start with 45s timeout - Add npm scripts: test:e2e, test:e2e:android, test:e2e:ios - Add shell scripts for sequential test execution Documentation: - Add e2e/README.md with Maestro setup instructions
- iOS: call [super addListener:] / [super removeListeners:] to preserve RCTEventEmitter lifecycle (startObserving/stopObserving) for progress events - Android: add missing return after promise.reject in unzipWithPassword and zipWithPassword to prevent double-resolve / NullPointerException - Android: use TurboReactPackage instead of BaseReactPackage for RN 0.70+ backward compatibility - README: fix broken Buy Me A Coffee markdown link
- Android unzipWithPassword: resolve with destDirectory string instead of WritableArray to match TurboModule spec (Promise<string>) and iOS behavior - Android processZip: add missing return after promise.reject when file doesn't exist, preventing double promise settlement - Android processZip: move updateProgress(100%) outside the for loop so it fires once after all entries are processed, not on every iteration
Devin review noted that early RN 0.70.x releases require a 7-arg ReactModuleInfo constructor including hasConstants. Adding the 7th arg maintains backward compatibility with >= 0.70.0 peer dep.
96f8f02 to
283bb74
Compare
- Fix encryption method default inconsistency: empty string now defaults to non-AES (ZIP_STANDARD) on iOS, matching Android behavior. - Add RCT_NEW_ARCH_ENABLED guards for old architecture compatibility: conditionally import NativeZipArchiveSpec header and conform to the protocol only when New Architecture is enabled, matching the Android paper shim pattern. Refs: Devin review comments #3193190132, #3193190251
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates to support React Native 0.76 New Architecture (Fabric + TurboModules) with Bridgeless mode enabled.
Library Changes
iOS:
Android:
JS:
Playground (New Expo 52 App)
E2E Testing
Test Results
Breaking Changes
Requires React Native >= 0.70.0. New Architecture is opt-in (enabled via in consuming app).
Version