Skip to content

Add CocoaPods opt-in for RN_STRICT_API (#59037) - #59037

Open
coado wants to merge 1 commit into
react:mainfrom
coado:export-D124979668
Open

coado wants to merge 1 commit into
react:mainfrom
coado:export-D124979668

Conversation

@coado

@coado coado commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Let iOS apps that use CocoaPods enforce React Native's C++ stable API. Setting RN_STRICT_API=1 before pod install defines RN_STRICT_API in the app project and the Pods project, so the react/cxxstableapi guards apply to the app, third-party pods and app codegen. React Native's own pods are unaffected because they define RN_BUILDING.

Under the flag, a direct include of a public module header is an error that points to the module's umbrella (<React/<Module>.h>), a private header is an error, and a "for frameworks" header is a warning that RN_ALLOW_FRAMEWORKS silences.

Changelog:
[iOS][Added] - Add RCT_STRICT_CXX_API CocoaPods opt-in to enforce React Native's C++ stable API in app and library native code

Differential Revision: D124979668

@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 Oct 13, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Oct 13, 2026
@meta-codesync

meta-codesync Bot commented Oct 13, 2026

Copy link
Copy Markdown

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

@meta-codesync meta-codesync Bot changed the title Add CocoaPods opt-in for RN_STRICT_API Add CocoaPods opt-in for RN_STRICT_API (#59037) Oct 13, 2026
coado added a commit to coado/react-native that referenced this pull request Oct 13, 2026
Summary:

Let iOS apps that use CocoaPods enforce React Native's C++ stable API. Setting `RCT_STRICT_CXX_API=1` before `pod install` defines `RN_STRICT_API` in the app project and the Pods project, so the `react/cxxstableapi` guards apply to the app, third-party pods and app codegen. React Native's own pods are unaffected because they define `RN_BUILDING`.

Under the flag, a direct include of a public module header is an error that points to the module's umbrella (`<React/<Module>.h>`), a private header is an error, and a "for frameworks" header is a warning that `RN_ALLOW_FRAMEWORKS` silences.

The flag is off by default: libraries that still include React Native's internal headers would stop compiling. Turning it back off removes the define on the next `pod install`. This mirrors the existing `RCT_REMOVE_LEGACY_*` opt-ins and matches the scope of the Android opt-in.

Changelog:
[iOS][Added] - Add `RCT_STRICT_CXX_API` CocoaPods opt-in to enforce React Native's C++ stable API in app and library native code

Differential Revision: D124979668
@coado
coado force-pushed the export-D124979668 branch from e61a4cf to ba43662 Compare October 13, 2026 14:37
coado added a commit to coado/react-native that referenced this pull request Oct 13, 2026
Summary:

Let iOS apps that use CocoaPods enforce React Native's C++ stable API. Setting `RN_STRICT_API=1` before `pod install` defines `RN_STRICT_API` in the app project and the Pods project, so the `react/cxxstableapi` guards apply to the app, third-party pods and app codegen. React Native's own pods are unaffected because they define `RN_BUILDING`.

Under the flag, a direct include of a public module header is an error that points to the module's umbrella (`<React/<Module>.h>`), a private header is an error, and a "for frameworks" header is a warning that `RN_ALLOW_FRAMEWORKS` silences.

Changelog:
[iOS][Added] - Add `RCT_STRICT_CXX_API` CocoaPods opt-in to enforce React Native's C++ stable API in app and library native code

Differential Revision: D124979668
@coado
coado force-pushed the export-D124979668 branch from ba43662 to 685f223 Compare October 13, 2026 15:11
coado added a commit to coado/react-native that referenced this pull request Oct 13, 2026
Summary:

Let iOS apps that use CocoaPods enforce React Native's C++ stable API. Setting `RN_STRICT_API=1` before `pod install` defines `RN_STRICT_API` in the app project and the Pods project, so the `react/cxxstableapi` guards apply to the app, third-party pods and app codegen. React Native's own pods are unaffected because they define `RN_BUILDING`.

Under the flag, a direct include of a public module header is an error that points to the module's umbrella (`<React/<Module>.h>`), a private header is an error, and a "for frameworks" header is a warning that `RN_ALLOW_FRAMEWORKS` silences.

Changelog:
[iOS][Added] - Add `RCT_STRICT_CXX_API` CocoaPods opt-in to enforce React Native's C++ stable API in app and library native code

Differential Revision: D124979668
@coado
coado force-pushed the export-D124979668 branch from 685f223 to c191dde Compare October 13, 2026 15:13
coado added a commit to coado/react-native that referenced this pull request Oct 13, 2026
Summary:
Pull Request resolved: react#59037

Let iOS apps that use CocoaPods enforce React Native's C++ stable API. Setting `RN_STRICT_API=1` before `pod install` defines `RN_STRICT_API` in the app project and the Pods project, so the `react/cxxstableapi` guards apply to the app, third-party pods and app codegen. React Native's own pods are unaffected because they define `RN_BUILDING`.

Under the flag, a direct include of a public module header is an error that points to the module's umbrella (`<React/<Module>.h>`), a private header is an error, and a "for frameworks" header is a warning that `RN_ALLOW_FRAMEWORKS` silences.

Changelog:
[iOS][Added] - Add `RCT_STRICT_CXX_API` CocoaPods opt-in to enforce React Native's C++ stable API in app and library native code

Differential Revision: D124979668
@coado
coado force-pushed the export-D124979668 branch 2 times, most recently from 8202e06 to fe0e701 Compare October 14, 2026 08:11
coado added a commit to coado/react-native that referenced this pull request Oct 14, 2026
Summary:

Let iOS apps that use CocoaPods enforce React Native's C++ stable API. Setting `RN_STRICT_API=1` before `pod install` defines `RN_STRICT_API` in the app project and the Pods project, so the `react/cxxstableapi` guards apply to the app, third-party pods and app codegen. React Native's own pods are unaffected because they define `RN_BUILDING`.

Under the flag, a direct include of a public module header is an error that points to the module's umbrella (`<React/<Module>.h>`), a private header is an error, and a "for frameworks" header is a warning that `RN_ALLOW_FRAMEWORKS` silences.

Changelog:
[iOS][Added] - Add `RCT_STRICT_CXX_API` CocoaPods opt-in to enforce React Native's C++ stable API in app and library native code

Differential Revision: D124979668
coado added a commit to coado/react-native that referenced this pull request Oct 14, 2026
Summary:

Let iOS apps that use CocoaPods enforce React Native's C++ stable API. Setting `RN_STRICT_API=1` before `pod install` defines `RN_STRICT_API` in the app project and the Pods project, so the `react/cxxstableapi` guards apply to the app, third-party pods and app codegen. React Native's own pods are unaffected because they define `RN_BUILDING`.

Under the flag, a direct include of a public module header is an error that points to the module's umbrella (`<React/<Module>.h>`), a private header is an error, and a "for frameworks" header is a warning that `RN_ALLOW_FRAMEWORKS` silences.

Changelog:
[iOS][Added] - Add `RCT_STRICT_CXX_API` CocoaPods opt-in to enforce React Native's C++ stable API in app and library native code

Differential Revision: D124979668
@coado
coado force-pushed the export-D124979668 branch 2 times, most recently from 74cbb50 to e096ea5 Compare October 14, 2026 08:14
coado added a commit to coado/react-native that referenced this pull request Oct 14, 2026
Summary:
Pull Request resolved: react#59037

Let iOS apps that use CocoaPods enforce React Native's C++ stable API. Setting `RN_STRICT_API=1` before `pod install` defines `RN_STRICT_API` in the app project and the Pods project, so the `react/cxxstableapi` guards apply to the app, third-party pods and app codegen. React Native's own pods are unaffected because they define `RN_BUILDING`.

Under the flag, a direct include of a public module header is an error that points to the module's umbrella (`<React/<Module>.h>`), a private header is an error, and a "for frameworks" header is a warning that `RN_ALLOW_FRAMEWORKS` silences.

Changelog:
[iOS][Added] - Add `RCT_STRICT_CXX_API` CocoaPods opt-in to enforce React Native's C++ stable API in app and library native code

Differential Revision: D124979668
Summary:
Pull Request resolved: react#59037

Let iOS apps that use CocoaPods enforce React Native's C++ stable API. Setting `RN_STRICT_API=1` before `pod install` defines `RN_STRICT_API` in the app project and the Pods project, so the `react/cxxstableapi` guards apply to the app, third-party pods and app codegen. React Native's own pods are unaffected because they define `RN_BUILDING`.

Under the flag, a direct include of a public module header is an error that points to the module's umbrella (`<React/<Module>.h>`), a private header is an error, and a "for frameworks" header is a warning that `RN_ALLOW_FRAMEWORKS` silences.

Changelog:
[iOS][Added] - Add `RCT_STRICT_CXX_API` CocoaPods opt-in to enforce React Native's C++ stable API in app and library native code

Differential Revision: D124979668
@coado
coado force-pushed the export-D124979668 branch from e096ea5 to 18b3865 Compare October 14, 2026 08:19

This branch has not been deployed

No deployments
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. meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant