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.
Files changed (64) hide show
  1. package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
  2. package/Libraries/Blob/React-RCTBlob.podspec +3 -1
  3. package/Libraries/Core/ReactNativeVersion.js +1 -1
  4. package/Libraries/Network/FormData.js +11 -3
  5. package/Libraries/Network/RCTDataRequestHandler.mm +17 -3
  6. package/Libraries/Network/RCTFileRequestHandler.mm +17 -3
  7. package/React/Base/RCTVersion.m +1 -1
  8. package/React/CoreModules/React-CoreModules.podspec +9 -10
  9. package/React/CxxModule/RCTCxxMethod.mm +10 -2
  10. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +1 -7
  11. package/React/Fabric/Surface/RCTFabricSurface.mm +1 -0
  12. package/React/React-RCTFabric.podspec +1 -0
  13. package/React/third-party.xcconfig +1 -1
  14. package/React-Core.podspec +2 -1
  15. package/ReactAndroid/api/ReactAndroid.api +1 -1
  16. package/ReactAndroid/build.gradle.kts +24 -0
  17. package/ReactAndroid/gradle.properties +1 -1
  18. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +3 -1
  19. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/HMRClient.java +4 -1
  20. package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +13 -8
  21. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  22. package/ReactAndroid/src/main/jni/CMakeLists.txt +1 -0
  23. package/ReactAndroid/src/main/jni/third-party/fast_float/CMakeLists.txt +13 -0
  24. package/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +5 -6
  25. package/ReactCommon/React-Fabric.podspec +2 -1
  26. package/ReactCommon/React-FabricComponents.podspec +3 -1
  27. package/ReactCommon/React-FabricImage.podspec +7 -5
  28. package/ReactCommon/ReactCommon.podspec +9 -8
  29. package/ReactCommon/cxxreact/CxxNativeModule.cpp +6 -3
  30. package/ReactCommon/cxxreact/React-cxxreact.podspec +11 -10
  31. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  32. package/ReactCommon/hermes/React-hermes.podspec +7 -6
  33. package/ReactCommon/jsi/React-jsi.podspec +4 -3
  34. package/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +7 -6
  35. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +4 -4
  36. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +1 -1
  37. package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +24 -13
  38. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +3 -1
  39. package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +4 -2
  40. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +4 -2
  41. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -0
  42. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h +24 -3
  43. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +1 -43
  44. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm +4 -5
  45. package/ReactCommon/reactperflogger/React-perflogger.podspec +1 -0
  46. package/cli.js +11 -2
  47. package/gradle/libs.versions.toml +3 -2
  48. package/package.json +8 -8
  49. package/react-native.config.js +24 -23
  50. package/scripts/cocoapods/codegen_utils.rb +1 -2
  51. package/scripts/cocoapods/helpers.rb +13 -1
  52. package/scripts/cocoapods/new_architecture.rb +1 -0
  53. package/scripts/cocoapods/utils.rb +2 -0
  54. package/scripts/react_native_pods.rb +14 -0
  55. package/sdks/hermesc/linux64-bin/hermesc +0 -0
  56. package/sdks/hermesc/osx-bin/hermes +0 -0
  57. package/sdks/hermesc/osx-bin/hermesc +0 -0
  58. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  59. package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
  60. package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
  61. package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
  62. package/third-party-podspecs/RCT-Folly.podspec +16 -7
  63. package/third-party-podspecs/fast_float.podspec +29 -0
  64. package/third-party-podspecs/fmt.podspec +2 -2
@@ -35,24 +35,25 @@ Pod::Spec.new do |s|
35
35
  s.exclude_files = "SampleCxxModule.*"
36
36
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
37
37
  s.pod_target_xcconfig = {
38
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"",
38
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\" \"$(PODS_CONFIGURATION_BUILD_DIR)/React-debug/React_debug.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimeexecutor/React_runtimeexecutor.framework/Headers\"",
39
39
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
40
40
  }
41
41
  s.header_dir = "cxxreact"
42
42
 
43
43
  s.dependency "boost"
