-
Notifications
You must be signed in to change notification settings - Fork 25.2k
refactor(iOS): include resources like bundles into the precompiled XCFrameworks #57305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
68f9046
705b310
9ee4199
18735a0
02f3500
977f1ae
ec979d3
556abab
e53e6b2
42d8310
51d4e7e
7b3be97
cd67dee
e6ab638
6648f90
dcb5ad8
b4b1a94
405adbd
562985d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,7 +51,6 @@ Pod::Spec.new do |s| | |
| s.author = "Meta Platforms, Inc. and its affiliates" | ||
| s.platforms = min_supported_versions | ||
| s.source = source | ||
| s.resource_bundle = { "RCTI18nStrings" => ["React/I18n/strings/*.lproj"]} | ||
| s.compiler_flags = js_engine_flags() | ||
| s.header_dir = "React" | ||
| s.weak_framework = "JavaScriptCore" | ||
|
|
@@ -122,7 +121,15 @@ Pod::Spec.new do |s| | |
| s.dependency "React-hermes" | ||
| end | ||
|
|
||
| s.resource_bundles = {'React-Core_privacy' => 'React/Resources/PrivacyInfo.xcprivacy'} | ||
| # Both bundles in one declaration: a second `resource_bundle(s) =` would replace | ||
| # (not merge) the first. RCTI18nStrings holds React-Core's localized strings | ||
| # (loaded by RCTLocalizedString); React-Core_privacy is the privacy manifest. | ||
| # (Prebuilt/SwiftPM get both from inside React.xcframework instead — see | ||
| # scripts/ios-prebuild/{i18n,privacy}.js — but source builds ship them here.) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Major: This comment points to |
||
| s.resource_bundles = { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice — consolidating these also fixes a latent bug: the old podspec's separate |
||
| 'RCTI18nStrings' => ['React/I18n/strings/*.lproj'], | ||
| 'React-Core_privacy' => 'React/Resources/PrivacyInfo.xcprivacy', | ||
| } | ||
|
|
||
| add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) | ||
| add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking — needs verification before merge.
This design ships the privacy manifest and
RCTI18nStrings.bundleonly from insideReact.xcframework'sReact.framework; the prebuilt facade carries no pod-levelresource_bundles/resources(seerncore_facades.rb: "the facade carries NO resources"). We still install the prebuilt via CocoaPods, and most apps link their pod graph statically (the New Architecture default: static libraries, nouse_frameworks!).CocoaPods copies resources nested inside a
.frameworkonly when it embeds that framework. It does embed vendored dynamic frameworks (via the[CP] Embed Pods Frameworksphase), and the prebuilt is currently builttype: .dynamic(scripts/releases/ios-prebuild/swift-package.js), so in principle the nested bundle should be copied even in a static-pods app. But this is silent if it breaks — you'd get untranslated strings (RCTLocalizedStringFromKeyfalling back to the English default) and a missingPrivacyInfo.xcprivacyin the app's privacy report, with no build error.Could we verify on a real app with the default CocoaPods setup (static libraries, no
use_frameworks!) that:React.framework/RCTI18nStrings.bundleis actually copied intoApp.app/Frameworks/React.framework/andRCTLocalizedStringFromKeyreturns translated strings, andPrivacyInfo.xcprivacyis aggregated into the generated privacy report?Also worth checking
use_frameworks! :linkage => :staticand app-extension / Mac Catalyst targets, which don't always get an embed-frameworks phase.