Skip to content

fix(app): align iOS constants with generated spec - #9220

Open
huytdps13400 wants to merge 1 commit into
invertase:mainfrom
huytdps13400:fix/9212-module-constants-type
Open

fix(app): align iOS constants with generated spec#9220
huytdps13400 wants to merge 1 commit into
invertase:mainfrom
huytdps13400:fix/9212-module-constants-type

Conversation

@huytdps13400

Copy link
Copy Markdown

Description

The generated New Architecture protocols declare constantsToExport and getConstants as ModuleConstants<...::Constants>, while RNFBAppModule and RNFBUtilsModule still implemented ModuleConstants<...::Constants::Builder>. Objective-C++ therefore sees incompatible method return types against the generated spec.

This aligns the four implementation signatures with the generated header without changing the constants dictionaries or runtime behavior. A Jest parity test now compares both implementations against their generated protocols so future codegen changes cannot silently drift.

Related issues

Fixes #9212

Release Summary

Fix iOS New Architecture build errors caused by mismatched TurboModule constants return types.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/**/e2e
    • jest tests added or updated in packages/**/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

  • RED: the new parity test reported Constants::Builder from both implementations versus Constants from both generated protocols.
  • yarn tests:jest packages/app/__tests__ --runInBand — 9 suites, 95 tests passed.
  • yarn tsc:compile
  • yarn workspace @react-native-firebase/app compile
  • yarn eslint packages/app/__tests__/iosConstantsReturnTypeParity.test.ts --max-warnings=0
  • yarn prettier --check packages/app/__tests__/iosConstantsReturnTypeParity.test.ts
  • yarn lint:ios:check
  • yarn codegen:verify — regenerated all configured Android/iOS artifacts with no drift.

🔥

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@huytdps13400 huytdps13400 changed the title fix(app,ios): align constants return types with generated spec fix(app): align iOS constants with generated spec Aug 24, 2026
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.

[iOS] New Architecture: constantsToExport/getConstants return type mismatch with generated Spec (ModuleConstants<Constants::Builder> vs Constants)

2 participants