44
44
  s.dependency "DoubleConversion"
45
- s.dependency "fmt", "9.1.0"
46
- s.dependency "RCT-Folly", folly_version
45
+ s.dependency "fast_float"
46
+ s.dependency "fmt"
47
+ s.dependency "RCT-Folly"
47
48
  s.dependency "glog"
48
49
  add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
49
- s.dependency "React-callinvoker", version
50
- s.dependency "React-runtimeexecutor", version
51
- s.dependency "React-perflogger", version
52
- s.dependency "React-jsi", version
53
- s.dependency "React-logger", version
54
- s.dependency "React-debug", version
55
- s.dependency "React-timing", version
50
+ s.dependency "React-callinvoker"
51
+ s.dependency "React-runtimeexecutor"
52
+ s.dependency "React-perflogger"
53
+ s.dependency "React-jsi"
54
+ s.dependency "React-logger"
55
+ s.dependency "React-debug"
56
+ s.dependency "React-timing"
56
57
 
57
58
  s.resource_bundles = {'React-cxxreact_privacy' => 'PrivacyInfo.xcprivacy'}
58
59
 
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 76;
20
- int32_t Patch = 7;
20
+ int32_t Patch = 9;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
@@ -36,17 +36,18 @@ Pod::Spec.new do |s|
36
36
  s.public_header_files = "executor/HermesExecutorFactory.h"
37
37
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
38
38
  s.pod_target_xcconfig = {
39
- "HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/hermes-engine/destroot/include\" \"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
39
+ "HEADER_SEARCH_PATHS" => "\"${PODS_ROOT}/hermes-engine/destroot/include\" \"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\"",
40
40
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
41
41
  }
42
42
  s.header_dir = "reacthermes"
43
- s.dependency "React-cxxreact", version
44
- s.dependency "React-jsiexecutor", version
43
+ s.dependency "React-cxxreact"
44
+ s.dependency "React-jsiexecutor"
45
45
  add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
46
- s.dependency "React-perflogger", version
47
- s.dependency "RCT-Folly", folly_version
46
+ s.dependency "React-perflogger"
47
+ s.dependency "RCT-Folly"
48
48
  s.dependency "DoubleConversion"
49
- s.dependency "fmt", "9.1.0"
49
+ s.dependency "fast_float"
50
+ s.dependency "fmt"
50
51
  s.dependency "glog"
51
52
  s.dependency "hermes-engine"
52
53
  s.dependency "React-jsi"
@@ -37,13 +37,14 @@ Pod::Spec.new do |s|
37
37
 
38
38
  s.header_dir = "jsi"
39
39
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
40
- s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
40
+ 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\"",
41
41
  "DEFINES_MODULE" => "YES" }
42
42
 
43
43
  s.dependency "boost"
44
44
  s.dependency "DoubleConversion"
45
- s.dependency "fmt", "9.1.0"
46
- s.dependency "RCT-Folly", folly_version
45
+ s.dependency "fast_float"
46
+ s.dependency "fmt"
47
+ s.dependency "RCT-Folly"
47
48
  s.dependency "glog"
48
49
 
49
50
  s.source_files = "**/*.{cpp,h}"
@@ -32,16 +32,17 @@ Pod::Spec.new do |s|
32
32
  s.source = source
33
33
  s.source_files = "jsireact/*.{cpp,h}"
34
34
  s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
35
- s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
35
+ 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\"",
36
36
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
37
37
  s.header_dir = "jsireact"
38
38
 
39
- s.dependency "React-cxxreact", version
40
- s.dependency "React-jsi", version
41
- s.dependency "React-perflogger", version
42
- s.dependency "RCT-Folly", folly_version
39
+ s.dependency "React-cxxreact"
40
+ s.dependency "React-jsi"
41
+ s.dependency "React-perflogger"
42
+ s.dependency "RCT-Folly"
43
43
  s.dependency "DoubleConversion"
44
- s.dependency "fmt", "9.1.0"
44
+ s.dependency "fast_float"
45
+ s.dependency "fmt"
45
46
  s.dependency "glog"
