Skip to content

Commit 73ba436

Browse files
authored
Merge pull request #2 from tryfoobar/fix/conflicting-event-emitter
fix: conflicting RNEventEmitter name clashes with other libraries
2 parents ac0a81c + d5f3dcb commit 73ba436

File tree

7 files changed

+14
-121
lines changed

7 files changed

+14
-121
lines changed

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ target 'CommandbarExample' do
4444
#
4545
# Note that if you have use_frameworks! enabled, Flipper will not work and
4646
# you should disable the next line.
47-
:flipper_configuration => flipper_config,
47+
# :flipper_configuration => flipper_config,
4848
# An absolute path to your application root.
4949
:app_path => "#{Pod::Config.instance.installation_root}/.."
5050
)

example/ios/Podfile.lock

Lines changed: 3 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
PODS:
22
- boost (1.76.0)
3-
- CocoaAsyncSocket (7.6.5)
43
- CommandBarIOS (1.0.10)
54
- DoubleConversion (1.1.6)
65
- FBLazyVector (0.72.6)
@@ -11,71 +10,12 @@ PODS:
1110
- React-Core (= 0.72.6)
1211
- React-jsi (= 0.72.6)
1312
- ReactCommon/turbomodule/core (= 0.72.6)
14-
- Flipper (0.182.0):
15-
- Flipper-Folly (~> 2.6)
16-
- Flipper-Boost-iOSX (1.76.0.1.11)
17-
- Flipper-DoubleConversion (3.2.0.1)
18-
- Flipper-Fmt (7.1.7)
19-
- Flipper-Folly (2.6.10):
20-
- Flipper-Boost-iOSX
21-
- Flipper-DoubleConversion
22-
- Flipper-Fmt (= 7.1.7)
23-
- Flipper-Glog
24-
- libevent (~> 2.1.12)
25-
- OpenSSL-Universal (= 1.1.1100)
26-
- Flipper-Glog (0.5.0.5)
27-
- Flipper-PeerTalk (0.0.4)
28-
- FlipperKit (0.182.0):
29-
- FlipperKit/Core (= 0.182.0)
30-
- FlipperKit/Core (0.182.0):
31-
- Flipper (~> 0.182.0)
32-
- FlipperKit/CppBridge
33-
- FlipperKit/FBCxxFollyDynamicConvert
34-
- FlipperKit/FBDefines
35-
- FlipperKit/FKPortForwarding
36-
- SocketRocket (~> 0.6.0)
37-
- FlipperKit/CppBridge (0.182.0):
38-
- Flipper (~> 0.182.0)
39-
- FlipperKit/FBCxxFollyDynamicConvert (0.182.0):
40-
- Flipper-Folly (~> 2.6)
41-
- FlipperKit/FBDefines (0.182.0)
42-
- FlipperKit/FKPortForwarding (0.182.0):
43-
- CocoaAsyncSocket (~> 7.6)
44-
- Flipper-PeerTalk (~> 0.0.4)
45-
- FlipperKit/FlipperKitHighlightOverlay (0.182.0)
46-
- FlipperKit/FlipperKitLayoutHelpers (0.182.0):
47-
- FlipperKit/Core
48-
- FlipperKit/FlipperKitHighlightOverlay
49-
- FlipperKit/FlipperKitLayoutTextSearchable
50-
- FlipperKit/FlipperKitLayoutIOSDescriptors (0.182.0):
51-
- FlipperKit/Core
52-
- FlipperKit/FlipperKitHighlightOverlay
53-
- FlipperKit/FlipperKitLayoutHelpers
54-
- YogaKit (~> 1.18)
55-
- FlipperKit/FlipperKitLayoutPlugin (0.182.0):
56-
- FlipperKit/Core
57-
- FlipperKit/FlipperKitHighlightOverlay
58-
- FlipperKit/FlipperKitLayoutHelpers
59-
- FlipperKit/FlipperKitLayoutIOSDescriptors
60-
- FlipperKit/FlipperKitLayoutTextSearchable
61-
- YogaKit (~> 1.18)
62-
- FlipperKit/FlipperKitLayoutTextSearchable (0.182.0)
63-
- FlipperKit/FlipperKitNetworkPlugin (0.182.0):
64-
- FlipperKit/Core
65-
- FlipperKit/FlipperKitReactPlugin (0.182.0):
66-
- FlipperKit/Core
67-
- FlipperKit/FlipperKitUserDefaultsPlugin (0.182.0):
68-
- FlipperKit/Core
69-
- FlipperKit/SKIOSNetworkPlugin (0.182.0):
70-
- FlipperKit/Core
71-
- FlipperKit/FlipperKitNetworkPlugin
7213
- fmt (6.2.1)
7314
- glog (0.3.5)
7415
- hermes-engine (0.72.6):
7516
- hermes-engine/Pre-built (= 0.72.6)
7617
- hermes-engine/Pre-built (0.72.6)
7718
- libevent (2.1.12)
78-
- OpenSSL-Universal (1.1.1100)
7919
- RCT-Folly (2021.07.22.00):
8020
- boost
8121
- DoubleConversion
@@ -376,7 +316,7 @@ PODS:
376316
- React-jsinspector (0.72.6)
377317
- React-logger (0.72.6):
378318
- glog
379-
- react-native-commandbar (1.0.1):
319+
- react-native-commandbar (1.0.2):
380320
- CommandBarIOS (= 1.0.10)
381321
- RCT-Folly (= 2021.07.22.00)
382322
- React-Core
@@ -492,46 +432,22 @@ PODS:
492432
- React-perflogger (= 0.72.6)
493433
- SocketRocket (0.6.1)
494434
- Yoga (1.14.0)
495-
- YogaKit (1.18.1):
496-
- Yoga (~> 1.14)
497435

