Skip to content

Commit cf53f57

Browse files
Merge pull request #13 from JoaoPauloCMarra/codex/prepare-0-4-4-release
v0.4.4
2 parents d0fe4ec + 2c743b6 commit cf53f57

12 files changed

Lines changed: 558 additions & 163 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project are documented in this file.
44

55
The format follows Keep a Changelog and the project adheres to SemVer.
66

7+
## 0.4.4 - 2026-04-08
8+
9+
### Changed
10+
11+
- Upgrade to **Nitro Modules 0.35.4** and regenerate bindings against the latest stable Nitro 0.35 line.
12+
- Migrate `nitro.json` to the current schema (`$schema`, `ignorePaths`, `gitAttributesGeneratedFlag`, and `autolinking.all.language = "c++"`).
13+
- Raise the published `react-native-nitro-modules` requirement to `>= 0.35.4` so package metadata matches the tested Nitro baseline.
14+
- Refresh root tooling to current patch releases for linting, testing, and workspace orchestration.
15+
- Align the example app to `react-native-nitro-modules 0.35.4`.
16+
- Add an example-only Expo config plugin that patches the generated iOS `fmt` pod during `pod install`, keeping clean prebuilds working on Xcode 26.4.
17+
718
## 0.4.2/0.4.3 - 2026-03-05
819

920
### Fixed
@@ -48,7 +59,7 @@ The format follows Keep a Changelog and the project adheres to SemVer.
4859
- Update `cpp-adapter.cpp` to use `registerAllNatives()` instead of the deprecated `initialize(vm)` shim.
4960
- Upgrade example app to **Expo SDK 55** (`expo ~55.0.4`, `expo-router ~55.0.3`, `expo-status-bar ~55.0.4`, `expo-system-ui ~55.0.9`, `expo-build-properties ~55.0.9`, `expo-asset ~55.0.8`, `babel-preset-expo ~55.0.10`).
5061
- Bump to **React 19.2.0** and **React Native 0.83.2** across workspace and example.
51-
- Update `react-native-screens` to `~4.23.0` and `react-native-safe-area-context` to `5.7.0` in the example app.
62+
- Update `react-native-screens` to `~4.23.0` and `react-native-safe-area-context` to `~5.6.2` in the example app.
5263
- Remove `newArchEnabled` from example `app.json` — Expo SDK 55 dropped Legacy Architecture; new arch is always on.
5364
- Add iOS and Android example build CI jobs that run `expo prebuild` and verify native compilation under New Architecture.
5465
- Add `--provenance` flag to `npm publish` for npm supply-chain attestation.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Every feature in this package is documented with at least one runnable example i
5656
| Dependency | Version |
5757
| ---------------------------- | ----------- |
5858
| `react-native` | `>= 0.75.0` |
59-
| `react-native-nitro-modules` | `>= 0.33.9` |
59+
| `react-native-nitro-modules` | `>= 0.35.4` |
6060
| `react` | `>= 18.2.0` |
6161

6262
## Installation

apps/example/app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
}
2525
}
2626
],
27+
"./plugins/with-fmt-ios-compat",
2728
"react-native-nitro-storage",
2829
"expo-font"
2930
],