46
47
  add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern')
47
48
 
@@ -37,7 +37,7 @@ Pod::Spec.new do |s|
37
37
  s.header_dir = 'jsinspector-modern'
38
38
  s.compiler_flags = folly_compiler_flags
39
39
  s.pod_target_xcconfig = {
40
- "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fmt/include\"",
40
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/..\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/fast_float/include\" \"$(PODS_ROOT)/fmt/include\"",
41
41
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
42
42
  "DEFINES_MODULE" => "YES"
43
43
  }.merge!(use_frameworks ? {
@@ -49,12 +49,12 @@ Pod::Spec.new do |s|
49
49
  end
50
50
 
51
51
  s.dependency "glog"
52
- s.dependency "RCT-Folly", folly_version
52
+ s.dependency "RCT-Folly"
53
53
  s.dependency "React-featureflags"
54
54
  s.dependency "DoubleConversion"
55
- s.dependency "React-runtimeexecutor", version
55
+ s.dependency "React-runtimeexecutor"
56
56
  s.dependency "React-jsi"
57
- s.dependency "React-perflogger", version
57
+ s.dependency "React-perflogger"
58
58
  if ENV["USE_HERMES"] == nil || ENV["USE_HERMES"] == "1"
59
59
  s.dependency "hermes-engine"
60
60
  end
@@ -34,7 +34,7 @@ Pod::Spec.new do |s|
34
34
  s.platforms = min_supported_versions
35
35
  s.source = source
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
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
40
40
  "GCC_WARN_PEDANTIC" => "YES" }
@@ -57,7 +57,7 @@ static jsi::Value convertNSNumberToJSINumber(jsi::Runtime &runtime, NSNumber *va
57
57
 
58
58
  static jsi::String convertNSStringToJSIString(jsi::Runtime &runtime, NSString *value)
59
59
  {
60
- return jsi::String::createFromUtf8(runtime, [value UTF8String] ?: "");
60
+ return jsi::String::createFromUtf8(runtime, [value UTF8String] ? [value UTF8String] : "");
61
61
  }
62
62
 
63
63
  static jsi::Object convertNSDictionaryToJSIObject(jsi::Runtime &runtime, NSDictionary *value)
@@ -195,7 +195,11 @@ static jsi::Value createJSRuntimeError(jsi::Runtime &runtime, const std::string
195
195
  /**
196
196
  * Creates JSError with current JS runtime and NSException stack trace.
197
197
  */
198
- static jsi::JSError convertNSExceptionToJSError(jsi::Runtime &runtime, NSException *exception)
198
+ static jsi::JSError convertNSExceptionToJSError(
199
+ jsi::Runtime &runtime,
200
+ NSException *exception,
201
+ const std::string &moduleName,
202
+ const std::string &methodName)
199
203
  {
200
204
  std::string reason = [exception.reason UTF8String];
201
205
 
@@ -206,7 +210,8 @@ static jsi::JSError convertNSExceptionToJSError(jsi::Runtime &runtime, NSExcepti
206
210
  cause.setProperty(
207
211
  runtime, "stackReturnAddresses", convertNSArrayToJSIArray(runtime, exception.callStackReturnAddresses));
208
212
 
209
- jsi::Value error = createJSRuntimeError(runtime, "Exception in HostFunction: " + reason);
213
+ std::string message = moduleName + "." + methodName + " raised an exception: " + reason;
214
+ jsi::Value error = createJSRuntimeError(runtime, message);
210
215
  error.asObject(runtime).setProperty(runtime, "cause", std::move(cause));
211
216
  return {runtime, std::move(error)};
212
217
  }
@@ -338,28 +343,34 @@ id ObjCTurboModule::performMethodInvocation(
338
343
  }
339
344
 
340
345
  if (isSync) {
341
- TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodNameStr.c_str());
346
+ TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodName);
342
347
  } else {
343
- TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodNameStr.c_str(), asyncCallCounter);
348
+ TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodName, asyncCallCounter);
344
349
  }
345
350
 