498436
DEPENDENCIES:
499437
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
500438
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
501439
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
502440
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
503-
- Flipper (= 0.182.0)
504-
- Flipper-Boost-iOSX (= 1.76.0.1.11)
505-
- Flipper-DoubleConversion (= 3.2.0.1)
506-
- Flipper-Fmt (= 7.1.7)
507-
- Flipper-Folly (= 2.6.10)
508-
- Flipper-Glog (= 0.5.0.5)
509-
- Flipper-PeerTalk (= 0.0.4)
510-
- FlipperKit (= 0.182.0)
511-
- FlipperKit/Core (= 0.182.0)
512-
- FlipperKit/CppBridge (= 0.182.0)
513-
- FlipperKit/FBCxxFollyDynamicConvert (= 0.182.0)
514-
- FlipperKit/FBDefines (= 0.182.0)
515-
- FlipperKit/FKPortForwarding (= 0.182.0)
516-
- FlipperKit/FlipperKitHighlightOverlay (= 0.182.0)
517-
- FlipperKit/FlipperKitLayoutPlugin (= 0.182.0)
518-
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.182.0)
519-
- FlipperKit/FlipperKitNetworkPlugin (= 0.182.0)
520-
- FlipperKit/FlipperKitReactPlugin (= 0.182.0)
521-
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.182.0)
522-
- FlipperKit/SKIOSNetworkPlugin (= 0.182.0)
523441
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
524442
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
525443
- libevent (~> 2.1.12)
526-
- OpenSSL-Universal (= 1.1.1100)
527444
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
528445
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
529446
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
530447
- React (from `../node_modules/react-native/`)
531448
- React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
532449
- React-Codegen (from `build/generated/ios`)
533450
- React-Core (from `../node_modules/react-native/`)
534-
- React-Core/DevSupport (from `../node_modules/react-native/`)
535451
- React-Core/RCTWebSocket (from `../node_modules/react-native/`)
536452
- React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
537453
- React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
@@ -563,21 +479,10 @@ DEPENDENCIES:
563479

564480
SPEC REPOS:
565481
trunk:
566-
- CocoaAsyncSocket
567482
- CommandBarIOS
568-
- Flipper
569-
- Flipper-Boost-iOSX
570-
- Flipper-DoubleConversion
571-
- Flipper-Fmt
572-
- Flipper-Folly
573-
- Flipper-Glog
574-
- Flipper-PeerTalk
575-
- FlipperKit
576483
- fmt
577484
- libevent
578-
- OpenSSL-Universal
579485
- SocketRocket
580-
- YogaKit
581486

582487
EXTERNAL SOURCES:
583488
boost:
@@ -664,24 +569,14 @@ EXTERNAL SOURCES:
664569

665570
SPEC CHECKSUMS:
666571
boost: 57d2868c099736d80fcd648bf211b4431e51a558
667-
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
668572
CommandBarIOS: c1a23c99189904541272206b66593ed9008c0d25
669573
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
670574
FBLazyVector: 748c0ef74f2bf4b36cfcccf37916806940a64c32
671575
FBReactNativeSpec: 966f29e4e697de53a3b366355e8f57375c856ad9
672-
Flipper: 6edb735e6c3e332975d1b17956bcc584eccf5818
673-
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
674-
Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30
675-
Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
676-
Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3
677-
Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446
678-
Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
679-
FlipperKit: 2efad7007d6745a3f95e4034d547be637f89d3f6
680576
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
681577
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
682578
hermes-engine: 8057e75cfc1437b178ac86c8654b24e7fead7f60
683579
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
684-
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
685580
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
686581
RCTRequired: 28469809442eb4eb5528462705f7d852948c8a74
687582
RCTTypeSafety: e9c6c409fca2cc584e5b086862d562540cb38d29
@@ -697,7 +592,7 @@ SPEC CHECKSUMS:
697592
React-jsiexecutor: 3bf18ff7cb03cd8dfdce08fbbc0d15058c1d71ae
698593
React-jsinspector: 194e32c6aab382d88713ad3dd0025c5f5c4ee072
699594
React-logger: cebf22b6cf43434e471dc561e5911b40ac01d289
700-
react-native-commandbar: d89f11f54c7b37a6da6bcc853cd716dd78e0510b
595+
react-native-commandbar: d3d448f081992977aab4fe9b056ed1c443ebe362
701596
React-NativeModulesApple: 02e35e9a51e10c6422f04f5e4076a7c02243fff2
702597
React-perflogger: e3596db7e753f51766bceadc061936ef1472edc3
703598
React-RCTActionSheet: 17ab132c748b4471012abbcdcf5befe860660485
@@ -717,8 +612,7 @@ SPEC CHECKSUMS:
717612
ReactCommon: dd03c17275c200496f346af93a7b94c53f3093a4
718613
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
719614
Yoga: b76f1acfda8212aa16b7e26bcce3983230c82603
720-
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
721615

722-
PODFILE CHECKSUM: 06225a65a3da2ed681342fd9abd8d07b9d6df5ba
616+
PODFILE CHECKSUM: 06a2174cbe5a4489922c51f2ca9ad31758bfa9db
723617

724618
COCOAPODS: 1.14.2

ios/HelpHubViewManager.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import CommandBarIOS
22

33

4-
@objc(RNEventEmitter)
5-
class RNEventEmitter : RCTEventEmitter {
4+
@objc(RNCommandBarEventEmitter)
5+
class RNCommandBarEventEmitter : RCTEventEmitter {
66

77
public static var emitter: RCTEventEmitter!
88

99
override init() {
1010
super.init()
11-
RNEventEmitter.emitter = self
11+
RNCommandBarEventEmitter.emitter = self
1212
}
1313

1414
override func supportedEvents() -> [String] {
@@ -46,7 +46,7 @@ class RNHelpHubView : UIView {
4646

4747
extension RNHelpHubView: HelpHubWebViewDelegate {
4848
func didReceiveFallbackAction(_ action: [String : Any]) {
49-
RNEventEmitter.emitter.sendEvent(withName: "onFallbackAction", body: action)
49+
RNCommandBarEventEmitter.emitter.sendEvent(withName: "onFallbackAction", body: action)
5050
}
5151
}
5252

ios/RNCommandBar.mm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ + (BOOL)requiresMainQueueSetup
2424
}
2525
@end
2626

27-
28-
@interface RCT_EXTERN_MODULE(RNEventEmitter, RCTEventEmitter)
27+
@interface RCT_EXTERN_MODULE(RNCommandBarEventEmitter, RCTEventEmitter)
2928

3029
RCT_EXTERN_METHOD(supportedEvents)
3130

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@commandbar/react-native",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Copilot & HelpHub in React Native",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

src/CommandBar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export const RNCommandBar = NativeModules.RNCommandBar
3434
}
3535
);
3636

37-
export const RNEventEmitter = NativeModules.RNEventEmitter
38-
? NativeModules.RNEventEmitter
37+
export const RNCommandBarEventEmitter = NativeModules.RNCommandBarEventEmitter
38+
? NativeModules.RNCommandBarEventEmitter
3939
: new Proxy(
4040
{},
4141
{

src/HelpHubView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from 'react-native';
88
import type { CommandBarOptions } from './CommandBar';
99
import type { ViewStyle } from 'react-native';
10-
import { RNEventEmitter } from './CommandBar';
10+
import { RNCommandBarEventEmitter } from './CommandBar';
1111

1212
export type HelpHubViewProps = {
1313
options: CommandBarOptions;
@@ -17,7 +17,7 @@ export type HelpHubViewProps = {
1717

1818
const EventEmitter =
1919
Platform.OS === 'ios'
20-
? new NativeEventEmitter(RNEventEmitter)
20+
? new NativeEventEmitter(RNCommandBarEventEmitter)
2121
: DeviceEventEmitter;
2222

2323
export const HelpHubViewNative: React.ComponentClass<HelpHubViewProps> =

0 commit comments

Comments
 (0)