apps/example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"react": "19.2.0",
2828
"react-dom": "19.2.0",
2929
"react-native": "0.83.2",
30-
"react-native-nitro-modules": "^0.35.0",
30+
"react-native-nitro-modules": "0.35.4",
3131
"react-native-nitro-storage": "*",
3232
"react-native-safe-area-context": "~5.6.2",
3333
"react-native-screens": "~4.23.0",
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
const { withPodfile, createRunOncePlugin } = require("expo/config-plugins")
2+
3+
const HELPER_NAME = "patch_fmt_xcode_26_compatibility"
4+
5+
const FMT_SOURCE_BLOCK = `// Detect consteval, C++20 constexpr extensions and std::is_constant_evaluated.
6+
#if !defined(__cpp_lib_is_constant_evaluated)
7+
# define FMT_USE_CONSTEVAL 0
8+
#elif FMT_CPLUSPLUS < 201709L
9+
# define FMT_USE_CONSTEVAL 0
10+
#elif FMT_GLIBCXX_RELEASE && FMT_GLIBCXX_RELEASE < 10
11+
# define FMT_USE_CONSTEVAL 0
12+
#elif FMT_LIBCPP_VERSION && FMT_LIBCPP_VERSION < 10000
13+
# define FMT_USE_CONSTEVAL 0
14+
#elif defined(__apple_build_version__) && __apple_build_version__ < 14000029L
15+
# define FMT_USE_CONSTEVAL 0 // consteval is broken in Apple clang < 14.
16+
#elif FMT_MSC_VERSION && FMT_MSC_VERSION < 1929
17+
# define FMT_USE_CONSTEVAL 0 // consteval is broken in MSVC VS2019 < 16.10.
18+
#elif defined(__cpp_consteval)
19+
# define FMT_USE_CONSTEVAL 1
20+
#elif FMT_GCC_VERSION >= 1002 || FMT_CLANG_VERSION >= 1101
21+
# define FMT_USE_CONSTEVAL 1
22+
#else
23+
# define FMT_USE_CONSTEVAL 0
24+
#endif`
25+
26+
const FMT_PATCHED_BLOCK = `// Detect consteval, C++20 constexpr extensions and std::is_constant_evaluated.
27+
#if !defined(FMT_USE_CONSTEVAL)
28+
# if !defined(__cpp_lib_is_constant_evaluated)
29+
# define FMT_USE_CONSTEVAL 0
30+
# elif FMT_CPLUSPLUS < 201709L
31+
# define FMT_USE_CONSTEVAL 0
32+
# elif FMT_GLIBCXX_RELEASE && FMT_GLIBCXX_RELEASE < 10
33+
# define FMT_USE_CONSTEVAL 0
34+
# elif FMT_LIBCPP_VERSION && FMT_LIBCPP_VERSION < 10000
35+
# define FMT_USE_CONSTEVAL 0
36+
# elif defined(__apple_build_version__) && __apple_build_version__ < 14000029L
37+
# define FMT_USE_CONSTEVAL 0 // consteval is broken in Apple clang < 14.
38+
# elif FMT_MSC_VERSION && FMT_MSC_VERSION < 1929
39+
# define FMT_USE_CONSTEVAL 0 // consteval is broken in MSVC VS2019 < 16.10.
40+
# elif defined(__cpp_consteval)
41+
# define FMT_USE_CONSTEVAL 1
42+
# elif FMT_GCC_VERSION >= 1002 || FMT_CLANG_VERSION >= 1101
43+
# define FMT_USE_CONSTEVAL 1
44+
# else
45+
# define FMT_USE_CONSTEVAL 0
46+
# endif
47+
#endif`
48+
49+
const RUBY_HELPER = `
50+
def ${HELPER_NAME}(installer)
51+
installer.pods_project.targets.each do |target|
52+
next unless target.name == 'fmt'
53+
54+
target.build_configurations.each do |build_config|
55+
definitions = build_config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] || ['$(inherited)']
56+
definitions = [definitions] unless definitions.is_a?(Array)
57+
definitions << 'FMT_USE_CONSTEVAL=0' unless definitions.include?('FMT_USE_CONSTEVAL=0')
58+
build_config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = definitions
59+
end
60+
end
61+
62+
base_header = File.join(installer.sandbox.root.to_s, 'fmt', 'include', 'fmt', 'base.h')
63+
return unless File.exist?(base_header)
64+
65+
source = File.read(base_header)
66+
current = <<~'FMT'
67+
${FMT_SOURCE_BLOCK}
68+
FMT
69+
replacement = <<~'FMT'
70+
${FMT_PATCHED_BLOCK}
71+
FMT
72+
73+
if source.include?(current) && !source.include?('#if !defined(FMT_USE_CONSTEVAL)')
74+
File.write(base_header, source.sub(current, replacement))
75+
end
76+
end
77+
`.trim()
78+
79+
function addHelper(contents) {
80+
if (contents.includes(`def ${HELPER_NAME}(installer)`)) {
81+
return contents
82+
}
83+
84+
const anchor = "target 'NitroStorage' do"
85+
if (!contents.includes(anchor)) {
86+
throw new Error(`Could not find Podfile anchor: ${anchor}`)
87+
}
88+
89+
return contents.replace(anchor, `${RUBY_HELPER}\n\n${anchor}`)
90+
}
91+
92+
function addPostInstallCall(contents) {
93+
const call = ` ${HELPER_NAME}(installer)\n`
94+
if (contents.includes(call)) {
95+
return contents
96+
}
97+
98+
return contents.replace(
99+
/( post_install do \|installer\|\n[\s\S]*?)( end\nend)/,
100+
`$1\n${call}$2`,
101+
)
102+
}
103+
104+
const withFmtIosCompat = (config) =>
105+
withPodfile(config, (config) => {
106+
let contents = config.modResults.contents
107+
contents = addHelper(contents)
108+
contents = addPostInstallCall(contents)
109+
config.modResults.contents = contents
110+
return config
111+
})
112+
113+
module.exports = createRunOncePlugin(
114+
withFmtIosCompat,
115+
"with-fmt-ios-compat",
116+
"1.0.0",
117+
)

0 commit comments

Comments
 (0)