346
351
  @try {
347
352
  [inv invokeWithTarget:strongModule];
348
353
  } @catch (NSException *exception) {
349
- throw convertNSExceptionToJSError(runtime, exception);
354
+ if (isSync) {
355
+ // We can only convert NSException to JSError in sync method calls.
356
+ // See https://github.com/reactwg/react-native-new-architecture/discussions/276#discussioncomment-12567155
357
+ throw convertNSExceptionToJSError(runtime, exception, std::string{moduleName}, methodNameStr);
358
+ } else {
359
+ @throw exception;
360
+ }
350
361
  } @finally {
351
362
  [retainedObjectsForInvocation removeAllObjects];
352
363
  }
353
364
 
354
365
  if (!isSync) {
355
- TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodNameStr.c_str(), asyncCallCounter);
366
+ TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodName, asyncCallCounter);
356
367
  return;
357
368
  }
358
369
 
359
370
  void *rawResult;
360
371
  [inv getReturnValue:&rawResult];
361
372
  result = (__bridge id)rawResult;
362
- TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodNameStr.c_str());
373
+ TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodName);
363
374
  };
364
375
 
365
376
  if (isSync) {
@@ -401,23 +412,23 @@ void ObjCTurboModule::performVoidMethodInvocation(
401
412
  }
402
413
 
403
414
  if (shouldVoidMethodsExecuteSync_) {
404
- TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodNameStr.c_str());
415
+ TurboModulePerfLogger::syncMethodCallExecutionStart(moduleName, methodName);
405
416
  } else {
406
- TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodNameStr.c_str(), asyncCallCounter);
417
+ TurboModulePerfLogger::asyncMethodCallExecutionStart(moduleName, methodName, asyncCallCounter);
407
418
  }
408
419
 
409
420
  @try {
410
421
  [inv invokeWithTarget:strongModule];
411
422
  } @catch (NSException *exception) {
412
- throw convertNSExceptionToJSError(runtime, exception);
423
+ throw convertNSExceptionToJSError(runtime, exception, std::string{moduleName}, methodNameStr);
413
424
  } @finally {
414
425
  [retainedObjectsForInvocation removeAllObjects];
415
426
  }
416
427
 
417
428
  if (shouldVoidMethodsExecuteSync_) {
418
- TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodNameStr.c_str());
429
+ TurboModulePerfLogger::syncMethodCallExecutionEnd(moduleName, methodName);
419
430
  } else {
420
- TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodNameStr.c_str(), asyncCallCounter);
431
+ TurboModulePerfLogger::asyncMethodCallExecutionEnd(moduleName, methodName, asyncCallCounter);
421
432
  }
422
433
 
423
434
  return;
@@ -27,6 +27,7 @@ header_search_paths = [
27
27
  "\"$(PODS_ROOT)/boost\"",
28
28
  "\"$(PODS_ROOT)/RCT-Folly\"",
29
29
  "\"$(PODS_ROOT)/DoubleConversion\"",
30
+ "\"$(PODS_ROOT)/fast_float/include\"",
30
31
  "\"$(PODS_ROOT)/fmt/include\"",
31
32
  "\"$(PODS_ROOT)/Headers/Private/React-Core\"",
32
33
  ]
@@ -62,7 +63,8 @@ Pod::Spec.new do |s|
62
63
 
63
64
  s.dependency "RCT-Folly"
64
65
  s.dependency "DoubleConversion"
65
- s.dependency "fmt", "9.1.0"
66
+ s.dependency "fast_float"
67
+ s.dependency "fmt"
66
68
  s.dependency "React-Core"
67
69
  s.dependency "React-cxxreact"
68
70
  s.dependency "React-jsi"
@@ -24,6 +24,7 @@ header_search_paths = [
24
24
  "\"$(PODS_ROOT)/RCT-Folly\"",
25
25
  "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/RCT-Folly\"",
26
26
  "\"$(PODS_ROOT)/DoubleConversion\"",
27
+ "\"$(PODS_ROOT)/fast_float/include\"",
27
28
  "\"$(PODS_ROOT)/fmt/include\""
28
29
  ]
