Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-script-manager-rn-089-callinvoker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@callstack/repack": patch
---

fix(ios): compile `ScriptManager` on React Native 0.89 by declaring `jsCallInvoker` on `RCTBridge` in a Re.Pack-specific category, so the declaration is available on the new architecture after RN 0.89 removed it from `RCTTurboModule.h`.
11 changes: 8 additions & 3 deletions packages/repack/ios/ScriptManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ @interface RCTBridge (JSIRuntime)
- (void *)runtime;
@end

#ifndef RCT_NEW_ARCH_ENABLED
@interface RCTBridge (RCTTurboModule)
// Declare jsCallInvoker ourselves on both architectures. Up to RN 0.88 the new
// architecture got this declaration from RCTBridge (RCTTurboModule) in
// ReactCommon/RCTTurboModule.h; RN 0.89 removed it, which broke new-architecture
// builds with "property 'jsCallInvoker' not found on object of type 'RCTBridge *'".
// A Re.Pack-specific category name avoids duplicating RN's own category on older
// versions, in the same way as the JSIRuntime category above. The method itself is
// still implemented by RN at runtime.
@interface RCTBridge (JSICallInvoker)
- (std::shared_ptr<facebook::react::CallInvoker>)jsCallInvoker;
@end
#endif

static NSURLSession * (^_urlSessionFactory)(void) = nil;
static NSURLSession *_cachedURLSession = nil;
Expand Down