react-native-macos 0.72.9 → 0.72.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/DevSupport/RCTInspectorDevServerHelper.mm +15 -5
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/package.json +1 -1
- package/template/package.json +1 -1
package/React/Base/RCTVersion.m
CHANGED
|
@@ -64,12 +64,15 @@ static NSURL *getOpenUrlEndpoint(NSURL *bundleURL)
|
|
|
64
64
|
RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
65
65
|
|
|
66
66
|
static NSMutableDictionary<NSString *, RCTInspectorPackagerConnection *> *socketConnections = nil;
|
|
67
|
+
static NSLock *connectionsLock = [NSLock new];
|
|
67
68
|
|
|
68
69
|
static void sendEventToAllConnections(NSString *event)
|
|
69
70
|
{
|
|
71
|
+
[connectionsLock lock]; // [macOS]
|
|
70
72
|
for (NSString *socketId in socketConnections) {
|
|
71
73
|
[socketConnections[socketId] sendEventToAllConnections:event];
|
|
72
74
|
}
|
|
75
|
+
[connectionsLock unlock]; // [macOS]
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
+ (void)openURL:(NSString *)url withBundleURL:(NSURL *)bundleURL withErrorMessage:(NSString *)errorMessage
|
|
@@ -105,9 +108,11 @@ static void sendEventToAllConnections(NSString *event)
|
|
|
105
108
|
// Note, using a static dictionary isn't really the greatest design, but
|
|
106
109
|
// the packager connection does the same thing, so it's at least consistent.
|
|
107
110
|
// This is a static map that holds different inspector clients per the inspectorURL
|
|
111
|
+
[connectionsLock lock]; // [macOS]
|
|
108
112
|
if (socketConnections == nil) {
|
|
109
113
|
socketConnections = [NSMutableDictionary new];
|
|
110
114
|
}
|
|
115
|
+
[connectionsLock unlock]; // [macOS]
|
|
111
116
|
|
|
112
117
|
NSString *key = [inspectorURL absoluteString];
|
|
113
118
|
// [macOS safety check to avoid a crash
|
|
@@ -116,18 +121,23 @@ static void sendEventToAllConnections(NSString *event)
|
|
|
116
121
|
return nil;
|
|
117
122
|
}
|
|
118
123
|
// macOS]
|
|
119
|
-
|
|
124
|
+
|
|
125
|
+
RCTInspectorPackagerConnection *connection;
|
|
126
|
+
|
|
127
|
+
[connectionsLock lock]; // [macOS]
|
|
128
|
+
connection = socketConnections[key];
|
|
120
129
|
if (!connection || !connection.isConnected) {
|
|
121
130
|
connection = [[RCTInspectorPackagerConnection alloc] initWithURL:inspectorURL];
|
|
122
131
|
// [macOS safety check to avoid a crash
|
|
123
|
-
if (connection
|
|
132
|
+
if (connection != nil) {
|
|
133
|
+
socketConnections[key] = connection;
|
|
134
|
+
[connection connect];
|
|
135
|
+
} else {
|
|
124
136
|
RCTLogError(@"failed to initialize RCTInspectorPackagerConnection");
|
|
125
|
-
return nil;
|
|
126
137
|
}
|
|
127
138
|
// macOS]
|
|
128
|
-
socketConnections[key] = connection;
|
|
129
|
-
[connection connect];
|
|
130
139
|
}
|
|
140
|
+
[connectionsLock unlock]; // [macOS]
|
|
131
141
|
|
|
132
142
|
return connection;
|
|
133
143
|
}
|
package/package.json
CHANGED