29
30
 
@@ -55,8 +56,9 @@ Pod::Spec.new do |s|
55
56
  s.header_mappings_dir = "../../.."
56
57
  end
57
58
 
58
- s.dependency "RCT-Folly", folly_version
59
+ s.dependency "RCT-Folly"
59
60
  s.dependency "DoubleConversion"
60
- s.dependency "fmt", "9.1.0"
61
+ s.dependency "fast_float"
62
+ s.dependency "fmt"
61
63
  add_dependency(s, "React-debug")
62
64
  end
@@ -29,6 +29,7 @@ Pod::Spec.new do |s|
29
29
  "\"$(PODS_TARGET_SRCROOT)/../../../\"",
30
30
  "\"$(PODS_ROOT)/RCT-Folly\"",
31
31
  "\"$(PODS_ROOT)/DoubleConversion\"",
32
+ "\"$(PODS_ROOT)/fast_float/include\"",
32
33
  "\"$(PODS_ROOT)/fmt/include\""
33
34
  ]
34
35
 
@@ -61,10 +62,11 @@ Pod::Spec.new do |s|
61
62
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
62
63
 
63
64
  s.dependency "glog"
64
- s.dependency "RCT-Folly/Fabric", folly_version
65
+ s.dependency "RCT-Folly/Fabric"
65
66
  s.dependency "React-jsi"
66
67
  s.dependency "React-jsiexecutor"
67
68
  s.dependency "React-utils"
68
69
  s.dependency "DoubleConversion"
69
- s.dependency "fmt", "9.1.0"
70
+ s.dependency "fast_float"
71
+ s.dependency "fmt"
70
72
  end
@@ -27,6 +27,7 @@ Pod::Spec.new do |s|
27
27
  "\"$(PODS_TARGET_SRCROOT)\"",
28
28
  "\"$(PODS_ROOT)/RCT-Folly\"",
29
29
  "\"$(PODS_ROOT)/DoubleConversion\"",
30
+ "\"$(PODS_ROOT)/fast_float/include\"",
30
31
  "\"$(PODS_ROOT)/fmt/include\"",
31
32
  ].join(" ")
32
33
 
@@ -52,8 +52,29 @@ BOOL RCTIsAttributedStringEffectivelySame(
52
52
  NSDictionary<NSAttributedStringKey, id> *insensitiveAttributes,
53
53
  const facebook::react::TextAttributes &baseTextAttributes);
54
54
 
55
- @interface RCTWeakEventEmitterWrapper : NSObject
56
- @property (nonatomic, assign) facebook::react::SharedEventEmitter eventEmitter;
57
- @end
55
+ static inline NSData *RCTWrapEventEmitter(const facebook::react::SharedEventEmitter &eventEmitter)
56
+ {
57
+ auto eventEmitterPtr = new std::weak_ptr<const facebook::react::EventEmitter>(eventEmitter);
58
+ return [[NSData alloc] initWithBytesNoCopy:eventEmitterPtr
59
+ length:sizeof(eventEmitterPtr)
60
+ deallocator:^(void *ptrToDelete, NSUInteger) {
61
+ delete (std::weak_ptr<facebook::react::EventEmitter> *)ptrToDelete;
62
+ }];
63
+ }
64
+
65
+ static inline facebook::react::SharedEventEmitter RCTUnwrapEventEmitter(NSData *data)
66
+ {
67
+ if (data.length == 0) {
68
+ return nullptr;
69
+ }
70
+
71
+ auto weakPtr = dynamic_cast<std::weak_ptr<const facebook::react::EventEmitter> *>(
72
+ (std::weak_ptr<const facebook::react::EventEmitter> *)data.bytes);
73
+ if (weakPtr) {
74
+ return weakPtr->lock();
75
+ }
76
+
77
+ return nullptr;
78
+ }
58
79
 
59
80
  NS_ASSUME_NONNULL_END
@@ -16,45 +16,6 @@
16
16
 
17
17
  using namespace facebook::react;
