react-native 0.76.7 → 0.76.9
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/AppDelegate/React-RCTAppDelegate.podspec +1 -0
- package/Libraries/Blob/React-RCTBlob.podspec +3 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Network/FormData.js +11 -3
- package/Libraries/Network/RCTDataRequestHandler.mm +17 -3
- package/Libraries/Network/RCTFileRequestHandler.mm +17 -3
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/React-CoreModules.podspec +9 -10
- package/React/CxxModule/RCTCxxMethod.mm +10 -2
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +1 -7
- package/React/Fabric/Surface/RCTFabricSurface.mm +1 -0
- package/React/React-RCTFabric.podspec +1 -0
- package/React/third-party.xcconfig +1 -1
- package/React-Core.podspec +2 -1
- package/ReactAndroid/api/ReactAndroid.api +1 -1
- package/ReactAndroid/build.gradle.kts +24 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/HMRClient.java +4 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +13 -8
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -0
- package/ReactAndroid/src/main/jni/third-party/fast_float/CMakeLists.txt +13 -0
- package/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +5 -6
- package/ReactCommon/React-Fabric.podspec +2 -1
- package/ReactCommon/React-FabricComponents.podspec +3 -1
- package/ReactCommon/React-FabricImage.podspec +7 -5
- package/ReactCommon/ReactCommon.podspec +9 -8
- package/ReactCommon/cxxreact/CxxNativeModule.cpp +6 -3
- package/ReactCommon/cxxreact/React-cxxreact.podspec +11 -10
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/React-hermes.podspec +7 -6
- package/ReactCommon/jsi/React-jsi.podspec +4 -3
- package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +7 -6
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +4 -4
- package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +24 -13
- package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +3 -1
- package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +4 -2
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +4 -2
- package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +24 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +1 -43
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +4 -5
- package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -0
- package/cli.js +11 -2
- package/gradle/libs.versions.toml +3 -2
- package/package.json +8 -8
- package/react-native.config.js +24 -23
- package/scripts/cocoapods/codegen_utils.rb +1 -2
- package/scripts/cocoapods/helpers.rb +13 -1
- package/scripts/cocoapods/new_architecture.rb +1 -0
- package/scripts/cocoapods/utils.rb +2 -0
- package/scripts/react_native_pods.rb +14 -0
- package/sdks/hermesc/linux64-bin/hermesc +0 -0
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
- package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
- package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
- package/third-party-podspecs/RCT-Folly.podspec +16 -7
- package/third-party-podspecs/fast_float.podspec +29 -0
- package/third-party-podspecs/fmt.podspec +2 -2
|
@@ -32,6 +32,7 @@ header_search_paths = [
|
|
|
32
32
|
"$(PODS_ROOT)/Headers/Private/React-Core",
|
|
33
33
|
"$(PODS_ROOT)/boost",
|
|
34
34
|
"$(PODS_ROOT)/DoubleConversion",
|
|
35
|
+
"$(PODS_ROOT)/fast_float/include",
|
|
35
36
|
"$(PODS_ROOT)/fmt/include",
|
|
36
37
|
"$(PODS_ROOT)/RCT-Folly",
|
|
37
38
|
"${PODS_ROOT}/Headers/Public/FlipperKit",
|
|
@@ -24,6 +24,7 @@ header_search_paths = [
|
|
|
24
24
|
"\"$(PODS_ROOT)/RCT-Folly\"",
|
|
25
25
|
"\"$(PODS_ROOT)/boost\"",
|
|
26
26
|
"\"$(PODS_ROOT)/DoubleConversion\"",
|
|
27
|
+
"\"$(PODS_ROOT)/fast_float/include\"",
|
|
27
28
|
"\"$(PODS_ROOT)/fmt/include\"",
|
|
28
29
|
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
|
|
29
30
|
]
|
|
@@ -48,7 +49,8 @@ Pod::Spec.new do |s|
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
s.dependency "DoubleConversion"
|
|
51
|
-
s.dependency "
|
|
52
|
+
s.dependency "fast_float"
|
|
53
|
+
s.dependency "fmt"
|
|
52
54
|
s.dependency "RCT-Folly", folly_version
|
|
53
55
|
s.dependency "React-jsi"
|
|
54
56
|
s.dependency "React-Core/RCTBlobHeaders"
|
|
@@ -28,6 +28,15 @@ type FormDataPart =
|
|
|
28
28
|
...
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Encode a FormData filename compliant with RFC 2183
|
|
33
|
+
*
|
|
34
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#directives
|
|
35
|
+
*/
|
|
36
|
+
function encodeFilename(filename: string): string {
|
|
37
|
+
return encodeURIComponent(filename.replace(/\//g, '_'));
|
|
38
|
+
}
|
|
39
|
+
|
|
31
40
|
/**
|
|
32
41
|
* Polyfill for XMLHttpRequest2 FormData API, allowing multipart POST requests
|
|
33
42
|
* with mixed data (string, native files) to be submitted via XMLHttpRequest.
|
|
@@ -82,9 +91,8 @@ class FormData {
|
|
|
82
91
|
// content type (cf. web Blob interface.)
|
|
83
92
|
if (typeof value === 'object' && !Array.isArray(value) && value) {
|
|
84
93
|
if (typeof value.name === 'string') {
|
|
85
|
-
headers['content-disposition'] +=
|
|
86
|
-
value.name
|
|
87
|
-
}"; filename*=utf-8''${encodeURI(value.name)}`;
|
|
94
|
+
headers['content-disposition'] +=
|
|
95
|
+
`; filename="${encodeFilename(value.name)}"`;
|
|
88
96
|
}
|
|
89
97
|
if (typeof value.type === 'string') {
|
|
90
98
|
headers['content-type'] = value.type;
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
#import <React/RCTDataRequestHandler.h>
|
|
9
9
|
#import <ReactCommon/RCTTurboModule.h>
|
|
10
10
|
|
|
11
|
+
#import <mutex>
|
|
12
|
+
|
|
11
13
|
#import "RCTNetworkPlugins.h"
|
|
12
14
|
|
|
13
15
|
@interface RCTDataRequestHandler () <RCTTurboModule>
|
|
@@ -15,14 +17,22 @@
|
|
|
15
17
|
|
|
16
18
|
@implementation RCTDataRequestHandler {
|
|
17
19
|
NSOperationQueue *_queue;
|
|
20
|
+
std::mutex _operationHandlerMutexLock;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
RCT_EXPORT_MODULE()
|
|
21
24
|
|
|
22
25
|
- (void)invalidate
|
|
23
26
|
{
|
|
24
|
-
|
|
25
|
-
_queue
|
|
27
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
28
|
+
if (_queue) {
|
|
29
|
+
for (NSOperation *operation in _queue.operations) {
|
|
30
|
+
if (!operation.isCancelled && !operation.isFinished) {
|
|
31
|
+
[operation cancel];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
_queue = nil;
|
|
35
|
+
}
|
|
26
36
|
}
|
|
27
37
|
|
|
28
38
|
- (BOOL)canHandleRequest:(NSURLRequest *)request
|
|
@@ -32,6 +42,7 @@ RCT_EXPORT_MODULE()
|
|
|
32
42
|
|
|
33
43
|
- (NSOperation *)sendRequest:(NSURLRequest *)request withDelegate:(id<RCTURLRequestDelegate>)delegate
|
|
34
44
|
{
|
|
45
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
35
46
|
// Lazy setup
|
|
36
47
|
if (!_queue) {
|
|
37
48
|
_queue = [NSOperationQueue new];
|
|
@@ -69,7 +80,10 @@ RCT_EXPORT_MODULE()
|
|
|
69
80
|
|
|
70
81
|
- (void)cancelRequest:(NSOperation *)op
|
|
71
82
|
{
|
|
72
|
-
|
|
83
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
84
|
+
if (!op.isCancelled && !op.isFinished) {
|
|
85
|
+
[op cancel];
|
|
86
|
+
}
|
|
73
87
|
}
|
|
74
88
|
|
|
75
89
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
#import <React/RCTFileRequestHandler.h>
|
|
9
9
|
|
|
10
|
+
#import <mutex>
|
|
11
|
+
|
|
10
12
|
#import <MobileCoreServices/MobileCoreServices.h>
|
|
11
13
|
|
|
12
14
|
#import <React/RCTUtils.h>
|
|
@@ -19,14 +21,22 @@
|
|
|
19
21
|
|
|
20
22
|
@implementation RCTFileRequestHandler {
|
|
21
23
|
NSOperationQueue *_fileQueue;
|
|
24
|
+
std::mutex _operationHandlerMutexLock;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
RCT_EXPORT_MODULE()
|
|
25
28
|
|
|
26
29
|
- (void)invalidate
|
|
27
30
|
{
|
|
28
|
-
|
|
29
|
-
_fileQueue
|
|
31
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
32
|
+
if (_fileQueue) {
|
|
33
|
+
for (NSOperation *operation in _fileQueue.operations) {
|
|
34
|
+
if (!operation.isCancelled && !operation.isFinished) {
|
|
35
|
+
[operation cancel];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
_fileQueue = nil;
|
|
39
|
+
}
|
|
30
40
|
}
|
|
31
41
|
|
|
32
42
|
- (BOOL)canHandleRequest:(NSURLRequest *)request
|
|
@@ -36,6 +46,7 @@ RCT_EXPORT_MODULE()
|
|
|
36
46
|
|
|
37
47
|
- (NSOperation *)sendRequest:(NSURLRequest *)request withDelegate:(id<RCTURLRequestDelegate>)delegate
|
|
38
48
|
{
|
|
49
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
39
50
|
// Lazy setup
|
|
40
51
|
if (!_fileQueue) {
|
|
41
52
|
_fileQueue = [NSOperationQueue new];
|
|
@@ -83,7 +94,10 @@ RCT_EXPORT_MODULE()
|
|
|
83
94
|
|
|
84
95
|
- (void)cancelRequest:(NSOperation *)op
|
|
85
96
|
{
|
|
86
|
-
|
|
97
|
+
std::lock_guard<std::mutex> lock(_operationHandlerMutexLock);
|
|
98
|
+
if (!op.isCancelled && !op.isFinished) {
|
|
99
|
+
[op cancel];
|
|
100
|
+
}
|
|
87
101
|
}
|
|
88
102
|
|
|
89
103
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -20,14 +20,12 @@ folly_config = get_folly_config()
|
|
|
20
20
|
folly_compiler_flags = folly_config[:compiler_flags]
|
|
21
21
|
folly_version = folly_config[:version]
|
|
22
22
|
|
|
23
|
-
socket_rocket_config = get_socket_rocket_config()
|
|
24
|
-
socket_rocket_version = socket_rocket_config[:version]
|
|
25
|
-
|
|
26
23
|
header_search_paths = [
|
|
27
24
|
"\"$(PODS_ROOT)/boost\"",
|
|
28
25
|
"\"$(PODS_TARGET_SRCROOT)/React/CoreModules\"",
|
|
29
26
|
"\"$(PODS_ROOT)/RCT-Folly\"",
|
|
30
27
|
"\"$(PODS_ROOT)/DoubleConversion\"",
|
|
28
|
+
"\"$(PODS_ROOT)/fast_float/include\"",
|
|
31
29
|
"\"$(PODS_ROOT)/fmt/include\"",
|
|
32
30
|
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
|
|
33
31
|
]
|
|
@@ -51,14 +49,15 @@ Pod::Spec.new do |s|
|
|
|
51
49
|
}
|
|
52
50
|
s.framework = "UIKit"
|
|
53
51
|
s.dependency "DoubleConversion"
|
|
54
|
-
s.dependency "
|
|
55
|
-
s.dependency "
|
|
56
|
-
s.dependency "
|
|
57
|
-
s.dependency "
|
|
58
|
-
s.dependency "React-
|
|
59
|
-
s.dependency "React-
|
|
52
|
+
s.dependency "fast_float"
|
|
53
|
+
s.dependency "fmt"
|
|
54
|
+
s.dependency "RCT-Folly"
|
|
55
|
+
s.dependency "RCTTypeSafety"
|
|
56
|
+
s.dependency "React-Core/CoreModulesHeaders"
|
|
57
|
+
s.dependency "React-RCTImage"
|
|
58
|
+
s.dependency "React-jsi"
|
|
60
59
|
s.dependency 'React-RCTBlob'
|
|
61
|
-
s.dependency "SocketRocket"
|
|
60
|
+
s.dependency "SocketRocket"
|
|
62
61
|
add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
|
|
63
62
|
|
|
64
63
|
add_dependency(s, "ReactCodegen")
|
|
@@ -98,14 +98,22 @@ using namespace facebook::react;
|
|
|
98
98
|
NSNumber *id2 = arguments[arguments.count - 1];
|
|
99
99
|
|
|
100
100
|
second = ^(std::vector<folly::dynamic> args) {
|
|
101
|
-
|
|
101
|
+
folly::dynamic obj = folly::dynamic::array;
|
|
102
|
+
for (auto &arg : args) {
|
|
103
|
+
obj.push_back(std::move(arg));
|
|
104
|
+
}
|
|
105
|
+
[bridge enqueueCallback:id2 args:convertFollyDynamicToId(std::move(obj))];
|
|
102
106
|
};
|
|
103
107
|
} else {
|
|
104
108
|
id1 = arguments[arguments.count - 1];
|
|
105
109
|
}
|
|
106
110
|
|
|
107
111
|
first = ^(std::vector<folly::dynamic> args) {
|
|
108
|
-
|
|
112
|
+
folly::dynamic obj = folly::dynamic::array;
|
|
113
|
+
for (auto &arg : args) {
|
|
114
|
+
obj.push_back(std::move(arg));
|
|
115
|
+
}
|
|
116
|
+
[bridge enqueueCallback:id1 args:convertFollyDynamicToId(std::move(obj))];
|
|
109
117
|
};
|
|
110
118
|
}
|
|
111
119
|
|
|
@@ -99,11 +99,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
99
99
|
NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
|
|
100
100
|
[_backedTextInputView.defaultTextAttributes mutableCopy];
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new];
|
|
104
|
-
eventEmitterWrapper.eventEmitter = _eventEmitter;
|
|
105
|
-
defaultAttributes[RCTAttributedStringEventEmitterKey] = eventEmitterWrapper;
|
|
106
|
-
#endif
|
|
102
|
+
defaultAttributes[RCTAttributedStringEventEmitterKey] = RCTWrapEventEmitter(_eventEmitter);
|
|
107
103
|
|
|
108
104
|
_backedTextInputView.defaultTextAttributes = defaultAttributes;
|
|
109
105
|
}
|
|
@@ -263,10 +259,8 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
263
259
|
if (newTextInputProps.textAttributes != oldTextInputProps.textAttributes) {
|
|
264
260
|
NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
|
|
265
261
|
RCTNSTextAttributesFromTextAttributes(newTextInputProps.getEffectiveTextAttributes(RCTFontSizeMultiplier()));
|
|
266
|
-
#if !TARGET_OS_MACCATALYST
|
|
267
262
|
defaultAttributes[RCTAttributedStringEventEmitterKey] =
|
|
268
263
|
_backedTextInputView.defaultTextAttributes[RCTAttributedStringEventEmitterKey];
|
|
269
|
-
#endif
|
|
270
264
|
_backedTextInputView.defaultTextAttributes = defaultAttributes;
|
|
271
265
|
}
|
|
272
266
|
|
|
@@ -142,6 +142,7 @@ using namespace facebook::react;
|
|
|
142
142
|
|
|
143
143
|
if (!_view) {
|
|
144
144
|
_view = [[RCTSurfaceView alloc] initWithSurface:(RCTSurface *)self];
|
|
145
|
+
[self _updateLayoutContext];
|
|
145
146
|
_touchHandler = [RCTSurfaceTouchHandler new];
|
|
146
147
|
[_touchHandler attachToView:_view];
|
|
147
148
|
}
|
|
@@ -26,6 +26,7 @@ header_search_paths = [
|
|
|
26
26
|
"\"$(PODS_TARGET_SRCROOT)/ReactCommon\"",
|
|
27
27
|
"\"$(PODS_ROOT)/boost\"",
|
|
28
28
|
"\"$(PODS_ROOT)/DoubleConversion\"",
|
|
29
|
+
"\"$(PODS_ROOT)/fast_float/include\"",
|
|
29
30
|
"\"$(PODS_ROOT)/fmt/include\"",
|
|
30
31
|
"\"$(PODS_ROOT)/RCT-Folly\"",
|
|
31
32
|
"\"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
// LICENSE file in the root directory of this source tree.
|
|
9
9
|
//
|
|
10
10
|
|
|
11
|
-
HEADER_SEARCH_PATHS = $(SRCROOT)/../third-party/boost_1_83_0 $(SRCROOT)/../third-party/folly-2024.
|
|
11
|
+
HEADER_SEARCH_PATHS = $(SRCROOT)/../third-party/boost_1_83_0 $(SRCROOT)/../third-party/folly-2024.10.14.00 $(SRCROOT)/../third-party/glog-0.3.5/src
|
|
12
12
|
OTHER_CFLAGS = -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1
|
package/React-Core.podspec
CHANGED
|
@@ -21,7 +21,7 @@ folly_compiler_flags = folly_config[:compiler_flags]
|
|
|
21
21
|
folly_version = folly_config[:version]
|
|
22
22
|
|
|
23
23
|
socket_rocket_config = get_socket_rocket_config()
|
|
24
|
-
socket_rocket_version = socket_rocket_config[:version]
|
|
24
|
+
socket_rocket_version = socket_rocket_config[:version]
|
|
25
25
|
|
|
26
26
|
boost_compiler_flags = '-Wno-documentation'
|
|
27
27
|
|
|
@@ -49,6 +49,7 @@ header_search_paths = [
|
|
|
49
49
|
"$(PODS_TARGET_SRCROOT)/ReactCommon",
|
|
50
50
|
"$(PODS_ROOT)/boost",
|
|
51
51
|
"$(PODS_ROOT)/DoubleConversion",
|
|
52
|
+
"$(PODS_ROOT)/fast_float/include",
|
|
52
53
|
"$(PODS_ROOT)/fmt/include",
|
|
53
54
|
"$(PODS_ROOT)/RCT-Folly",
|
|
54
55
|
"${PODS_ROOT}/Headers/Public/FlipperKit",
|
|
@@ -2248,7 +2248,7 @@ public abstract interface class com/facebook/react/devsupport/HMRClient : com/fa
|
|
|
2248
2248
|
public abstract fun disable ()V
|
|
2249
2249
|
public abstract fun enable ()V
|
|
2250
2250
|
public abstract fun registerBundle (Ljava/lang/String;)V
|
|
2251
|
-
public abstract fun setup (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;
|
|
2251
|
+
public abstract fun setup (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZLjava/lang/String;)V
|
|
2252
2252
|
}
|
|
2253
2253
|
|
|
2254
2254
|
public final class com/facebook/react/devsupport/InspectorFlags {
|
|
@@ -66,6 +66,7 @@ val prefabHeadersDir = project.file("$buildDir/prefab-headers")
|
|
|
66
66
|
// Native versions which are defined inside the version catalog (libs.versions.toml)
|
|
67
67
|
val BOOST_VERSION = libs.versions.boost.get()
|
|
68
68
|
val DOUBLE_CONVERSION_VERSION = libs.versions.doubleconversion.get()
|
|
69
|
+
val FAST_FLOAT_VERSION = libs.versions.fastFloat.get()
|
|
69
70
|
val FMT_VERSION = libs.versions.fmt.get()
|
|
70
71
|
val FOLLY_VERSION = libs.versions.folly.get()
|
|
71
72
|
val GLOG_VERSION = libs.versions.glog.get()
|
|
@@ -179,6 +180,7 @@ val preparePrefab by
|
|
|
179
180
|
// react_nativemodule_core
|
|
180
181
|
Pair(File(buildDir, "third-party-ndk/boost/boost_1_83_0/").absolutePath, ""),
|
|
181
182
|
Pair(File(buildDir, "third-party-ndk/double-conversion/").absolutePath, ""),
|
|
183
|
+
Pair(File(buildDir, "third-party-ndk/fast_float/include/").absolutePath, ""),
|
|
182
184
|
Pair(File(buildDir, "third-party-ndk/fmt/include/").absolutePath, ""),
|
|
183
185
|
Pair(File(buildDir, "third-party-ndk/folly/").absolutePath, ""),
|
|
184
186
|
Pair(File(buildDir, "third-party-ndk/glog/exported/").absolutePath, ""),
|
|
@@ -304,6 +306,27 @@ val prepareFolly by
|
|
|
304
306
|
includeEmptyDirs = false
|
|
305
307
|
into("$thirdPartyNdkDir/folly")
|
|
306
308
|
}
|
|
309
|
+
val downloadFastFloat by
|
|
310
|
+
tasks.creating(Download::class) {
|
|
311
|
+
dependsOn(createNativeDepsDirectories)
|
|
312
|
+
src("https://github.com/fastfloat/fast_float/archive/v${FAST_FLOAT_VERSION}.tar.gz")
|
|
313
|
+
onlyIfModified(true)
|
|
314
|
+
overwrite(false)
|
|
315
|
+
retries(5)
|
|
316
|
+
quiet(true)
|
|
317
|
+
dest(File(downloadsDir, "fast_float-${FAST_FLOAT_VERSION}.tar.gz"))
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
val prepareFastFloat by
|
|
321
|
+
tasks.registering(Copy::class) {
|
|
322
|
+
dependsOn(if (dependenciesPath != null) emptyList() else listOf(downloadFastFloat))
|
|
323
|
+
from(dependenciesPath ?: tarTree(downloadFastFloat.dest))
|
|
324
|
+
from("src/main/jni/third-party/fast_float/")
|
|
325
|
+
include("fast_float-${FAST_FLOAT_VERSION}/include/**/*", "CMakeLists.txt")
|
|
326
|
+
eachFile { this.path = this.path.removePrefix("fast_float-${FAST_FLOAT_VERSION}/") }
|
|
327
|
+
includeEmptyDirs = false
|
|
328
|
+
into("$thirdPartyNdkDir/fast_float")
|
|
329
|
+
}
|
|
307
330
|
|
|
308
331
|
val downloadFmt by
|
|
309
332
|
tasks.creating(Download::class) {
|
|
@@ -541,6 +564,7 @@ android {
|
|
|
541
564
|
"generateCodegenArtifactsFromSchema",
|
|
542
565
|
prepareBoost,
|
|
543
566
|
prepareDoubleConversion,
|
|
567
|
+
prepareFastFloat,
|
|
544
568
|
prepareFmt,
|
|
545
569
|
prepareFolly,
|
|
546
570
|
prepareGlog,
|
|
@@ -696,10 +696,12 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
|
|
|
696
696
|
URL sourceUrl = new URL(getSourceUrl());
|
|
697
697
|
String path = sourceUrl.getPath().substring(1); // strip initial slash in path
|
|
698
698
|
String host = sourceUrl.getHost();
|
|
699
|
+
String scheme = sourceUrl.getProtocol();
|
|
699
700
|
int port = sourceUrl.getPort() != -1 ? sourceUrl.getPort() : sourceUrl.getDefaultPort();
|
|
700
701
|
mCurrentContext
|
|
701
702
|
.getJSModule(HMRClient.class)
|
|
702
|
-
.setup(
|
|
703
|
+
.setup(
|
|
704
|
+
"android", path, host, port, mDevSettings.isHotModuleReplacementEnabled(), scheme);
|
|
703
705
|
} catch (MalformedURLException e) {
|
|
704
706
|
showNewJavaError(e.getMessage(), e);
|
|
705
707
|
}
|
|
@@ -26,8 +26,11 @@ public interface HMRClient extends JavaScriptModule {
|
|
|
26
26
|
* @param host The host that the HMRClient should communicate with.
|
|
27
27
|
* @param port The port that the HMRClient should communicate with on the host.
|
|
28
28
|
* @param isEnabled Whether HMR is enabled initially.
|
|
29
|
+
* @param scheme The protocol that the HMRClient should communicate with on the host (defaults to
|
|
30
|
+
* http).
|
|
29
31
|
*/
|
|
30
|
-
void setup(
|
|
32
|
+
void setup(
|
|
33
|
+
String platform, String bundleEntry, String host, int port, boolean isEnabled, String scheme);
|
|
31
34
|
|
|
32
35
|
/** Registers an additional JS bundle with HMRClient. */
|
|
33
36
|
void registerBundle(String bundleUrl);
|
|
@@ -172,7 +172,7 @@ public class FabricUIManager
|
|
|
172
172
|
private final CopyOnWriteArrayList<UIManagerListener> mListeners = new CopyOnWriteArrayList<>();
|
|
173
173
|
|
|
174
174
|
private boolean mMountNotificationScheduled = false;
|
|
175
|
-
private
|
|
175
|
+
private List<Integer> mSurfaceIdsWithPendingMountNotification = new ArrayList<>();
|
|
176
176
|
|
|
177
177
|
@ThreadConfined(UI)
|
|
178
178
|
@NonNull
|
|
@@ -1257,12 +1257,15 @@ public class FabricUIManager
|
|
|
1257
1257
|
|
|
1258
1258
|
// Collect surface IDs for all the mount items
|
|
1259
1259
|
for (MountItem mountItem : mountItems) {
|
|
1260
|
-
if (mountItem != null
|
|
1261
|
-
|
|
1260
|
+
if (mountItem != null
|
|
1261
|
+
&& !mSurfaceIdsWithPendingMountNotification.contains(mountItem.getSurfaceId())) {
|
|
1262
|
+
mSurfaceIdsWithPendingMountNotification.add(mountItem.getSurfaceId());
|
|
1262
1263
|
}
|
|
1263
1264
|
}
|
|
1264
1265
|
|
|
1265
|
-
if (!mMountNotificationScheduled && !
|
|
1266
|
+
if (!mMountNotificationScheduled && !mSurfaceIdsWithPendingMountNotification.isEmpty()) {
|
|
1267
|
+
mMountNotificationScheduled = true;
|
|
1268
|
+
|
|
1266
1269
|
// Notify mount when the effects are visible and prevent mount hooks to
|
|
1267
1270
|
// delay paint.
|
|
1268
1271
|
UiThreadUtil.getUiThreadHandler()
|
|
@@ -1272,17 +1275,19 @@ public class FabricUIManager
|
|
|
1272
1275
|
public void run() {
|
|
1273
1276
|
mMountNotificationScheduled = false;
|
|
1274
1277
|
|
|
1278
|
+
// Create a copy in case mount hooks trigger more mutations
|
|
1279
|
+
final List<Integer> surfaceIdsToReportMount =
|
|
1280
|
+
mSurfaceIdsWithPendingMountNotification;
|
|
1281
|
+
mSurfaceIdsWithPendingMountNotification = new ArrayList<>();
|
|
1282
|
+
|
|
1275
1283
|
final @Nullable Binding binding = mBinding;
|
|
1276
1284
|
if (binding == null || mDestroyed) {
|
|
1277
|
-
mMountedSurfaceIds.clear();
|
|
1278
1285
|
return;
|
|
1279
1286
|
}
|
|
1280
1287
|
|
|
1281
|
-
for (int surfaceId :
|
|
1288
|
+
for (int surfaceId : surfaceIdsToReportMount) {
|
|
1282
1289
|
binding.reportMount(surfaceId);
|
|
1283
1290
|
}
|
|
1284
|
-
|
|
1285
|
-
mMountedSurfaceIds.clear();
|
|
1286
1291
|
}
|
|
1287
1292
|
});
|
|
1288
1293
|
}
|
|
@@ -49,6 +49,7 @@ add_library(fbjni ALIAS fbjni::fbjni)
|
|
|
49
49
|
add_react_third_party_ndk_subdir(glog)
|
|
50
50
|
add_react_third_party_ndk_subdir(boost)
|
|
51
51
|
add_react_third_party_ndk_subdir(double-conversion)
|
|
52
|
+
add_react_third_party_ndk_subdir(fast_float)
|
|
52
53
|
add_react_third_party_ndk_subdir(fmt)
|
|
53
54
|
add_react_third_party_ndk_subdir(folly)
|
|
54
55
|
add_react_third_party_ndk_subdir(jsc)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
cmake_minimum_required(VERSION 3.13)
|
|
7
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
+
|
|
9
|
+
add_compile_options(-std=c++20 -fexceptions)
|
|
10
|
+
|
|
11
|
+
add_library(fast_float INTERFACE)
|
|
12
|
+
|
|
13
|
+
target_include_directories(fast_float INTERFACE include)
|
|
@@ -26,11 +26,8 @@ SET(folly_FLAGS
|
|
|
26
26
|
SET(folly_runtime_SRC
|
|
27
27
|
folly/Conv.cpp
|
|
28
28
|
folly/Demangle.cpp
|
|
29
|
-
folly/dynamic.cpp
|
|
30
29
|
folly/FileUtil.cpp
|
|
31
30
|
folly/Format.cpp
|
|
32
|
-
folly/json_pointer.cpp
|
|
33
|
-
folly/json.cpp
|
|
34
31
|
folly/ScopeGuard.cpp
|
|
35
32
|
folly/SharedMutex.cpp
|
|
36
33
|
folly/String.cpp
|
|
@@ -42,6 +39,9 @@ SET(folly_runtime_SRC
|
|
|
42
39
|
folly/detail/SplitStringSimd.cpp
|
|
43
40
|
folly/detail/UniqueInstance.cpp
|
|
44
41
|
folly/hash/SpookyHashV2.cpp
|
|
42
|
+
folly/json/dynamic.cpp
|
|
43
|
+
folly/json/json_pointer.cpp
|
|
44
|
+
folly/json/json.cpp
|
|
45
45
|
folly/lang/CString.cpp
|
|
46
46
|
folly/lang/SafeAssert.cpp
|
|
47
47
|
folly/lang/ToAscii.cpp
|
|
@@ -51,8 +51,7 @@ SET(folly_runtime_SRC
|
|
|
51
51
|
folly/synchronization/SanitizeThread.cpp
|
|
52
52
|
folly/synchronization/ParkingLot.cpp
|
|
53
53
|
folly/system/AtFork.cpp
|
|
54
|
-
folly/system/ThreadId.cpp
|
|
55
|
-
folly/system/ThreadName.cpp)
|
|
54
|
+
folly/system/ThreadId.cpp)
|
|
56
55
|
|
|
57
56
|
add_library(folly_runtime STATIC ${folly_runtime_SRC})
|
|
58
57
|
|
|
@@ -67,4 +66,4 @@ target_compile_options(folly_runtime
|
|
|
67
66
|
target_compile_options(folly_runtime PUBLIC ${folly_FLAGS})
|
|
68
67
|
|
|
69
68
|
target_include_directories(folly_runtime PUBLIC .)
|
|
70
|
-
target_link_libraries(folly_runtime glog double-conversion boost fmt)
|
|
69
|
+
target_link_libraries(folly_runtime glog double-conversion boost fmt fast_float)
|
|
@@ -53,7 +53,8 @@ Pod::Spec.new do |s|
|
|
|
53
53
|
s.dependency "React-logger"
|
|
54
54
|
s.dependency "glog"
|
|
55
55
|
s.dependency "DoubleConversion"
|
|
56
|
-
s.dependency "
|
|
56
|
+
s.dependency "fast_float"
|
|
57
|
+
s.dependency "fmt"
|
|
57
58
|
s.dependency "React-Core"
|
|
58
59
|
s.dependency "React-debug"
|
|
59
60
|
s.dependency "React-featureflags"
|
|
@@ -33,6 +33,7 @@ Pod::Spec.new do |s|
|
|
|
33
33
|
"\"$(PODS_ROOT)/Headers/Private/Yoga\"",
|
|
34
34
|
"\"$(PODS_TARGET_SRCROOT)\"",
|
|
35
35
|
"\"$(PODS_ROOT)/DoubleConversion\"",
|
|
36
|
+
"\"$(PODS_ROOT)/fast_float/include\"",
|
|
36
37
|
"\"$(PODS_ROOT)/fmt/include\"",
|
|
37
38
|
]
|
|
38
39
|
|
|
@@ -74,7 +75,8 @@ Pod::Spec.new do |s|
|
|
|
74
75
|
s.dependency "React-logger"
|
|
75
76
|
s.dependency "glog"
|
|
76
77
|
s.dependency "DoubleConversion"
|
|
77
|
-
s.dependency "
|
|
78
|
+
s.dependency "fast_float"
|
|
79
|
+
s.dependency "fmt"
|
|
78
80
|
s.dependency "React-Core"
|
|
79
81
|
s.dependency "React-debug"
|
|
80
82
|
s.dependency "React-featureflags"
|
|
@@ -30,6 +30,7 @@ header_search_path = [
|
|
|
30
30
|
"\"$(PODS_ROOT)/RCT-Folly\"",
|
|
31
31
|
"\"$(PODS_ROOT)/Headers/Private/Yoga\"",
|
|
32
32
|
"\"$(PODS_ROOT)/DoubleConversion\"",
|
|
33
|
+
"\"$(PODS_ROOT)/fast_float/include\"",
|
|
33
34
|
"\"$(PODS_ROOT)/fmt/include\"",
|
|
34
35
|
]
|
|
35
36
|
|
|
@@ -65,16 +66,17 @@ Pod::Spec.new do |s|
|
|
|
65
66
|
s.module_name = 'React_FabricImage'
|
|
66
67
|
end
|
|
67
68
|
|
|
68
|
-
s.dependency folly_dep_name
|
|
69
|
+
s.dependency folly_dep_name
|
|
69
70
|
|
|
70
|
-
s.dependency "React-jsiexecutor"
|
|
71
|
-
s.dependency "RCTRequired"
|
|
72
|
-
s.dependency "RCTTypeSafety"
|
|
71
|
+
s.dependency "React-jsiexecutor"
|
|
72
|
+
s.dependency "RCTRequired"
|
|
73
|
+
s.dependency "RCTTypeSafety"
|
|
73
74
|
s.dependency "React-jsi"
|
|
74
75
|
s.dependency "React-logger"
|
|
75
76
|
s.dependency "glog"
|
|
76
77
|
s.dependency "DoubleConversion"
|
|
77
|
-
s.dependency "
|
|
78
|
+
s.dependency "fast_float"
|
|
79
|
+
s.dependency "fmt"
|
|
78
80
|
s.dependency "React-ImageManager"
|
|
79
81
|
s.dependency "React-utils"
|
|
80
82
|
s.dependency "Yoga"
|
|
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
|
|
|
34
34
|
s.source = source
|
|
35
35
|
s.header_dir = "ReactCommon" # Use global header_dir for all subspecs for use_frameworks! compatibility
|
|
36
36
|
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
|
|
37
|
-
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
|
37
|
+
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
|
38
38
|
"USE_HEADERMAP" => "YES",
|
|
39
39
|
"DEFINES_MODULE" => "YES",
|
|
40
40
|
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
@@ -46,14 +46,15 @@ Pod::Spec.new do |s|
|
|
|
46
46
|
# TODO (T48588859): Restructure this target to align with dir structure: "react/nativemodule/..."
|
|
47
47
|
# Note: Update this only when ready to minimize breaking changes.
|
|
48
48
|
s.subspec "turbomodule" do |ss|
|
|
49
|
-
ss.dependency "React-callinvoker"
|
|
50
|
-
ss.dependency "React-perflogger"
|
|
51
|
-
ss.dependency "React-cxxreact"
|
|
52
|
-
ss.dependency "React-jsi"
|
|
53
|
-
ss.dependency "RCT-Folly"
|
|
54
|
-
ss.dependency "React-logger"
|
|
49
|
+
ss.dependency "React-callinvoker"
|
|
50
|
+
ss.dependency "React-perflogger"
|
|
51
|
+
ss.dependency "React-cxxreact"
|
|
52
|
+
ss.dependency "React-jsi"
|
|
53
|
+
ss.dependency "RCT-Folly"
|
|
54
|
+
ss.dependency "React-logger"
|
|
55
55
|
ss.dependency "DoubleConversion"
|
|
56
|
-
ss.dependency "
|
|
56
|
+
ss.dependency "fast_float"
|
|
57
|
+
ss.dependency "fmt"
|
|
57
58
|
ss.dependency "glog"
|
|
58
59
|
if using_hermes
|
|
59
60
|
ss.dependency "hermes-engine"
|
|
@@ -47,9 +47,12 @@ namespace {
|
|
|
47
47
|
CxxModule::Callback convertCallback(
|
|
48
48
|
std::function<void(folly::dynamic)> callback) {
|
|
49
49
|
return [callback = std::move(callback)](std::vector<folly::dynamic> args) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
// after unpinning folly, can use folly::dynamic::array_range
|
|
51
|
+
folly::dynamic obj = folly::dynamic::array;
|
|
52
|
+
for (auto& arg : args) {
|
|
53
|
+
obj.push_back(std::move(arg));
|
|
54
|
+
}
|
|
55
|
+
callback(std::move(obj));
|
|
53
56
|
};
|
|
54
57
|
}
|
|
55
58
|
|