react-native 0.71.12 → 0.71.14
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/Libraries/ReactNative/AppContainer.js +28 -6
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +1 -1
- package/React/Base/RCTBundleURLProvider.h +33 -2
- package/React/Base/RCTBundleURLProvider.mm +77 -14
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +19 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/jsc/JSCRuntime.cpp +10 -0
- package/package.json +5 -4
- package/scripts/cocoapods/helpers.rb +16 -0
- package/scripts/cocoapods/utils.rb +114 -9
- package/scripts/react_native_pods.rb +6 -3
- package/sdks/hermes-engine/utils/build-apple-framework.sh +8 -1
- package/sdks/hermes-engine/utils/build-hermes-xcode.sh +8 -0
- package/sdks/hermesc/linux64-bin/hermesc +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/Gemfile +1 -0
- package/template/package.json +1 -1
|
@@ -17,6 +17,8 @@ import {type EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
|
17
17
|
import {RootTagContext, createRootTag} from './RootTag';
|
|
18
18
|
import * as React from 'react';
|
|
19
19
|
|
|
20
|
+
const reactDevToolsHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
21
|
+
|
|
20
22
|
type Props = $ReadOnly<{|
|
|
21
23
|
children?: React.Node,
|
|
22
24
|
fabric?: boolean,
|
|
@@ -45,9 +47,17 @@ class AppContainer extends React.Component<Props, State> {
|
|
|
45
47
|
};
|
|
46
48
|
_mainRef: ?React.ElementRef<typeof View>;
|
|
47
49
|
_subscription: ?EventSubscription = null;
|
|
50
|
+
_reactDevToolsAgentListener: ?() => void = null;
|
|
48
51
|
|
|
49
52
|
static getDerivedStateFromError: any = undefined;
|
|
50
53
|
|
|
54
|
+
mountReactDevToolsOverlays(): void {
|
|
55
|
+
const DevtoolsOverlay = require('../Inspector/DevtoolsOverlay').default;
|
|
56
|
+
const devtoolsOverlay = <DevtoolsOverlay inspectedView={this._mainRef} />;
|
|
57
|
+
|
|
58
|
+
this.setState({devtoolsOverlay});
|
|
59
|
+
}
|
|
60
|
+
|
|
51
61
|
componentDidMount(): void {
|
|
52
62
|
if (__DEV__) {
|
|
53
63
|
if (!this.props.internal_excludeInspector) {
|
|
@@ -69,13 +79,21 @@ class AppContainer extends React.Component<Props, State> {
|
|
|
69
79
|
this.setState({inspector});
|
|
70
80
|
},
|
|
71
81
|
);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
|
|
83
|
+
if (reactDevToolsHook != null) {
|
|
84
|
+
if (reactDevToolsHook.reactDevtoolsAgent) {
|
|
85
|
+
// In case if this is not the first AppContainer rendered and React DevTools are already attached
|
|
86
|
+
this.mountReactDevToolsOverlays();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
this._reactDevToolsAgentListener = () =>
|
|
91
|
+
this.mountReactDevToolsOverlays();
|
|
92
|
+
|
|
93
|
+
reactDevToolsHook.on(
|
|
94
|
+
'react-devtools',
|
|
95
|
+
this._reactDevToolsAgentListener,
|
|
77
96
|
);
|
|
78
|
-
this.setState({devtoolsOverlay});
|
|
79
97
|
}
|
|
80
98
|
}
|
|
81
99
|
}
|
|
@@ -85,6 +103,10 @@ class AppContainer extends React.Component<Props, State> {
|
|
|
85
103
|
if (this._subscription != null) {
|
|
86
104
|
this._subscription.remove();
|
|
87
105
|
}
|
|
106
|
+
|
|
107
|
+
if (reactDevToolsHook != null && this._reactDevToolsAgentListener != null) {
|
|
108
|
+
reactDevToolsHook.off('react-devtools', this._reactDevToolsAgentListener);
|
|
109
|
+
}
|
|
88
110
|
}
|
|
89
111
|
|
|
90
112
|
render(): React.Node {
|
|
@@ -256,7 +256,7 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
|
|
|
256
256
|
|
|
257
257
|
- (void)textViewDidChange:(__unused UITextView *)textView
|
|
258
258
|
{
|
|
259
|
-
if (_ignoreNextTextInputCall) {
|
|
259
|
+
if (_ignoreNextTextInputCall && [_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
|
|
260
260
|
_ignoreNextTextInputCall = NO;
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
@@ -101,6 +101,7 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
|
|
|
101
101
|
|
|
102
102
|
@property (nonatomic, assign) BOOL enableMinification;
|
|
103
103
|
@property (nonatomic, assign) BOOL enableDev;
|
|
104
|
+
@property (nonatomic, assign) BOOL inlineSourceMap;
|
|
104
105
|
|
|
105
106
|
/**
|
|
106
107
|
* The scheme/protocol used of the packager, the default is the http protocol
|
|
@@ -125,13 +126,32 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
|
|
|
125
126
|
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
126
127
|
packagerHost:(NSString *)packagerHost
|
|
127
128
|
enableDev:(BOOL)enableDev
|
|
128
|
-
enableMinification:(BOOL)enableMinification
|
|
129
|
+
enableMinification:(BOOL)enableMinification
|
|
130
|
+
__deprecated_msg(
|
|
131
|
+
"Use `jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:` instead");
|
|
132
|
+
|
|
133
|
+
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
134
|
+
packagerHost:(NSString *)packagerHost
|
|
135
|
+
packagerScheme:(NSString *)scheme
|
|
136
|
+
enableDev:(BOOL)enableDev
|
|
137
|
+
enableMinification:(BOOL)enableMinification
|
|
138
|
+
modulesOnly:(BOOL)modulesOnly
|
|
139
|
+
runModule:(BOOL)runModule
|
|
140
|
+
__deprecated_msg(
|
|
141
|
+
"Use jsBundleURLForBundleRoot:packagerHost:enableDev:enableMinification:inlineSourceMap:modulesOnly:runModule:` instead");
|
|
142
|
+
|
|
143
|
+
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
144
|
+
packagerHost:(NSString *)packagerHost
|
|
145
|
+
enableDev:(BOOL)enableDev
|
|
146
|
+
enableMinification:(BOOL)enableMinification
|
|
147
|
+
inlineSourceMap:(BOOL)inlineSourceMap;
|
|
129
148
|
|
|
130
149
|
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
131
150
|
packagerHost:(NSString *)packagerHost
|
|
132
151
|
packagerScheme:(NSString *)scheme
|
|
133
152
|
enableDev:(BOOL)enableDev
|
|
134
153
|
enableMinification:(BOOL)enableMinification
|
|
154
|
+
inlineSourceMap:(BOOL)inlineSourceMap
|
|
135
155
|
modulesOnly:(BOOL)modulesOnly
|
|
136
156
|
runModule:(BOOL)runModule;
|
|
137
157
|
/**
|
|
@@ -142,6 +162,17 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed);
|
|
|
142
162
|
+ (NSURL *)resourceURLForResourcePath:(NSString *)path
|
|
143
163
|
packagerHost:(NSString *)packagerHost
|
|
144
164
|
scheme:(NSString *)scheme
|
|
145
|
-
query:(NSString *)query
|
|
165
|
+
query:(NSString *)query
|
|
166
|
+
__deprecated_msg("Use version with queryItems parameter instead");
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Given a hostname for the packager and a resource path (including "/"), return the URL to the resource.
|
|
170
|
+
* In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged
|
|
171
|
+
* resource if it is not: -resourceURLForResourceRoot:resourceName:resourceExtension:offlineBundle:
|
|
172
|
+
*/
|
|
173
|
+
+ (NSURL *)resourceURLForResourcePath:(NSString *)path
|
|
174
|
+
packagerHost:(NSString *)packagerHost
|
|
175
|
+
scheme:(NSString *)scheme
|
|
176
|
+
queryItems:(NSArray<NSURLQueryItem *> *)queryItems;
|
|
146
177
|
|
|
147
178
|
@end
|
|
@@ -22,10 +22,12 @@ void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed)
|
|
|
22
22
|
kRCTAllowPackagerAccess = allowed;
|
|
23
23
|
}
|
|
24
24
|
#endif
|
|
25
|
+
static NSString *const kRCTPlatformName = @"ios";
|
|
25
26
|
static NSString *const kRCTPackagerSchemeKey = @"RCT_packager_scheme";
|
|
26
27
|
static NSString *const kRCTJsLocationKey = @"RCT_jsLocation";
|
|
27
28
|
static NSString *const kRCTEnableDevKey = @"RCT_enableDev";
|
|
28
29
|
static NSString *const kRCTEnableMinificationKey = @"RCT_enableMinification";
|
|
30
|
+
static NSString *const kRCTInlineSourceMapKey = @"RCT_inlineSourceMap";
|
|
29
31
|
|
|
30
32
|
@implementation RCTBundleURLProvider
|
|
31
33
|
|
|
@@ -183,6 +185,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
183
185
|
packagerScheme:[self packagerScheme]
|
|
184
186
|
enableDev:[self enableDev]
|
|
185
187
|
enableMinification:[self enableMinification]
|
|
188
|
+
inlineSourceMap:[self inlineSourceMap]
|
|
186
189
|
modulesOnly:NO
|
|
187
190
|
runModule:YES];
|
|
188
191
|
}
|
|
@@ -195,6 +198,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
195
198
|
packagerScheme:[self packagerScheme]
|
|
196
199
|
enableDev:[self enableDev]
|
|
197
200
|
enableMinification:[self enableMinification]
|
|
201
|
+
inlineSourceMap:[self inlineSourceMap]
|
|
198
202
|
modulesOnly:YES
|
|
199
203
|
runModule:NO];
|
|
200
204
|
}
|
|
@@ -234,13 +238,29 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
234
238
|
return [[self class] resourceURLForResourcePath:path
|
|
235
239
|
packagerHost:packagerServerHostPort
|
|
236
240
|
scheme:packagerServerScheme
|
|
237
|
-
|
|
241
|
+
queryItems:nil];
|
|
238
242
|
}
|
|
239
243
|
|
|
240
244
|
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
241
245
|
packagerHost:(NSString *)packagerHost
|
|
242
246
|
enableDev:(BOOL)enableDev
|
|
243
247
|
enableMinification:(BOOL)enableMinification
|
|
248
|
+
{
|
|
249
|
+
return [self jsBundleURLForBundleRoot:bundleRoot
|
|
250
|
+
packagerHost:packagerHost
|
|
251
|
+
packagerScheme:nil
|
|
252
|
+
enableDev:enableDev
|
|
253
|
+
enableMinification:enableMinification
|
|
254
|
+
inlineSourceMap:NO
|
|
255
|
+
modulesOnly:NO
|
|
256
|
+
runModule:YES];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
260
|
+
packagerHost:(NSString *)packagerHost
|
|
261
|
+
enableDev:(BOOL)enableDev
|
|
262
|
+
enableMinification:(BOOL)enableMinification
|
|
263
|
+
inlineSourceMap:(BOOL)inlineSourceMap
|
|
244
264
|
|
|
245
265
|
{
|
|
246
266
|
return [self jsBundleURLForBundleRoot:bundleRoot
|
|
@@ -248,6 +268,7 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
248
268
|
packagerScheme:nil
|
|
249
269
|
enableDev:enableDev
|
|
250
270
|
enableMinification:enableMinification
|
|
271
|
+
inlineSourceMap:inlineSourceMap
|
|
251
272
|
modulesOnly:NO
|
|
252
273
|
runModule:YES];
|
|
253
274
|
}
|
|
@@ -259,27 +280,45 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
259
280
|
enableMinification:(BOOL)enableMinification
|
|
260
281
|
modulesOnly:(BOOL)modulesOnly
|
|
261
282
|
runModule:(BOOL)runModule
|
|
283
|
+
{
|
|
284
|
+
return [self jsBundleURLForBundleRoot:bundleRoot
|
|
285
|
+
packagerHost:packagerHost
|
|
286
|
+
packagerScheme:nil
|
|
287
|
+
enableDev:enableDev
|
|
288
|
+
enableMinification:enableMinification
|
|
289
|
+
inlineSourceMap:NO
|
|
290
|
+
modulesOnly:modulesOnly
|
|
291
|
+
runModule:runModule];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot
|
|
295
|
+
packagerHost:(NSString *)packagerHost
|
|
296
|
+
packagerScheme:(NSString *)scheme
|
|
297
|
+
enableDev:(BOOL)enableDev
|
|
298
|
+
enableMinification:(BOOL)enableMinification
|
|
299
|
+
inlineSourceMap:(BOOL)inlineSourceMap
|
|
300
|
+
modulesOnly:(BOOL)modulesOnly
|
|
301
|
+
runModule:(BOOL)runModule
|
|
262
302
|
{
|
|
263
303
|
NSString *path = [NSString stringWithFormat:@"/%@.bundle", bundleRoot];
|
|
304
|
+
BOOL lazy = enableDev;
|
|
305
|
+
NSArray<NSURLQueryItem *> *queryItems = @[
|
|
306
|
+
[[NSURLQueryItem alloc] initWithName:@"platform" value:kRCTPlatformName],
|
|
307
|
+
[[NSURLQueryItem alloc] initWithName:@"dev" value:enableDev ? @"true" : @"false"],
|
|
308
|
+
[[NSURLQueryItem alloc] initWithName:@"minify" value:enableMinification ? @"true" : @"false"],
|
|
309
|
+
[[NSURLQueryItem alloc] initWithName:@"inlineSourceMap" value:inlineSourceMap ? @"true" : @"false"],
|
|
310
|
+
[[NSURLQueryItem alloc] initWithName:@"modulesOnly" value:modulesOnly ? @"true" : @"false"],
|
|
311
|
+
[[NSURLQueryItem alloc] initWithName:@"runModule" value:runModule ? @"true" : @"false"],
|
|
264
312
|
#ifdef HERMES_BYTECODE_VERSION
|
|
265
|
-
|
|
266
|
-
#else
|
|
267
|
-
NSString *runtimeBytecodeVersion = @"";
|
|
313
|
+
[[NSURLQueryItem alloc] initWithName:@"runtimeBytecodeVersion" value:HERMES_BYTECODE_VERSION],
|
|
268
314
|
#endif
|
|
269
|
-
|
|
270
|
-
// When we support only iOS 8 and above, use queryItems for a better API.
|
|
271
|
-
NSString *query = [NSString stringWithFormat:@"platform=ios&dev=%@&minify=%@&modulesOnly=%@&runModule=%@%@",
|
|
272
|
-
enableDev ? @"true" : @"false",
|
|
273
|
-
enableMinification ? @"true" : @"false",
|
|
274
|
-
modulesOnly ? @"true" : @"false",
|
|
275
|
-
runModule ? @"true" : @"false",
|
|
276
|
-
runtimeBytecodeVersion];
|
|
315
|
+
];
|
|
277
316
|
|
|
278
317
|
NSString *bundleID = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleIdentifierKey];
|
|
279
318
|
if (bundleID) {
|
|
280
|
-
|
|
319
|
+
queryItems = [queryItems arrayByAddingObject:[[NSURLQueryItem alloc] initWithName:@"app" value:bundleID]];
|
|
281
320
|
}
|
|
282
|
-
return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme
|
|
321
|
+
return [[self class] resourceURLForResourcePath:path packagerHost:packagerHost scheme:scheme queryItems:queryItems];
|
|
283
322
|
}
|
|
284
323
|
|
|
285
324
|
+ (NSURL *)resourceURLForResourcePath:(NSString *)path
|
|
@@ -296,6 +335,20 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
296
335
|
return components.URL;
|
|
297
336
|
}
|
|
298
337
|
|
|
338
|
+
+ (NSURL *)resourceURLForResourcePath:(NSString *)path
|
|
339
|
+
packagerHost:(NSString *)packagerHost
|
|
340
|
+
scheme:(NSString *)scheme
|
|
341
|
+
queryItems:(NSArray<NSURLQueryItem *> *)queryItems
|
|
342
|
+
{
|
|
343
|
+
NSURLComponents *components = [NSURLComponents componentsWithURL:serverRootWithHostPort(packagerHost, scheme)
|
|
344
|
+
resolvingAgainstBaseURL:NO];
|
|
345
|
+
components.path = path;
|
|
346
|
+
if (queryItems != nil) {
|
|
347
|
+
components.queryItems = queryItems;
|
|
348
|
+
}
|
|
349
|
+
return components.URL;
|
|
350
|
+
}
|
|
351
|
+
|
|
299
352
|
- (void)updateValue:(id)object forKey:(NSString *)key
|
|
300
353
|
{
|
|
301
354
|
[[NSUserDefaults standardUserDefaults] setObject:object forKey:key];
|
|
@@ -313,6 +366,11 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
313
366
|
return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTEnableMinificationKey];
|
|
314
367
|
}
|
|
315
368
|
|
|
369
|
+
- (BOOL)inlineSourceMap
|
|
370
|
+
{
|
|
371
|
+
return [[NSUserDefaults standardUserDefaults] boolForKey:kRCTInlineSourceMapKey];
|
|
372
|
+
}
|
|
373
|
+
|
|
316
374
|
- (NSString *)jsLocation
|
|
317
375
|
{
|
|
318
376
|
return [[NSUserDefaults standardUserDefaults] stringForKey:kRCTJsLocationKey];
|
|
@@ -342,6 +400,11 @@ static NSURL *serverRootWithHostPort(NSString *hostPort, NSString *scheme)
|
|
|
342
400
|
[self updateValue:@(enableMinification) forKey:kRCTEnableMinificationKey];
|
|
343
401
|
}
|
|
344
402
|
|
|
403
|
+
- (void)setInlineSourceMap:(BOOL)inlineSourceMap
|
|
404
|
+
{
|
|
405
|
+
[self updateValue:@(inlineSourceMap) forKey:kRCTInlineSourceMapKey];
|
|
406
|
+
}
|
|
407
|
+
|
|
345
408
|
- (void)setPackagerScheme:(NSString *)packagerScheme
|
|
346
409
|
{
|
|
347
410
|
[self updateValue:packagerScheme forKey:kRCTPackagerSchemeKey];
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -20,6 +20,7 @@ import android.content.pm.PackageManager;
|
|
|
20
20
|
import android.graphics.Color;
|
|
21
21
|
import android.graphics.Typeface;
|
|
22
22
|
import android.hardware.SensorManager;
|
|
23
|
+
import android.os.Build;
|
|
23
24
|
import android.util.Pair;
|
|
24
25
|
import android.view.Gravity;
|
|
25
26
|
import android.view.View;
|
|
@@ -1098,7 +1099,7 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
|
|
|
1098
1099
|
if (!mIsReceiverRegistered) {
|
|
1099
1100
|
IntentFilter filter = new IntentFilter();
|
|
1100
1101
|
filter.addAction(getReloadAppAction(mApplicationContext));
|
|
1101
|
-
mApplicationContext
|
|
1102
|
+
compatRegisterReceiver(mApplicationContext, mReloadAppBroadcastReceiver, filter, true);
|
|
1102
1103
|
mIsReceiverRegistered = true;
|
|
1103
1104
|
}
|
|
1104
1105
|
|
|
@@ -1214,4 +1215,21 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
|
|
|
1214
1215
|
|
|
1215
1216
|
return mSurfaceDelegateFactory.createSurfaceDelegate(moduleName);
|
|
1216
1217
|
}
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* Starting with Android 14, apps and services that target Android 14 and use context-registered
|
|
1221
|
+
* receivers are required to specify a flag to indicate whether or not the receiver should be
|
|
1222
|
+
* exported to all other apps on the device: either RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED
|
|
1223
|
+
*
|
|
1224
|
+
* <p>https://developer.android.com/about/versions/14/behavior-changes-14#runtime-receivers-exported
|
|
1225
|
+
*/
|
|
1226
|
+
private void compatRegisterReceiver(
|
|
1227
|
+
Context context, BroadcastReceiver receiver, IntentFilter filter, boolean exported) {
|
|
1228
|
+
if (Build.VERSION.SDK_INT >= 34 && context.getApplicationInfo().targetSdkVersion >= 34) {
|
|
1229
|
+
context.registerReceiver(
|
|
1230
|
+
receiver, filter, exported ? Context.RECEIVER_EXPORTED : Context.RECEIVER_NOT_EXPORTED);
|
|
1231
|
+
} else {
|
|
1232
|
+
context.registerReceiver(receiver, filter);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1217
1235
|
}
|
|
@@ -300,6 +300,9 @@ class JSCRuntime : public jsi::Runtime {
|
|
|
300
300
|
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0
|
|
301
301
|
#define _JSC_NO_ARRAY_BUFFERS
|
|
302
302
|
#endif
|
|
303
|
+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 160400
|
|
304
|
+
#define _JSC_HAS_INSPECTABLE
|
|
305
|
+
#endif
|
|
303
306
|
#endif
|
|
304
307
|
#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
|
|
305
308
|
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_11
|
|
@@ -396,6 +399,13 @@ JSCRuntime::JSCRuntime(JSGlobalContextRef ctx)
|
|
|
396
399
|
stringCounter_(0)
|
|
397
400
|
#endif
|
|
398
401
|
{
|
|
402
|
+
#ifndef NDEBUG
|
|
403
|
+
#ifdef _JSC_HAS_INSPECTABLE
|
|
404
|
+
if (__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)) {
|
|
405
|
+
JSGlobalContextSetInspectable(ctx_, true);
|
|
406
|
+
}
|
|
407
|
+
#endif
|
|
408
|
+
#endif
|
|
399
409
|
}
|
|
400
410
|
|
|
401
411
|
JSCRuntime::~JSCRuntime() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.71.
|
|
3
|
+
"version": "0.71.14",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
5
|
"description": "A framework for building native apps using React",
|
|
6
6
|
"license": "MIT",
|
|
@@ -103,7 +103,8 @@
|
|
|
103
103
|
"test-typescript": "dtslint types",
|
|
104
104
|
"test-typescript-offline": "dtslint --localTs node_modules/typescript/lib types",
|
|
105
105
|
"bump-all-updated-packages": "node ./scripts/monorepo/bump-all-updated-packages",
|
|
106
|
-
"align-package-versions": "node ./scripts/monorepo/align-package-versions.js"
|
|
106
|
+
"align-package-versions": "node ./scripts/monorepo/align-package-versions.js",
|
|
107
|
+
"trigger-react-native-release": "node ./scripts/trigger-react-native-release.js"
|
|
107
108
|
},
|
|
108
109
|
"peerDependencies": {
|
|
109
110
|
"react": "18.2.0"
|
|
@@ -143,7 +144,7 @@
|
|
|
143
144
|
"use-sync-external-store": "^1.0.0",
|
|
144
145
|
"whatwg-fetch": "^3.0.0",
|
|
145
146
|
"ws": "^6.2.2",
|
|
146
|
-
"react-native-codegen": "^0.71.
|
|
147
|
+
"react-native-codegen": "^0.71.6"
|
|
147
148
|
},
|
|
148
149
|
"devDependencies": {
|
|
149
150
|
"flow-bin": "^0.191.0",
|
|
@@ -182,7 +183,7 @@
|
|
|
182
183
|
"inquirer": "^7.1.0",
|
|
183
184
|
"jest": "^29.2.1",
|
|
184
185
|
"jest-junit": "^10.0.0",
|
|
185
|
-
"jscodeshift": "^0.
|
|
186
|
+
"jscodeshift": "^0.14.0",
|
|
186
187
|
"metro-babel-register": "0.73.10",
|
|
187
188
|
"metro-memory-fs": "0.73.10",
|
|
188
189
|
"mkdirp": "^0.5.1",
|
|
@@ -11,6 +11,14 @@ class SysctlChecker
|
|
|
11
11
|
end
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Helper class that is used to easily send commands to Xcodebuild
|
|
15
|
+
# And that can be subclassed for testing purposes.
|
|
16
|
+
class Xcodebuild
|
|
17
|
+
def self.version
|
|
18
|
+
`xcodebuild -version`
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
14
22
|
# Helper object to wrap system properties like RUBY_PLATFORM
|
|
15
23
|
# This makes it easier to mock the behaviour in tests
|
|
16
24
|
class Environment
|
|
@@ -26,3 +34,11 @@ class Finder
|
|
|
26
34
|
return `find #{path} -type f \\( #{js_files} -or #{ts_files} \\)`.split("\n").sort()
|
|
27
35
|
end
|
|
28
36
|
end
|
|
37
|
+
|
|
38
|
+
module Helpers
|
|
39
|
+
class Constants
|
|
40
|
+
def self.min_ios_version_supported
|
|
41
|
+
return '12.4'
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -60,7 +60,7 @@ class ReactNativePodsUtils
|
|
|
60
60
|
.push(installer.pods_project)
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
# Hermes does not support
|
|
63
|
+
# Hermes does not support 'i386' architecture
|
|
64
64
|
excluded_archs_default = ReactNativePodsUtils.has_pod(installer, 'hermes-engine') ? "i386" : ""
|
|
65
65
|
|
|
66
66
|
projects.each do |project|
|
|
@@ -131,15 +131,29 @@ class ReactNativePodsUtils
|
|
|
131
131
|
end
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
-
def self.apply_xcode_15_patch(installer)
|
|
135
|
-
installer
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
def self.apply_xcode_15_patch(installer, xcodebuild_manager: Xcodebuild)
|
|
135
|
+
projects = self.extract_projects(installer)
|
|
136
|
+
|
|
137
|
+
gcc_preprocessor_definition_key = 'GCC_PREPROCESSOR_DEFINITIONS'
|
|
138
|
+
other_ld_flags_key = 'OTHER_LDFLAGS'
|
|
139
|
+
libcpp_cxx17_fix = '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION'
|
|
140
|
+
xcode15_compatibility_flags = '-Wl -ld_classic '
|
|
141
|
+
|
|
142
|
+
projects.each do |project|
|
|
143
|
+
project.build_configurations.each do |config|
|
|
144
|
+
# fix for unary_function and binary_function
|
|
145
|
+
self.safe_init(config, gcc_preprocessor_definition_key)
|
|
146
|
+
self.add_value_to_setting_if_missing(config, gcc_preprocessor_definition_key, libcpp_cxx17_fix)
|
|
147
|
+
|
|
148
|
+
# fix for weak linking
|
|
149
|
+
self.safe_init(config, other_ld_flags_key)
|
|
150
|
+
if self.is_using_xcode15_or_greter(:xcodebuild_manager => xcodebuild_manager)
|
|
151
|
+
self.add_value_to_setting_if_missing(config, other_ld_flags_key, xcode15_compatibility_flags)
|
|
152
|
+
else
|
|
153
|
+
self.remove_value_from_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags)
|
|
154
|
+
end
|
|
142
155
|
end
|
|
156
|
+
project.save()
|
|
143
157
|
end
|
|
144
158
|
end
|
|
145
159
|
|
|
@@ -197,4 +211,95 @@ class ReactNativePodsUtils
|
|
|
197
211
|
ENV['USE_FRAMEWORKS'] = nil
|
|
198
212
|
end
|
|
199
213
|
end
|
|
214
|
+
|
|
215
|
+
def self.updateIphoneOSDeploymentTarget(installer)
|
|
216
|
+
pod_to_update = Set.new([
|
|
217
|
+
"boost",
|
|
218
|
+
"CocoaAsyncSocket",
|
|
219
|
+
"Flipper",
|
|
220
|
+
"Flipper-DoubleConversion",
|
|
221
|
+
"Flipper-Fmt",
|
|
222
|
+
"Flipper-Boost-iOSX",
|
|
223
|
+
"Flipper-Folly",
|
|
224
|
+
"Flipper-Glog",
|
|
225
|
+
"Flipper-PeerTalk",
|
|
226
|
+
"FlipperKit",
|
|
227
|
+
"fmt",
|
|
228
|
+
"libevent",
|
|
229
|
+
"OpenSSL-Universal",
|
|
230
|
+
"RCT-Folly",
|
|
231
|
+
"SocketRocket",
|
|
232
|
+
"YogaKit"
|
|
233
|
+
])
|
|
234
|
+
|
|
235
|
+
installer.target_installation_results.pod_target_installation_results
|
|
236
|
+
.each do |pod_name, target_installation_result|
|
|
237
|
+
unless pod_to_update.include?(pod_name)
|
|
238
|
+
next
|
|
239
|
+
end
|
|
240
|
+
target_installation_result.native_target.build_configurations.each do |config|
|
|
241
|
+
config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = Helpers::Constants.min_ios_version_supported
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# ========= #
|
|
247
|
+
# Utilities #
|
|
248
|
+
# ========= #
|
|
249
|
+
|
|
250
|
+
def self.extract_projects(installer)
|
|
251
|
+
return installer.aggregate_targets
|
|
252
|
+
.map{ |t| t.user_project }
|
|
253
|
+
.uniq{ |p| p.path }
|
|
254
|
+
.push(installer.pods_project)
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
def self.safe_init(config, setting_name)
|
|
258
|
+
old_config = config.build_settings[setting_name]
|
|
259
|
+
if old_config == nil
|
|
260
|
+
config.build_settings[setting_name] ||= '$(inherited) '
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
def self.add_value_to_setting_if_missing(config, setting_name, value)
|
|
265
|
+
old_config = config.build_settings[setting_name]
|
|
266
|
+
if old_config.is_a?(Array)
|
|
267
|
+
old_config = old_config.join(" ")
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
trimmed_value = value.strip()
|
|
271
|
+
if !old_config.include?(trimmed_value)
|
|
272
|
+
config.build_settings[setting_name] = "#{old_config.strip()} #{trimmed_value}".strip()
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
def self.remove_value_from_setting_if_present(config, setting_name, value)
|
|
277
|
+
old_config = config.build_settings[setting_name]
|
|
278
|
+
if old_config.is_a?(Array)
|
|
279
|
+
old_config = old_config.join(" ")
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
trimmed_value = value.strip()
|
|
283
|
+
if old_config.include?(trimmed_value)
|
|
284
|
+
new_config = old_config.gsub(trimmed_value, "")
|
|
285
|
+
config.build_settings[setting_name] = new_config.strip()
|
|
286
|
+
end
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
def self.is_using_xcode15_or_greter(xcodebuild_manager: Xcodebuild)
|
|
290
|
+
xcodebuild_version = xcodebuild_manager.version
|
|
291
|
+
|
|
292
|
+
# The output of xcodebuild -version is something like
|
|
293
|
+
# Xcode 15.0
|
|
294
|
+
# or
|
|
295
|
+
# Xcode 14.3.1
|
|
296
|
+
# We want to capture the version digits
|
|
297
|
+
regex = /(\d+)\.(\d+)(?:\.(\d+))?/
|
|
298
|
+
if match_data = xcodebuild_version.match(regex)
|
|
299
|
+
major = match_data[1].to_i
|
|
300
|
+
return major >= 15
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
return false
|
|
304
|
+
end
|
|
200
305
|
end
|
|
@@ -15,6 +15,7 @@ require_relative './cocoapods/codegen_utils.rb'
|
|
|
15
15
|
require_relative './cocoapods/utils.rb'
|
|
16
16
|
require_relative './cocoapods/new_architecture.rb'
|
|
17
17
|
require_relative './cocoapods/local_podspec_patch.rb'
|
|
18
|
+
require_relative './cocoapods/helpers.rb'
|
|
18
19
|
|
|
19
20
|
$CODEGEN_OUTPUT_DIR = 'build/generated/ios'
|
|
20
21
|
$CODEGEN_COMPONENT_DIR = 'react/renderer/components'
|
|
@@ -23,11 +24,11 @@ $FOLLY_VERSION = '2021.07.22.00'
|
|
|
23
24
|
|
|
24
25
|
$START_TIME = Time.now.to_i
|
|
25
26
|
|
|
26
|
-
# This function returns the min
|
|
27
|
-
# By using this function, you won't have to
|
|
27
|
+
# This function returns the min supported OS versions supported by React Native
|
|
28
|
+
# By using this function, you won't have to manually change your Podfile
|
|
28
29
|
# when we change the minimum version supported by the framework.
|
|
29
30
|
def min_ios_version_supported
|
|
30
|
-
return
|
|
31
|
+
return Helpers::Constants.min_ios_version_supported
|
|
31
32
|
end
|
|
32
33
|
|
|
33
34
|
# This function prepares the project for React Native, before processing
|
|
@@ -224,11 +225,13 @@ def react_native_post_install(installer, react_native_path = "../node_modules/re
|
|
|
224
225
|
ReactNativePodsUtils.fix_library_search_paths(installer)
|
|
225
226
|
ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path)
|
|
226
227
|
ReactNativePodsUtils.apply_xcode_15_patch(installer)
|
|
228
|
+
ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer)
|
|
227
229
|
|
|
228
230
|
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
|
|
229
231
|
is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == "1"
|
|
230
232
|
NewArchitectureHelper.modify_flags_for_new_architecture(installer, is_new_arch_enabled)
|
|
231
233
|
|
|
234
|
+
|
|
232
235
|
Pod::UI.puts "Pod install took #{Time.now.to_i - $START_TIME} [s] to run".green
|
|
233
236
|
end
|
|
234
237
|
|
|
@@ -52,7 +52,7 @@ function build_host_hermesc {
|
|
|
52
52
|
|
|
53
53
|
# Utility function to configure an Apple framework
|
|
54
54
|
function configure_apple_framework {
|
|
55
|
-
local build_cli_tools enable_bitcode enable_debugger cmake_build_type
|
|
55
|
+
local build_cli_tools enable_bitcode enable_debugger cmake_build_type xcode_15_flags xcode_major_version
|
|
56
56
|
|
|
57
57
|
if [[ $1 == iphoneos || $1 == catalyst ]]; then
|
|
58
58
|
enable_bitcode="true"
|
|
@@ -77,8 +77,15 @@ function configure_apple_framework {
|
|
|
77
77
|
cmake_build_type="MinSizeRel"
|
|
78
78
|
fi
|
|
79
79
|
|
|
80
|
+
xcode_15_flags=""
|
|
81
|
+
xcode_major_version=$(xcodebuild -version | grep -oE '[0-9]*' | head -n 1)
|
|
82
|
+
if [[ $xcode_major_version -ge 15 ]]; then
|
|
83
|
+
xcode_15_flags="LINKER:-ld_classic"
|
|
84
|
+
fi
|
|
85
|
+
|
|
80
86
|
pushd "$HERMES_PATH" > /dev/null || exit 1
|
|
81
87
|
cmake -S . -B "build_$1" \
|
|
88
|
+
-DHERMES_EXTRA_LINKER_FLAGS="$xcode_15_flags" \
|
|
82
89
|
-DHERMES_APPLE_TARGET_PLATFORM:STRING="$1" \
|
|
83
90
|
-DCMAKE_OSX_ARCHITECTURES:STRING="$2" \
|
|
84
91
|
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="$3" \
|
|
@@ -33,6 +33,13 @@ if [ -z "$deployment_target" ]; then
|
|
|
33
33
|
deployment_target=${MACOSX_DEPLOYMENT_TARGET}
|
|
34
34
|
fi
|
|
35
35
|
|
|
36
|
+
xcode_15_flags=""
|
|
37
|
+
xcode_major_version=$(xcodebuild -version | grep -oE '[0-9]*' | head -n 1)
|
|
38
|
+
if [[ $xcode_major_version -ge 15 ]]; then
|
|
39
|
+
echo "########### Using LINKER:-ld_classic ###########"
|
|
40
|
+
xcode_15_flags="LINKER:-ld_classic"
|
|
41
|
+
fi
|
|
42
|
+
|
|
36
43
|
architectures=$( echo "$ARCHS" | tr " " ";" )
|
|
37
44
|
|
|
38
45
|
echo "Configure Apple framework"
|
|
@@ -40,6 +47,7 @@ echo "Configure Apple framework"
|
|
|
40
47
|
"$CMAKE_BINARY" \
|
|
41
48
|
-S "${PODS_ROOT}/hermes-engine" \
|
|
42
49
|
-B "${PODS_ROOT}/hermes-engine/build/${PLATFORM_NAME}" \
|
|
50
|
+
-DHERMES_EXTRA_LINKER_FLAGS="$xcode_15_flags" \
|
|
43
51
|
-DHERMES_APPLE_TARGET_PLATFORM:STRING="$PLATFORM_NAME" \
|
|
44
52
|
-DCMAKE_OSX_ARCHITECTURES:STRING="$architectures" \
|
|
45
53
|
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="$deployment_target" \
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/template/Gemfile
CHANGED