-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add iOS fmt workaround for Xcode 26.4 compatibility #64
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
Merged
joaodordio
merged 5 commits into
main
from
feature/SDK-515-upgrade-expo-to-latest-sdk-versio8n
Jun 30, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
80f5319
feat: add iOS fmt workaround for Xcode 26.4 compatibility
lposen 15d798e
chore: update @iterable/react-native-sdk to version 3.0.0 in package.β¦
lposen e610093
chore: update .gitignore to include .yarn/install-state.gz and ensureβ¦
lposen ba475d5
chore: update @iterable/react-native-sdk to version 3.0.0 in package.β¦
lposen 500ce2c
chore: update .gitignore and removed binaries from tracking
jferrao-itrbl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { | ||
| createMockPodfileConfig, | ||
| createTestConfig, | ||
| type WithIterableResult, | ||
| } from '../__mocks__'; | ||
| import { FMT_WORKAROUND_MARKER } from '../src/withIosFmtWorkaround'; | ||
| import withIterable from '../src/withIterable'; | ||
|
|
||
| const EXPO_PODFILE_SNIPPET = ` | ||
| post_install do |installer| | ||
| react_native_post_install( | ||
| installer, | ||
| config[:reactNativePath], | ||
| :mac_catalyst_enabled => false, | ||
| :ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true', | ||
| ) | ||
| end | ||
| `; | ||
|
|
||
| describe('withIosFmtWorkaround', () => { | ||
| it('injects the fmt workaround after react_native_post_install', async () => { | ||
| const result = withIterable(createTestConfig(), {}) as WithIterableResult; | ||
| const modifiedPodfile = await result.mods.ios.podfile( | ||
| createMockPodfileConfig({ contents: EXPO_PODFILE_SNIPPET }) | ||
| ); | ||
|
|
||
| expect(modifiedPodfile.modResults.contents).toContain( | ||
| FMT_WORKAROUND_MARKER | ||
| ); | ||
| expect(modifiedPodfile.modResults.contents).toContain( | ||
| "config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'" | ||
| ); | ||
| }); | ||
|
|
||
| it('does not inject the workaround twice', async () => { | ||
| const result = withIterable(createTestConfig(), {}) as WithIterableResult; | ||
| const firstPass = await result.mods.ios.podfile( | ||
| createMockPodfileConfig({ contents: EXPO_PODFILE_SNIPPET }) | ||
| ); | ||
| const secondPass = await result.mods.ios.podfile( | ||
| createMockPodfileConfig({ contents: firstPass.modResults.contents }) | ||
| ); | ||
|
|
||
| const markerCount = ( | ||
| secondPass.modResults.contents.match( | ||
| new RegExp( | ||
| FMT_WORKAROUND_MARKER.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), | ||
| 'g' | ||
| ) | ||
| ) || [] | ||
| ).length; | ||
|
|
||
| expect(markerCount).toBe(1); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { ConfigPlugin, withPodfile } from 'expo/config-plugins'; | ||
|
|
||
| /** Marker comment used to avoid injecting the workaround more than once. */ | ||
| export const FMT_WORKAROUND_MARKER = | ||
| '# @iterable/expo-plugin: fmt workaround for Xcode 26.4'; | ||
|
|
||
| /** | ||
| * Compiles the fmt pod in C++17 mode so FMT_USE_CONSTEVAL stays disabled. | ||
| * Required for Xcode 26.4+ when building React Native 0.79+. | ||
| * | ||
| * @see https://github.com/Iterable/react-native-sdk/blob/main/example/ios/Podfile | ||
| */ | ||
| const FMT_WORKAROUND_RUBY = ` | ||
| ${FMT_WORKAROUND_MARKER} | ||
| installer.pods_project.targets.each do |target| | ||
| target.build_configurations.each do |config| | ||
| # fmt/base.h unconditionally redefines FMT_USE_CONSTEVAL based on __cplusplus, | ||
| # so preprocessor defines are overwritten. The reliable fix is to compile fmt | ||
| # in C++17 mode: FMT_CPLUSPLUS (201703L) < 201709L β FMT_USE_CONSTEVAL = 0. | ||
| # All other pods stay in C++20 (React-perflogger needs std::unordered_map::contains). | ||
| if target.name == 'fmt' | ||
| config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17' | ||
| end | ||
| end | ||
| end`; | ||
|
|
||
| export const withIosFmtWorkaround: ConfigPlugin = (config) => { | ||
| return withPodfile(config, (newConfig) => { | ||
| const { contents } = newConfig.modResults; | ||
|
|
||
| if (contents.includes(FMT_WORKAROUND_MARKER)) { | ||
| return newConfig; | ||
| } | ||
|
|
||
| const postInstallMatch = contents.match( | ||
| /(react_native_post_install\([\s\S]*?\n\s*\))/ | ||
| ); | ||
|
|
||
| if (!postInstallMatch) { | ||
| console.warn( | ||
| '@iterable/expo-plugin: Could not inject fmt workaround into Podfile β react_native_post_install block not found' | ||
| ); | ||
| return newConfig; | ||
| } | ||
|
|
||
| newConfig.modResults.contents = contents.replace( | ||
| postInstallMatch[0], | ||
| `${postInstallMatch[0]}${FMT_WORKAROUND_RUBY}` | ||
| ); | ||
|
|
||
| return newConfig; | ||
| }); | ||
| }; | ||
|
|
||
| export default withIosFmtWorkaround; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.