Fix: nitro-modules 0.33+ compatibility + Xcode 26 workaround#318
Merged
robertherber merged 2 commits intokingstinct:masterfrom Feb 24, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: a78d484 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Author
commit: |
0c25f09 to
929e76d
Compare
- Migrate isBigInt/getBigInt to isInt64/getInt64 for nitro-modules 0.33+ - Update struct initializers to use explicit constructors (nitro 0.33 breaking change) - Remove readonly from array properties (nitro 0.33 compatibility) - Bump react-native-nitro-modules peer dep to >=0.33 - Add fix-codegen script as temporary workaround for Swift 6.2/Xcode 26 CxxConvertibleToBool issue Fixes kingstinct#302
929e76d to
1d4e74d
Compare
Fix compatibility with nitro-modules 0.33+ and provide Xcode 26 workaround.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Continuation of #303 and #305, I use this package and need to upgrade nitro modules for compatibility with other packages (e.g.
react-native-mmkv@4.x), but the current<0.33peer dep is blocking.nitro-modules 0.33 migration
isBigInt/getBigInt→isInt64/getInt64inQuantityTypeModule.swiftreadonlyremoved from array properties in TS types (nitro 0.33 maps these differently)>=0.33Xcode 26 / Swift 6.2 workaround (
fix-codegenscript)nitrogen's codegen emits
Bool(fromCxx: cachedCxxPart)in every*Spec_cxx.swiftfile. This requiresstd::shared_ptrto conform to Swift'sCxxConvertibleToBoolprotocol. In Swift 6.2 (Xcode 26),shared_ptrno longer gets this conformance autically, causing build failures in all 12 generated spec files.The workaround: A
fix-codegenscript (runs automatically afterbun codegen) replacesBool(fromCxx: cachedCxxPart)withcachedCxxPart.use_count() > 0. it's functionally equivalent.This is a temporary solution until nitrogen fixes the codegen template upstream (the pattern was introduced in nitro v0.31.3 via mrousavy/nitro#996).
Test plan
bun typecheckpassesbun lintpassesbun run build-simsucceedsFixes #302