Skip to content

[iOS] Keep subfolders and fix missing includes in the prebuilt headers package - #60295

Merged
cipolleschi merged 2 commits into
mainfrom
ios-prebuild-header-layout
Nov 27, 2026
Merged

cipolleschi merged 2 commits into
mainfrom
ios-prebuild-header-layout

Conversation

@chrfalch

@chrfalch chrfalch commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary:

Some headers in the prebuilt iOS headers package (ReactNativeHeaders) do not compile on their own. An app or library that uses the prebuilt React Native core can hit a broken include. This PR fixes the script that builds the package and adds 6 missing includes. No headers move in the source tree.

What changes in the package:

  1. The animated/ headers now keep their subfolders (nodes/, drivers/, event_drivers/, internal/). This matches the header_mappings_dir in React-Fabric.podspec. Before, they were copied flat, so their own includes broke.
  2. The mounting/stubs/ headers now keep the stubs/ subfolder, for the same reason.
  3. The 3 private observer module headers (react/nativemodule/{intersection,mutation,resize}observer/Native*Observer.h) are no longer in the package. They included observer headers that were missing from the package, so they did not compile. They are private, and only React Native's own .cpp files use them. Removing them fixes the broken includes without exposing the private observers/{intersection,mutation,resize} headers.
  4. The 5 Android-only textinput headers (textinput/platform/android) are no longer in the iOS package.
  5. 6 headers get the include they were missing:
    • iostextinput/propsConversions.h
    • bridging/Dynamic.h
    • core/ReactEventPriority.h
    • core/conversions.h
    • graphics/BlendMode.h
    • textlayoutmanager/RCTTextPrimitivesConversions.h

The accepted-problems list for the header check (headers-include-baseline.json) goes from 27 entries to 14.

This PR exposes no new private headers. Each React Native header is marked public, for-frameworks or private (scripts/cxx-api/README.md). The headers that move to subfolders were all in the package before, and none of the added includes makes a public header depend on a private one.

Breaking change

Before this PR, the prebuilt package also had the moved animated and mounting headers at a flat path, for example react/renderer/animated/AnimatedNode.h. Now they are only at their subfolder path, for example react/renderer/animated/nodes/AnimatedNode.h. React Native's own source code and CocoaPods already use the subfolder path for the animated headers.

We searched public GitHub code for all 31 old flat paths and found 351 matches. Every match was a copy of React Native itself. We found no library or app that uses these paths. If one does, the fix is to include the subfolder path instead.

Changelog:

[IOS] [BREAKING] - Prebuilt headers package: keep the animated/ and mounting/stubs/ subfolders, drop the private observer module headers, drop the Android textinput headers, and fix 6 headers that did not compile alone

Test Plan:

New Jest test packages/react-native/scripts/ios-prebuild/__tests__/headers-test.js. It runs the real header config on the source tree.

  • Before the fix, 13 tests were run: 10 failed for the subfolder and Android changes, and 3 for the observer change. After the fix, 13 of 13 pass.
  • yarn test packages/react-native/scripts/ios-prebuild: 11 suites, 113 of 113 tests pass.
  • yarn flow-check and yarn lint pass. The changed C++ files pass clang-format.

Package built from source and checked:

cd packages/react-native
RN_DEP_VERSION=nightly node scripts/ios-prebuild.js --compose --flavor Debug
node scripts/ios-prebuild/headers-verify.js --flavor Debug

headers-verify.js prints ALL GATES PASSED.

We compiled each stable-API header alone against that package. Before the 6 include fixes, 385 of 390 compiled. After them, all 390 compile.

Not run: a Release build of the package.

@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 Nov 25, 2026
@chrfalch
chrfalch marked this pull request as ready for review November 26, 2026 17:31
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Nov 26, 2026
chrfalch and others added 2 commits November 26, 2026 19:29
…package

The prebuilt ReactNativeHeaders package flattened the animated/ and
mounting/stubs/ subfolders, left out observers/{intersection,mutation,resize},
shipped five Android textinput headers, and contained six headers that
did not compile alone because of missing includes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The observers/{intersection,mutation,resize} headers and the
nativemodule Native*Observer.h headers that include them are private
(PrivateGuard.h) and used only from .cpp files. Skip their podspecs
instead of shipping them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chrfalch
chrfalch force-pushed the ios-prebuild-header-layout branch from 3c313a0 to 6e13b52 Compare November 26, 2026 18:29
@github-actions github-actions Bot added the Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. label Nov 26, 2026
@cipolleschi
cipolleschi merged commit 0b36342 into main Nov 27, 2026
104 checks passed
@cipolleschi
cipolleschi deleted the ios-prebuild-header-layout branch November 27, 2026 15:04
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 Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants