Skip to content

Commit e6f008d

Browse files
committed
feat(app)!: migrate app modules to TurboModules incl general migration infra
BREAKING CHANGE: App/Core modules native bridge requires New Architecture. Migrate RNFBAppModule and RNFBUtilsModule to Codegen TurboModules with unified resolver, lazy Proxy wrapper, and committed generated artifacts. Includes functions codegenConfig rename (NewArch-AD-7), test harness overrides, architecture decisions, and validation workflow hardening.
1 parent 5d79c5b commit e6f008d

86 files changed

Lines changed: 4979 additions & 560 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ tests/ios/resetXcode.sh
547547
google-services.json
548548
GoogleService-Info.plist
549549

550+
tests/harness.overrides.js
551+
550552
# generated files
551553
RNFBVersion.m
552554
ReactNativeFirebaseVersion.java

jest.setup.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ jest.doMock('react-native', () => {
3232
OS: 'android',
3333
select: () => {},
3434
},
35+
TurboModuleRegistry: {
36+
get: jest.fn(() => undefined),
37+
getEnforcing: jest.fn(() => {
38+
throw new Error('TurboModuleRegistry.getEnforcing: module not found');
39+
}),
40+
},
3541
AppRegistry: {
3642
registerHeadlessTask: jest.fn(),
3743
},
@@ -54,6 +60,73 @@ jest.doMock('react-native', () => {
5460
initiateOnDeviceConversionMeasurementWithPhoneNumber: jest.fn(),
5561
initiateOnDeviceConversionMeasurementWithHashedPhoneNumber: jest.fn(),
5662
},
63+
NativeRNFBTurboApp: {
64+
getConstants: () => ({
65+
NATIVE_FIREBASE_APPS: [
66+
{
67+
appConfig: {
68+
name: '[DEFAULT]',
69+
},
70+
options: {},
71+
},
72+
{
73+
appConfig: {
74+
name: 'secondaryFromNative',
75+
},
76+
options: {},
77+
},
78+
],
79+
FIREBASE_RAW_JSON: '{}',
80+
}),
81+
NATIVE_FIREBASE_APPS: [
82+
{
83+
appConfig: {
84+
name: '[DEFAULT]',
85+
},
86+
options: {},
87+
},
88+
89+
{
90+
appConfig: {
91+
name: 'secondaryFromNative',
92+
},
93+
options: {},
94+
},
95+
],
96+
FIREBASE_RAW_JSON: '{}',
97+
addListener: jest.fn(),
98+
eventsAddListener: jest.fn(),
99+
eventsNotifyReady: jest.fn(),
100+
removeListeners: jest.fn(),
101+
},
102+
NativeRNFBTurboUtils: {
103+
getConstants: () => ({
104+
isRunningInTestLab: false,
105+
MAIN_BUNDLE: '/',
106+
CACHES_DIRECTORY: '/cache',
107+
DOCUMENT_DIRECTORY: '/documents',
108+
TEMP_DIRECTORY: '/tmp',
109+
LIBRARY_DIRECTORY: '/library',
110+
PICTURES_DIRECTORY: '/pictures',
111+
MOVIES_DIRECTORY: '/movies',
112+
}),
113+
isRunningInTestLab: false,
114+
MAIN_BUNDLE: '/',
115+
CACHES_DIRECTORY: '/cache',
116+
DOCUMENT_DIRECTORY: '/documents',
117+
TEMP_DIRECTORY: '/tmp',
118+
LIBRARY_DIRECTORY: '/library',
119+
PICTURES_DIRECTORY: '/pictures',
120+
MOVIES_DIRECTORY: '/movies',
121+
androidGetPlayServicesStatus: jest.fn(() =>
122+
Promise.resolve({
123+
isAvailable: true,
124+
status: 0,
125+
hasResolution: false,
126+
isUserResolvableError: false,
127+
}),
128+
),
129+
},
57130
RNFBAppModule: {
58131
NATIVE_FIREBASE_APPS: [
59132
{

okf-bundle/ci-workflows/ios.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ Long `datamigrator` activity with no `com.invertase.testing` means migration/pre
150150

151151
Device type comes from `tests/.detoxrc.js`; boot script and Detox use it. No hard-coded UDID.
152152

153+
**Missing Detox framework cache** — if iOS `:test-cover` fails before tests with `Detox.framework could not be found`, rebuild the local cache: [running e2e § iOS Detox framework cache](../testing/running-e2e.md#ios-detox-framework-cache-blocking) (`yarn tests:ios:detox-framework-cache:rebuild`). CI restores `~/Library/Detox/ios` from Actions cache keyed by Xcode version.
154+
153155
### Codecov (debug matrix only)
154156

155157
Debug leg: `yarn tests:ios:test:process-coverage` + Codecov flags `e2e-ts-ios`, `ios-native`; `codecov/project/ios-native` blocks on missing native upload. Release skips coverage.

okf-bundle/namespace-api-removal-work-queue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Ephemeral tracker; see [OKF policy](documentation-policy.md). Work types / tiers
4040

4141
Gate prerequisites before any `:test-cover` ([host rule](testing/change-authoring-workflow.md#host-rule)):
4242

43-
1. [Pre-flight](testing/running-e2e.md#pre-flight-is-the-host-clear-to-start): [host-clear probes](testing/running-e2e.md#host-clear-probes), [services ready](testing/running-e2e.md#2-services-ready), [harness matches validation tier](testing/running-e2e.md#3-harness-matches-validation-tier)[area harness: both platform blocks](testing/running-e2e.md#tests-app-js-area-harness); [narrowing gate](testing/running-e2e.md#harness-narrowing-gate-blocking)**unit-focused** and **area-focused** only); [serial `:test-cover`](testing/running-e2e.md#serialized-e2e-dispatch); [frozen tree](testing/change-authoring-workflow.md#frozen-tree) for `independent-review`.
43+
1. [Pre-flight](testing/running-e2e.md#pre-flight-is-the-host-clear-to-start): [host-clear probes](testing/running-e2e.md#host-clear-probes), [services ready](testing/running-e2e.md#2-services-ready), [harness matches validation tier](testing/running-e2e.md#3-harness-matches-validation-tier)[local harness overrides](testing/running-e2e.md#local-harness-overrides-harnessoverridesjs); [narrowing gate](testing/running-e2e.md#harness-narrowing-gate-blocking)**unit-focused** and **area-focused** only); [serial `:test-cover`](testing/running-e2e.md#serialized-e2e-dispatch); [frozen tree](testing/change-authoring-workflow.md#frozen-tree) for `independent-review`.
4444
2. Per-module checklist and removal greps: [namespace-api-removal-workflow.md](namespace-api-removal-workflow.md). User-facing namespace removal: [Migrating to v26](/migrating-to-v26).
4545

4646
---

okf-bundle/namespace-api-removal-workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ On a **frozen tree** — [change authoring § independent-review](testing/change
9494

9595
## Module area harness
9696

97-
Extends [change authoring § harness narrowing](testing/change-authoring-workflow.md#harness-narrowing). **Mechanics:** [running e2e § area harness — two platform blocks](testing/running-e2e.md#tests-app-js-area-harness).
97+
Extends [change authoring § harness narrowing](testing/change-authoring-workflow.md#harness-narrowing). **Mechanics:** [running e2e § local harness overrides](testing/running-e2e.md#local-harness-overrides-harnessoverridesjs).
9898

9999
When native e2e runs: load **only** the target package's e2e spec(s) in `tests/app.js`. Narrow **`platformSupportedModules` on both** `if (Platform.other)` and `if (!Platform.other)` (recommended: Pattern A — initial array + `if (false && …)` on **both** blocks). Set **`RNFBDebug = true`** locally per [running e2e § fail-fast](testing/running-e2e.md#fail-fast-rnfbdebug-and-sub-suite-narrowing)**never commit** (`false` is the committed default). Revert **both** blocks before `commit` or **full** tier. Pass counts must match loaded scope — not full-app totals ([running e2e § gate](testing/running-e2e.md#harness-narrowing-gate-blocking), [platform coverage gate](testing/running-e2e.md#platform-coverage-gate-blocking)).
100100

0 commit comments

Comments
 (0)