[ios][precompile] refactor header files generator for prebuilt React framework#54841
[ios][precompile] refactor header files generator for prebuilt React framework#54841chrfalch wants to merge 6 commits into
Conversation
Job Summary for GradleTest All :: run_fantom_tests
|
cipolleschi
left a comment
There was a problem hiding this comment.
See my comment below. There are also some warnings on redeclared variables and variables declared but not used, so perhaps this PR requires a bit of work yet?
Job Summary for GradleTest All :: run_fantom_tests
|
cipolleschi
left a comment
There was a problem hiding this comment.
One thing I'm not super excited about is that we are still depending on the podspec structure to decide which headers we need. That's ok for now, but as soon as we drop the Cocoapods infra, this will have to be rewritten again.
| .flat(); | ||
|
|
||
| // Use the first podspec spec name as the podspec name (this is the root spec in the podspec file) | ||
| const podSpecName = podSpecsWithHeaderFiles[podspec][0].specName.replace( |
There was a problem hiding this comment.
These warnings are fixed in the next PR in the stack. Sorry!
a91c7bb to
0b0199e
Compare
d0c3305 to
b1fdfaf
Compare
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D90674355. |
Summary: To make the later VFS overlays work, our React umbrella header needs to use angled import syntax instead of quoted". This is so that the compiler will look up by module and not only by path. Prev PR: #54839 Next PR: #54841 ## Changelog: [IOS] [FIXED] - changed umbrella header template to use angled import syntax Pull Request resolved: #54840 Test Plan: Run RNTester with prebuilds Reviewed By: cortinico Differential Revision: D89377015 Pulled By: cipolleschi fbshipit-source-id: b1be8223b7cad5d09a918464f7bac6edad4bd051
cortinico
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
Replace the regex-based approach for parsing podspec files with a declarative configuration system for header file collection: Add headers-config.js with explicit podspec configurations defining header patterns, directories, and subspecs - Add vfs.js to generate VFS overlay YAML files for Clang virtual file system support - Refactor headers.js to use the new configuration-based approach with support for nested subspecs and path preservation - Update xcframework.js to handle the new header mapping structure with source/target paths - This provides more reliable and maintainable header file collection for XCFramework builds by avoiding fragile regex parsing of Ruby podspec files.
Now it reads from podspec files, except for some special cases that we have in the config file. Updated RCTSwiftUIWrapper.podspec to use podspec_sources (which we use to detect source) I tested this against the header files I got with the previous iteration, and also with the ones installed by Cocoapods.
b1fdfaf to
60dd56a
Compare
Summary: To solve our problem with header files from the React.XCFramework not being consumable due to the legacy Cocoapods headers, we used to point all header search / resolving into the Pods/Headers folder when building even with the framework installed. This is a problem since an xcframework expects a modular header structure that can be consumed from within the headers folder of the framework. The headers are used for both Objective-c compiling and for creating clang modules that can be consumed by Swift in our setup. This commit fixes the above issues and makes a modular clang virtual file system from the header files we distribute. This vfs-overlay file will then be used by the `rncore.rb` script when installing the 'React-Core-prebuilt' pod and map the header files requested in the source code to the actual location on disk where the React.xcframework headers are installed. Here are the changes: - Added vfs.js with types for creating clang virtual file system overlays - Added resolving the paths in the vfs file to the actual install path - Added installing the vfs overlay with the switch `-ivfsoverlay <path>` to compiler settings for both obj-c and swift on pod installation - Add vfs targets to the app target on post install Prev PR: #54841 bypass-github-export-checks ## Changelog: [IOS] [FIXED] - added support for clang virtual file system in React.XCFramework Pull Request resolved: #54842 Test Plan: Run RNTester with prebuilt Reviewed By: cortinico Differential Revision: D90674493 Pulled By: cipolleschi fbshipit-source-id: 2b974f0651af351febdd4eb05a37a359a96aa070
|
@cipolleschi merged this pull request in 3fad7dc. |
|
This pull request was successfully merged by @chrfalch in 3fad7dc When will my fix make it into a release? | How to file a pick request? |
Summary:
Replace the regex-based approach for parsing podspec files with a declarative configuration system for header file collection:
Add headers-config.js with explicit podspec configurations defining header patterns, directories, and subspecs
Prev PR: #54840
Next PR: #54842
Changelog:
[IOS] [FIXED] - refactored header files generator for prebuilt React framework
Test Plan:
Run RNTester with prebuilt