18
18
 
19
- @implementation RCTWeakEventEmitterWrapper {
20
- std::weak_ptr<const EventEmitter> _weakEventEmitter;
21
- }
22
-
23
- - (void)setEventEmitter:(SharedEventEmitter)eventEmitter
24
- {
25
- _weakEventEmitter = eventEmitter;
26
- }
27
-
28
- - (SharedEventEmitter)eventEmitter
29
- {
30
- return _weakEventEmitter.lock();
31
- }
32
-
33
- - (void)dealloc
34
- {
35
- _weakEventEmitter.reset();
36
- }
37
-
38
- - (BOOL)isEqual:(id)object
39
- {
40
- // We consider the underlying EventEmitter as the identity
41
- if (![object isKindOfClass:[self class]]) {
42
- return NO;
43
- }
44
-
45
- auto thisEventEmitter = [self eventEmitter];
46
- auto otherEventEmitter = [((RCTWeakEventEmitterWrapper *)object) eventEmitter];
47
- return thisEventEmitter == otherEventEmitter;
48
- }
49
-
50
- - (NSUInteger)hash
51
- {
52
- // We consider the underlying EventEmitter as the identity
53
- return (NSUInteger)_weakEventEmitter.lock().get();
54
- }
55
-
56
- @end
57
-
58
19
  inline static UIFontWeight RCTUIFontWeightFromInteger(NSInteger fontWeight)
59
20
  {
60
21
  assert(fontWeight > 50);
@@ -405,10 +366,8 @@ static NSMutableAttributedString *RCTNSAttributedStringFragmentWithAttributesFro
405
366
  {
406
367
  auto nsAttributedStringFragment = RCTNSAttributedStringFragmentFromFragment(fragment, placeholderImage);
407
368
 
408
- #if !TARGET_OS_MACCATALYST
409
369
  if (fragment.parentShadowView.componentHandle) {
410
- RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new];
411
- eventEmitterWrapper.eventEmitter = fragment.parentShadowView.eventEmitter;
370
+ auto eventEmitterWrapper = RCTWrapEventEmitter(fragment.parentShadowView.eventEmitter);
412
371
 
413
372
  NSDictionary<NSAttributedStringKey, id> *additionalTextAttributes =
414
373
  @{RCTAttributedStringEventEmitterKey : eventEmitterWrapper};
@@ -416,7 +375,6 @@ static NSMutableAttributedString *RCTNSAttributedStringFragmentWithAttributesFro
416
375
  [nsAttributedStringFragment addAttributes:additionalTextAttributes
417
376
  range:NSMakeRange(0, nsAttributedStringFragment.length)];
418
377
  }
419
- #endif
420
378
 
421
379
  return nsAttributedStringFragment;
422
380
  }
@@ -280,11 +280,10 @@ static NSLineBreakMode RCTNSLineBreakModeFromEllipsizeMode(EllipsizeMode ellipsi
280
280
  // after (fraction == 1.0) the last character, then the attribute is valid.
281
281
  if (textStorage.length > 0 && (fraction > 0 || characterIndex > 0) &&
282
282
  (fraction < 1 || characterIndex < textStorage.length - 1)) {
283
- RCTWeakEventEmitterWrapper *eventEmitterWrapper =
284
- (RCTWeakEventEmitterWrapper *)[textStorage attribute:RCTAttributedStringEventEmitterKey
285
- atIndex:characterIndex
286
- effectiveRange:NULL];
287
- return eventEmitterWrapper.eventEmitter;
283
+ NSData *eventEmitterWrapper = (NSData *)[textStorage attribute:RCTAttributedStringEventEmitterKey
284
+ atIndex:characterIndex
285
+ effectiveRange:NULL];
286
+ return RCTUnwrapEventEmitter(eventEmitterWrapper);
288
287
  }
289
288
 
290
289
  return nil;
@@ -24,6 +24,7 @@ header_search_paths = [
24
24
  "\"$(PODS_TARGET_SRCROOT)/..\"",
25
25
  "\"$(PODS_ROOT)/RCT-Folly\"",
26
26
  "\"$(PODS_ROOT)/DoubleConversion\"",
27
+ "\"$(PODS_ROOT)/fast_float/include\"",
27
28
  "\"$(PODS_ROOT)/fmt/include\""
28
29
  ]
29
30
 
package/cli.js CHANGED
@@ -23,6 +23,15 @@ const deprecated = () => {
23
23
  );
24
24
  };
