Upgrade React Native 0.81.5 → 0.82.1#451
Conversation
- react-native: 0.81.5 → 0.82.1 - react: 19.1.0 → 19.1.1 - @react-native/* packages: 0.81.5 → 0.82.1 - @react-native-community/cli*: 20.0.0 → 20.1.3 - react-android: 0.81.5 → 0.82.1 (library build.gradle) - Regenerated Android codegen for 0.82.1
- Rewrite iOS RCTTestRunner to use RCTReactNativeFactory (RCTBridge removed in 0.82) - Rewrite RCTTestModule with singleton pattern (no bridge.uiManager refs) - Add index.js entry points for proper RN initialization in test bundles - Fix implicit global assignments in test files (Hermes strict mode) - Track RCTTest/ source files (previously gitignored) - Update iosTests/androidTests to use local react-native-force
- Replace chai with lightweight assert module (chai modifies Object.prototype which fails in Hermes strict mode) - Use named function declarations for test registration - Bundle with --dev false --minify false (avoids DevTools bridge "property is not writable" error while preserving function names) Android test results: 17/24 pass (7 timeouts are flaky test data issues)
…Number, isNull, sameDeepMembers)
Without reset, the RCTTestModule singleton retained Passed status from the first test, causing all subsequent tests to exit immediately without actually executing. iOS results: 33/35 pass (2 SmartStore timeouts on getAllStores/getAllGlobalStores)
…cleanup - Fix sameDeepMembers to sort object keys before comparing (native returns keys in different order than JS creates them) - Add removeAllStores/removeAllGlobalStores cleanup at start of testGetRemoveStores/testGetRemoveGlobalStores (test isolation) - Fix iOS test runner to reset RCTTestModule status between tests iOS: 35/35 pass
…one.arm API 35 - Remove explicit gradle-version (uses project wrapper instead) - Update Firebase Test Lab device from Pixel2/API 33 to MediumPhone.arm/API 35 (matches Android SDK repo pattern)
| "react-native-force": "git+https://github.com/forcedotcom/SalesforceMobileSDK-ReactNative.git#dev" | ||
| "react": "19.1.1", | ||
| "react-native": "0.82.1", | ||
| "react-native-force": "file:.." |
There was a problem hiding this comment.
Yes — file:.. points to the parent directory (the root of this repo). This makes node_modules/react-native-force a copy of the local source, so tests run against the current code without needing to push to a remote branch first. After making changes to the bridge code, you re-run yarn install to update the copy. This is intentional for local development/CI — the "Before Merging" checklist includes reverting this to forcedotcom#dev before merge.
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. |
There was a problem hiding this comment.
Are these RCTTest files copied from somewhere? I assume they are test helpers?
There was a problem hiding this comment.
Correct — RCTTest/ was originally copied from React Native's internal test infrastructure (Libraries/RCTTest/). We've significantly rewritten it for RN 0.82+ bridgeless mode:
RCTTestRunner.mm— Rewrote from scratch to useRCTReactNativeFactory(the old version usedRCTBridgewhich was removed in RN 0.82)RCTTestModule.mm— Singleton pattern withresetStatusbetween tests (no more_bridge.uiManagerreferences)React-RCTTest.podspec— Updated dependencies for 0.82+RCTSnapshotNativeComponent.js,RCTTestPlugins.*,FBSnapshotTestCase/— Carried over from the original (snapshot testing support, not actively used but required by the podspec)
These files were previously gitignored and regenerated by prepareios.js, but since we customized them for bridgeless mode, they're now tracked in the repo.
brandonpage
left a comment
There was a problem hiding this comment.
Couple questions, but LGTM.
Summary
SalesforceReactActivityDelegatefor bridgeless mode (removeloadAppgating that caused black screen)RCTBridgeremoved → useRCTReactNativeFactory)--dev false --minify falseto avoid DevTools bridge crash while preserving function namesObject.prototypewhich fails in Hermes strict mode)Test Results
Before Merging
iosTests/package.jsonandandroidTests/package.jsonreact-native-force toforcedotcom#devTest Plan