fix(apple): guard RCTCxxBridge with RCT_REMOVE_LEGACY_ARCH#3906
Merged
wcandillon merged 1 commit intoJun 25, 2026
Merged
Conversation
React Native gates the removal of `RCTCxxBridge` (RCTBridge+Private.h)
behind `RCT_REMOVE_LEGACY_ARCH`, not `RCT_DISABLE_LEGACY_ARCH`. The
latter macro does not exist anywhere in React Native, so the `#ifndef`
guard was always true and the legacy `RCTCxxBridge` branch was compiled
in unconditionally.
On React Native main (where `RCT_REMOVE_LEGACY_ARCH` is defined and
`RCTCxxBridge` is fully compiled out) this fails to build:
RNSkiaModule.mm:40:5: error: unknown type name 'RCTCxxBridge';
did you mean 'RCTBridge'?
Switch the guard to the correct macro so the legacy branch is dropped
when the legacy architecture is removed; the new-arch getTurboModule
path already supplies jsInvoker in that configuration. Also fix the
stale macro name in the SkiaManager.mm comment.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
wcandillon
approved these changes
Jun 25, 2026
Contributor
|
@chrfalch Thanks a lot! Let me know if there is a workflow we could implement to test the package again latest RN nightly (we do it to test the package against Expo for instance: https://github.com/Shopify/react-native-skia/blob/main/.github/workflows/test-skia-package.yml). |
Contributor
|
🎉 This PR is included in version 2.6.8 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The legacy
RCTCxxBridgebranch inRNSkiaModule.mmis guarded byRCT_DISABLE_LEGACY_ARCH— a macro that does not exist in React Native. React Native compiles outRCTCxxBridge(fromRCTBridge+Private.h) behindRCT_REMOVE_LEGACY_ARCHinstead (react/react-native#56837).Because the macro name never matches, the
#ifndefguard is always true and theRCTCxxBridgebranch is compiled in unconditionally. On React Nativemain— whereRCT_REMOVE_LEGACY_ARCHis defined andRCTCxxBridgeis fully removed — the iOS build fails:This is what the React Native community nightly tests are currently flagging for
@shopify/react-native-skiaon iOS.Fix
RNSkiaModule.mm: change the guard fromRCT_DISABLE_LEGACY_ARCH→RCT_REMOVE_LEGACY_ARCH. When the legacy arch is removed, the branch is dropped and the new-archgetTurboModulepath already suppliesjsInvoker.SkiaManager.mm: fix the stale macro name in the explanatory comment (no code change there — it already avoidsRCTCxxBridgevia a forward-declaredruntimeaccessor).Test plan
main/nightly (whereRCT_REMOVE_LEGACY_ARCHis set andRCTCxxBridgeis absent).RCTCxxBridgeis available (macro undefined → branch retained, same as before).🤖 Generated with Claude Code