25
25
 
26
+ function findCommunityCli(startDir = process.cwd()) {
27
+ // With isolated node_modules (eg pnpm), we won't be able to find
28
+ // `@react-native-community/cli` starting from the `react-native` directory.
29
+ // Instead, we should use the project root, which we assume to be the cwd.
30
+ const options = {paths: [startDir]};
31
+ const rncli = require.resolve('@react-native-community/cli', options);
32
+ return require(rncli);
33
+ }
34
+
26
35
  function isMissingCliDependency(error) {
27
36
  return (
28
37
  error.code === 'MODULE_NOT_FOUND' &&
@@ -217,7 +226,7 @@ async function main() {
217
226
  }
218
227
 
219
228
  try {
220
- return require('@react-native-community/cli').run(name);
229
+ return findCommunityCli().run(name);
221
230
  } catch (e) {
222
231
  if (isMissingCliDependency(e)) {
223
232
  warnWithExplicitDependency();
@@ -231,7 +240,7 @@ if (require.main === module) {
231
240
  main();
232
241
  } else {
233
242
  try {
234
- cli = require('@react-native-community/cli');
243
+ cli = findCommunityCli();
235
244
  } catch (e) {
236
245
  // We silence @react-native-community/cli missing as it is no
237
246
  // longer a dependency
@@ -35,8 +35,9 @@ yoga-proguard-annotations = "1.19.0"
35
35
  # Native Dependencies
36
36
  boost="1_83_0"
37
37
  doubleconversion="1.1.6"
38
- fmt="9.1.0"
39
- folly="2024.01.01.00"
38
+ fastFloat="6.1.4"
39
+ fmt="11.0.2"
40
+ folly="2024.10.14.00"
40
41
  glog="0.3.5"
41
42
  gtest="1.12.1"
42
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.76.7",
3
+ "version": "0.76.9",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -109,13 +109,13 @@
109
109
  },
110
110
  "dependencies": {
111
111
  "@jest/create-cache-key-function": "^29.6.3",
112
- "@react-native/assets-registry": "0.76.7",
113
- "@react-native/codegen": "0.76.7",
114
- "@react-native/community-cli-plugin": "0.76.7",
115
- "@react-native/gradle-plugin": "0.76.7",
116
- "@react-native/js-polyfills": "0.76.7",
117
- "@react-native/normalize-colors": "0.76.7",
118
- "@react-native/virtualized-lists": "0.76.7",
112
+ "@react-native/assets-registry": "0.76.9",
113
+ "@react-native/codegen": "0.76.9",
114
+ "@react-native/community-cli-plugin": "0.76.9",
115
+ "@react-native/gradle-plugin": "0.76.9",
116
+ "@react-native/js-polyfills": "0.76.9",
117
+ "@react-native/normalize-colors": "0.76.9",
118
+ "@react-native/virtualized-lists": "0.76.9",
119
119
  "abort-controller": "^3.0.0",
120
120
  "anser": "^1.4.9",
121
121
  "ansi-regex": "^5.0.0",
@@ -20,9 +20,24 @@
20
20
 
21
21
  const verbose = process.env.DEBUG && process.env.DEBUG.includes('react-native');
22
22
 
23
+ function findCommunityPlatformPackage(spec, startDir = process.cwd()) {
24
+ // In monorepos, we cannot make any assumptions on where
25
+ // `@react-native-community/*` gets installed. The safest way to find it
26
+ // (barring adding an optional peer dependency) is to start from the project
27
+ // root.
28
+ //
29
+ // Note that we're assuming that the current working directory is the project
30
+ // root. This is also what `@react-native-community/cli` assumes (see
31
+ // https://github.com/react-native-community/cli/blob/14.x/packages/cli-tools/src/findProjectRoot.ts).
32
+ const main = require.resolve(spec, {paths: [startDir]});
33
+ return require(main);
34
+ }
35
+
23
36
  let android;
24
37
  try {
25
- android = require('@react-native-community/cli-platform-android');
38
+ android = findCommunityPlatformPackage(
39
+ '@react-native-community/cli-platform-android',
40
+ );
26
41
  } catch {
27
42
  if (verbose) {
28
43
  console.warn(
@@ -33,7 +48,9 @@ try {
33
48
 
34
49
  let ios;
35
50
  try {
36
- ios = require('@react-native-community/cli-platform-ios');
51
+ ios = findCommunityPlatformPackage(
52
+ '@react-native-community/cli-platform-ios',
53
+ );
37
54
  } catch {
38
55
  if (verbose) {
39
56
  console.warn(
@@ -44,27 +61,11 @@ try {
44
61
 
45
62
  const commands = [];
46
63
 
47
- try {
48
- const {
49
- bundleCommand,
50
- startCommand,
51
- } = require('@react-native/community-cli-plugin');
52
- commands.push(bundleCommand, startCommand);
53
- } catch (e) {
54
- const known =
55
- e.code === 'MODULE_NOT_FOUND' &&
56
- e.message.includes('@react-native-community/cli-server-api');
57
-
58
- if (!known) {
59
- throw e;
60
- }
61
-
62
- if (verbose) {
63
- console.warn(
64
- '@react-native-community/cli-server-api not found, the react-native.config.js may be unusable.',
65
- );
66
- }
67
- }
64
+ const {
65
+ bundleCommand,
66
+ startCommand,
67
+ } = require('@react-native/community-cli-plugin');
68
+ commands.push(bundleCommand, startCommand);
68
69
 
69
70
  const codegenCommand = {
70
71
  name: 'codegen',
@@ -80,13 +80,12 @@ class CodegenUtils
80
80
  "\"$(PODS_ROOT)/boost\"",
81
81
  "\"$(PODS_ROOT)/RCT-Folly\"",
82
82
  "\"$(PODS_ROOT)/DoubleConversion\"",
83
+ "\"$(PODS_ROOT)/fast_float/include\"",
83
84
  "\"$(PODS_ROOT)/fmt/include\"",
84
85
  "\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
85
86
  "\"$(PODS_ROOT)/Headers/Private/React-Fabric\"",
86
87
  "\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"",
87
88
  "\"$(PODS_ROOT)/Headers/Private/Yoga\"",
88
- "\"$(PODS_ROOT)/DoubleConversion\"",
89
- "\"$(PODS_ROOT)/fmt/include\"",
90
89
  "\"$(PODS_TARGET_SRCROOT)\"",
91
90
  ]
92
91
  framework_search_paths = []
@@ -46,11 +46,15 @@ module Helpers
46
46
  }
47
47
 
48
48
  @@folly_config = {
49
- :version => '2024.01.01.00',
49
+ :version => '2024.10.14.00',
50
50
  :git => 'https://github.com/facebook/folly.git',
51
51
  :compiler_flags => '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -Wno-comma -Wno-shorten-64-to-32'
52
52
  }
53
53
 
54
+ @@fast_float_config = {
55
+ :git => "https://github.com/fastfloat/fast_float.git",
56
+ }
57
+
54
58
  @@fmt_config = {
55
59
  :git => "https://github.com/fmtlib/fmt.git",
56
60
  }
@@ -79,6 +83,14 @@ module Helpers
79
83
  @@folly_config.update(new_folly_config)
80
84
  end
81
85
 
86
+ def self.fast_float_config
87
+ return @@fast_float_config
88
+ end
89
+
90
+ def self.set_fast_float_config(new_fast_float_config)
91
+ @@fast_float_config.update(new_fast_float_config)
92
+ end
93
+
82
94
  def self.boost_config
83
95
  return @@boost_config
84
96
  end