Skip to content

Gate legacy view manager interop behind RCT_REMOVE_LEGACY_COMPONENT_INTEROP (#57071)#57071

Open
christophpurrer wants to merge 1 commit into
facebook:mainfrom
christophpurrer:export-D107440358
Open

Gate legacy view manager interop behind RCT_REMOVE_LEGACY_COMPONENT_INTEROP (#57071)#57071
christophpurrer wants to merge 1 commit into
facebook:mainfrom
christophpurrer:export-D107440358

Conversation

@christophpurrer
Copy link
Copy Markdown
Contributor

@christophpurrer christophpurrer commented Jun 3, 2026

Summary:

Wraps the iOS legacy RCTViewManager ↔ Fabric component interop layer in #ifndef RCT_REMOVE_LEGACY_COMPONENT_INTEROP so that apps which opt into compile it out entirely. This enables dead-code elimination of the Paper view manager interop surface for apps that have fully migrated their custom views to Fabric Component Views.

Changes:

iOS (Objective-C / C++):

  • React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.{h,mm}: Compile the entire translation unit only when the flag is undefined.
  • React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.{h,mm}: Compile the entire translation unit only when the flag is undefined.
  • ReactCommon/.../platform/ios/.../RCTLegacyViewManagerInteropCoordinator.{h,mm}: Compile the entire translation unit only when the flag is undefined.
  • ReactCommon/.../platform/ios/.../LegacyViewManagerInteropComponentDescriptor.mm: Compile the entire translation unit only when the flag is undefined.
  • React/Base/RCTBridge.{h,mm}: Hide RCTFabricInteropLayerEnabled / RCTEnableFabricInteropLayer API and the backing fabricInteropLayerEnabled static when the flag is defined.
  • React/Fabric/Mounting/RCTComponentViewFactory.mm: Gate the #import of RCTLegacyViewManagerInteropComponentView.h and the legacy interop fallback branch in _registerComponentIfPossible:.

Default behavior is unchanged because RCT_REMOVE_LEGACY_COMPONENT_INTEROP is not defined unless the new constraint is selected.

Changelog:
[General][Added] Gate legacy view manager interop behind RCT_REMOVE_LEGACY_COMPONENT_INTEROP

Differential Revision: D107440358

@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 Jun 3, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jun 3, 2026

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

@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jun 3, 2026
@meta-codesync meta-codesync Bot changed the title Gate legacy view manager interop behind RCT_REMOVE_LEGACY_COMPONENT_INTEROP Gate legacy view manager interop behind RCT_REMOVE_LEGACY_COMPONENT_INTEROP (#57071) Jun 3, 2026
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Jun 3, 2026
…INTEROP` (facebook#57071)

Summary:

Wraps the iOS legacy `RCTViewManager` ↔ Fabric component interop layer in `#ifndef RCT_REMOVE_LEGACY_COMPONENT_INTEROP` so that apps which opt into compile it out entirely. This enables dead-code elimination of the Paper view manager interop surface for apps that have fully migrated their custom views to Fabric Component Views.

Changes:

iOS (Objective-C / C++):
- `React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.{h,mm}`: Compile the entire translation unit only when the flag is undefined.
- `React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.{h,mm}`: Compile the entire translation unit only when the flag is undefined.
- `ReactCommon/.../platform/ios/.../RCTLegacyViewManagerInteropCoordinator.{h,mm}`: Compile the entire translation unit only when the flag is undefined.
- `ReactCommon/.../platform/ios/.../LegacyViewManagerInteropComponentDescriptor.mm`: Compile the entire translation unit only when the flag is undefined.
- `React/Base/RCTBridge.{h,mm}`: Hide `RCTFabricInteropLayerEnabled` / `RCTEnableFabricInteropLayer` API and the backing `fabricInteropLayerEnabled` static when the flag is defined.
- `React/Fabric/Mounting/RCTComponentViewFactory.mm`: Gate the `#import` of `RCTLegacyViewManagerInteropComponentView.h` and the legacy interop fallback branch in `_registerComponentIfPossible:`.

Default behavior is unchanged because `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` is not defined unless the new constraint is selected.

Changelog:
[General][Added] Gate legacy view manager interop behind `RCT_REMOVE_LEGACY_COMPONENT_INTEROP`

Differential Revision: D107440358
…INTEROP` (facebook#57071)

Summary:

Wraps the iOS legacy `RCTViewManager` ↔ Fabric component interop layer in `#ifndef RCT_REMOVE_LEGACY_COMPONENT_INTEROP` so that apps which opt into compile it out entirely. This enables dead-code elimination of the Paper view manager interop surface for apps that have fully migrated their custom views to Fabric Component Views.

Changes:

iOS (Objective-C / C++):
- `React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.{h,mm}`: Compile the entire translation unit only when the flag is undefined.
- `React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropCoordinatorAdapter.{h,mm}`: Compile the entire translation unit only when the flag is undefined.
- `ReactCommon/.../platform/ios/.../RCTLegacyViewManagerInteropCoordinator.{h,mm}`: Compile the entire translation unit only when the flag is undefined.
- `ReactCommon/.../platform/ios/.../LegacyViewManagerInteropComponentDescriptor.mm`: Compile the entire translation unit only when the flag is undefined.
- `React/Base/RCTBridge.{h,mm}`: Hide `RCTFabricInteropLayerEnabled` / `RCTEnableFabricInteropLayer` API and the backing `fabricInteropLayerEnabled` static when the flag is defined.
- `React/Fabric/Mounting/RCTComponentViewFactory.mm`: Gate the `#import` of `RCTLegacyViewManagerInteropComponentView.h` and the legacy interop fallback branch in `_registerComponentIfPossible:`.

Default behavior is unchanged because `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` is not defined unless the new constraint is selected.

Changelog:
[General][Added] Gate legacy view manager interop behind `RCT_REMOVE_LEGACY_COMPONENT_INTEROP`

Differential Revision: D107440358
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. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant