Skip to content

Reject non-TurboModule exported modules when both interops are removed (#60531) - #60531

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
christophpurrer:export-D136017712
Dec 5, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
christophpurrer:export-D136017712

Conversation

@christophpurrer

@christophpurrer christophpurrer commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

With both legacy interop layers removed, RCTTurboModuleManager only creates classes that conform to RCTTurboModule. A module exported with RCT_EXPORT_MODULE that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make RCT_EXPORT_MODULE fail the build for such classes instead.

Changelog:
[iOS][Changed] - RCT_EXPORT_MODULE fails to compile for classes that do not conform to RCTTurboModule when both RCT_REMOVE_LEGACY_MODULE_INTEROP and RCT_REMOVE_LEGACY_COMPONENT_INTEROP are set

Signed-off-by: Christoph Purrer chpurrer@meta.com

Reviewed By: shwanton

Differential Revision: D136017712

@meta-codesync

meta-codesync Bot commented Dec 4, 2026

Copy link
Copy Markdown

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

@meta-codesync meta-codesync Bot changed the title Reject non-TurboModule exported modules when both interops are removed Reject non-TurboModule exported modules when both interops are removed (#60531) Dec 4, 2026
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 4, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Differential Revision: D136017712
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 4, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Differential Revision: D136017712
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Visual regression

No visual differences at 0ae8f0a57930.

android: no capture

christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 4, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Differential Revision: D136017712
@christophpurrer
christophpurrer force-pushed the export-D136017712 branch 2 times, most recently from 264fc62 to 5e98ee3 Compare December 4, 2026 13:55
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 4, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Differential Revision: D136017712
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 4, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Differential Revision: D136017712
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 4, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Differential Revision: D136017712
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 4, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Differential Revision: D136017712

@shwanton shwanton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 4, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Reviewed By: shwanton

Differential Revision: D136017712
@christophpurrer
christophpurrer force-pushed the export-D136017712 branch 2 times, most recently from 740d95b to 3fd72a6 Compare December 4, 2026 17:36
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 4, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Reviewed By: shwanton

Differential Revision: D136017712
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 4, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Reviewed By: shwanton

Differential Revision: D136017712
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 5, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Signed-off-by: Christoph Purrer chpurrer@meta.com

Reviewed By: shwanton

Differential Revision: D136017712
christophpurrer added a commit to christophpurrer/react-native-macos that referenced this pull request Dec 5, 2026
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Signed-off-by: Christoph Purrer chpurrer@meta.com

Reviewed By: shwanton

Differential Revision: D136017712
react#60531)

Summary:

With both legacy interop layers removed, `RCTTurboModuleManager` only creates classes that conform to `RCTTurboModule`. A module exported with `RCT_EXPORT_MODULE` that does not conform compiles but resolves to nil at runtime, so lookups such as URL request handlers and image loaders silently fall back. Make `RCT_EXPORT_MODULE` fail the build for such classes instead.

Changelog:
[iOS][Changed] - `RCT_EXPORT_MODULE` fails to compile for classes that do not conform to `RCTTurboModule` when both `RCT_REMOVE_LEGACY_MODULE_INTEROP` and `RCT_REMOVE_LEGACY_COMPONENT_INTEROP` are set

Signed-off-by: Christoph Purrer <chpurrer@meta.com>

Reviewed By: shwanton

Differential Revision: D136017712
@meta-codesync
meta-codesync Bot merged commit 37beffc into react:main Dec 5, 2026
75 of 76 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @christophpurrer in 37beffc

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged This PR has been merged. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants