Skip to content

Allow opting into RCT_REMOVE_LEGACY_*_INTEROP on iOS OSS (#57892) - #57892

Closed
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D115490838
Closed

Allow opting into RCT_REMOVE_LEGACY_*_INTEROP on iOS OSS (#57892)#57892
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D115490838

Conversation

@christophpurrer

@christophpurrer christophpurrer commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary:

Changelog: [iOS][Added] - Allow consumers to opt into RCT_REMOVE_LEGACY_MODULE_INTEROP and RCT_REMOVE_LEGACY_COMPONENT_INTEROP from CocoaPods and SwiftPM. Both default to off and will become the default in a future release

OSS iOS consumers had no way to set -DRCT_REMOVE_LEGACY_MODULE_INTEROP=1 and -DRCT_REMOVE_LEGACY_COMPONENT_INTEROP=1.
This adds that, mirroring the existing
RCT_REMOVE_LEGACY_ARCH plumbing:

  • RCT_REMOVE_LEGACY_MODULE_INTEROP=1 / RCT_REMOVE_LEGACY_COMPONENT_INTEROP=1 before
    pod install adds the define project-wide via
    ReactNativePodsUtils.set_legacy_interop_removal_flags.
  • The same variables gate a matching .define(...) in Package.swift, so a
    build-from-source React Native compiles without the legacy interop layers too.

Both default to 0. They will default to 1 in a future release, at which point
the env vars become opt-out.

The macros gate declarations in the public RCTBridge.h / RCTBridgeModule.h, so the
define is applied to the whole project rather than to React Native pods alone. When a
flag is enabled while using the prebuilt React.xcframework, pod install warns that
only the app-side pruning takes effect.

Reviewed By: cipolleschi

Differential Revision: D115490838

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 11, 2026
@meta-codesync

meta-codesync Bot commented Aug 11, 2026

Copy link
Copy Markdown

@christophpurrer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D115490838.

Summary:

Changelog: [iOS][Added] - Allow consumers to opt into `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` from CocoaPods and SwiftPM. Both default to off and will become the default in a future release

OSS iOS consumers had no way to set `-DRCT_REMOVE_LEGACY_MODULE_INTEROP=1` and `-DRCT_REMOVE_LEGACY_COMPONENT_INTEROP=1`.
 This adds that, mirroring the existing
`RCT_REMOVE_LEGACY_ARCH` plumbing:

- `RCT_REMOVE_LEGACY_MODULE_INTEROP=1` / `RCT_REMOVE_LEGACY_COMPONENT_INTEROP=1` before
  `pod install` adds the define project-wide via
  `ReactNativePodsUtils.set_legacy_interop_removal_flags`.
- The same variables gate a matching `.define(...)` in `Package.swift`, so a
  build-from-source React Native compiles without the legacy interop layers too.

Both default to `0`. **They will default to `1` in a future release**, at which point
the env vars become opt-out.

The macros gate declarations in the public `RCTBridge.h` / `RCTBridgeModule.h`, so the
define is applied to the whole project rather than to React Native pods alone. When a
flag is enabled while using the prebuilt `React.xcframework`, `pod install` warns that
only the app-side pruning takes effect.

Reviewed By: cipolleschi

Differential Revision: D115490838
@meta-codesync meta-codesync Bot changed the title Allow opting into RCT_REMOVE_LEGACY_*_INTEROP on iOS OSS Allow opting into RCT_REMOVE_LEGACY_*_INTEROP on iOS OSS (#57892) Aug 11, 2026
@meta-codesync meta-codesync Bot closed this in b933d18 Aug 11, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Aug 11, 2026
@meta-codesync

meta-codesync Bot commented Aug 11, 2026

Copy link
Copy Markdown

This pull request has been merged in b933d18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant