Skip to content

Commit 8138f8c

Browse files
cltnschlosserfacebook-github-bot
authored andcommitted
Have cocoapods rebuild FacebookSDKStrings.bundle so xcode processes strings files (#1713)
Summary: The end result is the final product ends up converting the strings files from the current text format to a minified binary plist format. Size change: Before 246,293 bytes (365 KB on disk) After 133,039 bytes (184 KB on disk) Nice ~100KB win for installed app size. I decided to leave the bundle alone instead of breaking out the strings into their own folder because I didn't know if anything else was using the bundle currently. It doesn't look like spm is using it, which is probably a bug. Also I'm not sure if these strings have test coverage or not, but if not I can help make sure various translations are still working correctly. Not sure where exactly these strings are used. To help us review the request, please complete the following: - [x] sign [contributor license agreement](https://code.facebook.com/cla) - [x] I've ensured that all existing tests pass and added tests (when/where necessary) Wasn't sure how to run them all, I assume PR process has CI that will run them. - [x] I've updated the documentation (when/where necessary) and [Changelog](CHANGELOG.md) (when/where necessary) - [x] I've added the proper label to this pull request (e.g. `bug` for bug fixes) I can't add labels. Pull Request resolved: #1713 Test Plan: Create a new iOS project called `CocoaPodsTranslations` and point to the local pods: ``` // Podfile target 'CocoaPodsTranslations' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! # Pods for CocoaPodsTranslations pod 'FBSDKCoreKit', :path => '/Users/joesusnick/fbsource/fbobjc/ios-sdk' pod 'FBSDKLoginKit', :path => '/Users/joesusnick/fbsource/fbobjc/ios-sdk' end ``` Adds localizations for a few languages by hitting the '+' under Localization in the project settings. (You'll need to make sure something is checked in the boxes so just accept whatever the default suggestions are) Then change the schemes's locale in the 'edit scheme' as shown in the video and run. {F609517560} Complete flow to show logout alert dialog: {F609518875} Reviewed By: khp Differential Revision: D27881169 Pulled By: joesus fbshipit-source-id: 0dcb3d641e639a229020012a8b54ee7248ce9098
1 parent 91b2aa8 commit 8138f8c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
99

1010
### Important
1111

12+
**Performance Improvements**
13+
14+
- Cocoapods: FBSDKCoreKit rebuilds FacebookSDKStrings.bundle so xcode processes the strings files into binary plist format. This strips comments and saves ~181KB in disk space for apps. [#1713](https://github.com/facebook/facebook-ios-sdk/pull/1713)
15+
1216
[Full Changelog](https://github.com/facebook/facebook-ios-sdk/compare/v9.2.0...HEAD)
1317

1418
## 9.2.0

FBSDKCoreKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Pod::Spec.new do |s|
5757
'FBSDKCoreKit/FBSDKCoreKit/GraphAPI/*.h'
5858
ss.private_header_files = 'FBSDKCoreKit/FBSDKCoreKit/Internal/**/*.h',
5959
'FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/**/*.h'
60-
ss.resources = 'FacebookSDKStrings.bundle'
60+
ss.resource_bundles = { 'FacebookSDKStrings' => ['FacebookSDKStrings.bundle/**/*.strings'] }
6161
ss.library = 'c++', 'stdc++'
6262
end
6363
end

0 commit comments

Comments
 (0)