Skip to content

Upgrade React Native 0.81.5 → 0.82.1#451

Merged
wmathurin merged 15 commits into
forcedotcom:devfrom
wmathurin:rn-upgrade-0.82
May 29, 2026
Merged

Upgrade React Native 0.81.5 → 0.82.1#451
wmathurin merged 15 commits into
forcedotcom:devfrom
wmathurin:rn-upgrade-0.82

Conversation

@wmathurin
Copy link
Copy Markdown
Contributor

@wmathurin wmathurin commented May 28, 2026

Summary

  • Upgrade React Native from 0.81.5 to 0.82.1 (New Architecture now mandatory, legacy arch removed)
  • Fix SalesforceReactActivityDelegate for bridgeless mode (remove loadApp gating that caused black screen)
  • Rewrite iOS test infrastructure for RN 0.82 (RCTBridge removed → use RCTReactNativeFactory)
  • Fix test bundle: use --dev false --minify false to avoid DevTools bridge crash while preserving function names
  • Replace chai with lightweight assert module (chai modifies Object.prototype which fails in Hermes strict mode)
  • Fix implicit global assignments in test files (Hermes strict mode requires declarations)

Test Results

  • iOS: 35/35 ✅
  • Android: 35/35 ✅
  • Template app: login + contacts load on both platforms ✅

Before Merging

  • Revert iosTests/package.json and androidTests/package.json react-native-force to forcedotcom#dev

Test Plan

  • All 4 RN templates build on iOS
  • All 4 RN templates build on Android
  • iOS tests pass (35/35)
  • Android tests pass (35/35)
  • Template app: login + contacts load on Android
  • Template app: login + contacts load on iOS

wmathurin added 8 commits May 27, 2026 12:41
- 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)
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)
Copy link
Copy Markdown
Contributor

@JohnsonEricAtSalesforce JohnsonEricAtSalesforce left a comment

Choose a reason for hiding this comment

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

👍🏻

Comment thread androidTests/package.json Outdated
"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:.."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@wmathurin Is file:.. correct?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines +2 to +5
* 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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are these RCTTest files copied from somewhere? I assume they are test helpers?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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 use RCTReactNativeFactory (the old version used RCTBridge which was removed in RN 0.82)
  • RCTTestModule.mm — Singleton pattern with resetStatus between tests (no more _bridge.uiManager references)
  • 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.

Copy link
Copy Markdown
Contributor

@brandonpage brandonpage left a comment

Choose a reason for hiding this comment

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

Couple questions, but LGTM.

@wmathurin wmathurin merged commit ff6be59 into forcedotcom:dev May 29, 2026
4 of 7 checks passed
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.

3 participants