react-native 0.81.0 → 0.81.1

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 (73) hide show
  1. package/Libraries/Components/Switch/Switch.js +1 -1
  2. package/Libraries/Components/TextInput/TextInput.js +6 -1
  3. package/Libraries/Core/ReactNativeVersion.js +1 -1
  4. package/React/Base/RCTUtils.h +1 -0
  5. package/React/Base/RCTUtils.mm +12 -0
  6. package/React/Base/RCTVersion.m +1 -1
  7. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.cpp +0 -1
  8. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h +0 -1
  9. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.cpp +0 -1
  10. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/ShadowNodes.h +0 -11
  11. package/React/FBReactNativeSpec/react/renderer/components/FBReactNativeSpec/States.h +0 -2
  12. package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +22 -0
  13. package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +1 -1
  14. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +2 -1
  15. package/React/React-RCTFBReactNativeSpec.podspec +1 -4
  16. package/React/React-RCTFabric.podspec +1 -0
  17. package/React/Runtime/React-RCTRuntime.podspec +1 -3
  18. package/ReactAndroid/gradle.properties +1 -1
  19. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  20. package/ReactCommon/React-Fabric.podspec +1 -4
  21. package/ReactCommon/React-FabricComponents.podspec +9 -4
  22. package/ReactCommon/React-FabricImage.podspec +1 -4
  23. package/ReactCommon/React-Mapbuffer.podspec +1 -4
  24. package/ReactCommon/ReactCommon.podspec +2 -3
  25. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  26. package/ReactCommon/hermes/executor/React-jsitracing.podspec +1 -4
  27. package/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +2 -4
  28. package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +2 -3
  29. package/ReactCommon/jsinspector-modern/cdp/React-jsinspectorcdp.podspec +1 -4
  30. package/ReactCommon/jsinspector-modern/network/React-jsinspectornetwork.podspec +1 -4
  31. package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -4
  32. package/ReactCommon/jsitooling/React-jsitooling.podspec +1 -4
  33. package/ReactCommon/react/debug/React-debug.podspec +1 -4
  34. package/ReactCommon/react/featureflags/React-featureflags.podspec +1 -4
  35. package/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +2 -3
  36. package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -4
  37. package/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +1 -4
  38. package/ReactCommon/react/nativemodule/featureflags/React-featureflagsnativemodule.podspec +1 -4
  39. package/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +1 -4
  40. package/ReactCommon/react/nativemodule/microtasks/React-microtasksnativemodule.podspec +1 -4
  41. package/ReactCommon/react/nativemodule/samples/ReactCommon-Samples.podspec +2 -0
  42. package/ReactCommon/react/performance/timeline/React-performancetimeline.podspec +1 -4
  43. package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/AppleSwitchComponentDescriptor.h +30 -0
  44. package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/AppleSwitchShadowNode.h +42 -0
  45. package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/IOSSwitchShadowNode.mm +28 -0
  46. package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/MacOSSwitchShadowNode.mm +32 -0
  47. package/ReactCommon/react/renderer/components/textinput/BaseTextInputProps.h +2 -1
  48. package/ReactCommon/react/renderer/consistency/React-rendererconsistency.podspec +2 -4
  49. package/ReactCommon/react/renderer/css/React-renderercss.podspec +2 -5
  50. package/ReactCommon/react/renderer/debug/React-rendererdebug.podspec +1 -4
  51. package/ReactCommon/react/renderer/graphics/React-graphics.podspec +3 -3
  52. package/ReactCommon/react/renderer/imagemanager/platform/ios/React-ImageManager.podspec +1 -4
  53. package/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +1 -4
  54. package/ReactCommon/react/runtime/React-RuntimeCore.podspec +1 -4
  55. package/ReactCommon/react/runtime/React-RuntimeHermes.podspec +1 -4
  56. package/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +1 -4
  57. package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +1 -0
  58. package/ReactCommon/react/timing/React-timing.podspec +3 -4
  59. package/ReactCommon/react/utils/React-utils.podspec +3 -3
  60. package/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +3 -2
  61. package/package.json +8 -8
  62. package/scripts/cocoapods/new_architecture.rb +1 -0
  63. package/scripts/cocoapods/utils.rb +15 -1
  64. package/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js +3 -3
  65. package/scripts/codegen/templates/ReactCodegen.podspec.template +1 -0
  66. package/scripts/react-native-xcode.sh +2 -2
  67. package/scripts/react_native_pods.rb +21 -0
  68. package/scripts/xcode/with-environment.sh +1 -1
  69. package/sdks/hermesc/osx-bin/hermes +0 -0
  70. package/sdks/hermesc/osx-bin/hermesc +0 -0
  71. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  72. package/src/private/specs_DEPRECATED/components/SwitchNativeComponent.js +1 -0
  73. package/third-party-podspecs/ReactNativeDependencies.podspec +1 -1
@@ -264,7 +264,7 @@ const Switch: component(
264
264
  disabled,
265
265
  onTintColor: trackColorForTrue,
266
266
  style: StyleSheet.compose(
267
- {height: 31, width: 51},
267
+ {alignSelf: 'flex-start' as const},
268
268
  StyleSheet.compose(
269
269
  style,
270
270
  ios_backgroundColor == null
@@ -618,6 +618,9 @@ function InternalTextInput(props: TextInputProps): React.Node {
618
618
  // so omitting onBlur and onFocus pressability handlers here.
619
619
  const {onBlur, onFocus, ...eventHandlers} = usePressability(config);
620
620
 
621
+ const _accessibilityLabel =
622
+ props?.['aria-label'] ?? props?.accessibilityLabel;
623
+
621
624
  let _accessibilityState;
622
625
  if (
623
626
  accessibilityState != null ||
@@ -681,6 +684,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
681
684
  {...otherProps}
682
685
  {...eventHandlers}
683
686
  acceptDragAndDropTypes={props.experimental_acceptDragAndDropTypes}
687
+ accessibilityLabel={_accessibilityLabel}
684
688
  accessibilityState={_accessibilityState}
685
689
  accessible={accessible}
686
690
  submitBehavior={submitBehavior}
@@ -744,8 +748,9 @@ function InternalTextInput(props: TextInputProps): React.Node {
744
748
  {...otherProps}
745
749
  {...colorProps}
746
750
  {...eventHandlers}
747
- accessibilityState={_accessibilityState}
751
+ accessibilityLabel={_accessibilityLabel}
748
752
  accessibilityLabelledBy={_accessibilityLabelledBy}
753
+ accessibilityState={_accessibilityState}
749
754
  accessible={accessible}
750
755
  acceptDragAndDropTypes={props.experimental_acceptDragAndDropTypes}
751
756
  autoCapitalize={autoCapitalize}
@@ -17,6 +17,6 @@ export const version: $ReadOnly<{
17
17
  }> = {
18
18
  major: 0,
19
19
  minor: 81,
20
- patch: 0,
20
+ patch: 1,
21
21
  prerelease: null,
22
22
  };
@@ -54,6 +54,7 @@ RCT_EXTERN CGFloat RCTScreenScale(void);
54
54
  RCT_EXTERN CGFloat RCTFontSizeMultiplier(void);
55
55
  RCT_EXTERN CGSize RCTScreenSize(void);
56
56
  RCT_EXTERN CGSize RCTViewportSize(void);
57
+ RCT_EXTERN CGSize RCTSwitchSize(void);
57
58
 
58
59
  // Round float coordinates to nearest whole screen pixel (not point)
59
60
  RCT_EXTERN CGFloat RCTRoundPixelValue(CGFloat value);
@@ -426,6 +426,18 @@ CGSize RCTViewportSize(void)
426
426
  return window ? window.bounds.size : RCTScreenSize();
427
427
  }
428
428
 
429
+ CGSize RCTSwitchSize(void)
430
+ {
431
+ static CGSize rctSwitchSize;
432
+ static dispatch_once_t onceToken;
433
+ dispatch_once(&onceToken, ^{
434
+ RCTUnsafeExecuteOnMainQueueSync(^{
435
+ rctSwitchSize = [UISwitch new].intrinsicContentSize;
436
+ });
437
+ });
438
+ return rctSwitchSize;
439
+ }
440
+
429
441
  CGFloat RCTRoundPixelValue(CGFloat value)
430
442
  {
431
443
  CGFloat scale = RCTScreenScale();
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(81),
26
- RCTVersionPatch: @(0),
26
+ RCTVersionPatch: @(1),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -21,7 +21,6 @@ registry->add(concreteComponentDescriptorProvider<AndroidDrawerLayoutComponentDe
21
21
  registry->add(concreteComponentDescriptorProvider<AndroidSwipeRefreshLayoutComponentDescriptor>());
22
22
  registry->add(concreteComponentDescriptorProvider<DebuggingOverlayComponentDescriptor>());
23
23
  registry->add(concreteComponentDescriptorProvider<PullToRefreshViewComponentDescriptor>());
24
- registry->add(concreteComponentDescriptorProvider<SwitchComponentDescriptor>());
25
24
  registry->add(concreteComponentDescriptorProvider<UnimplementedNativeViewComponentDescriptor>());
26
25
  }
27
26
 
@@ -21,7 +21,6 @@ using AndroidDrawerLayoutComponentDescriptor = ConcreteComponentDescriptor<Andro
21
21
  using AndroidSwipeRefreshLayoutComponentDescriptor = ConcreteComponentDescriptor<AndroidSwipeRefreshLayoutShadowNode>;
22
22
  using DebuggingOverlayComponentDescriptor = ConcreteComponentDescriptor<DebuggingOverlayShadowNode>;
23
23
  using PullToRefreshViewComponentDescriptor = ConcreteComponentDescriptor<PullToRefreshViewShadowNode>;
24
- using SwitchComponentDescriptor = ConcreteComponentDescriptor<SwitchShadowNode>;
25
24
  using UnimplementedNativeViewComponentDescriptor = ConcreteComponentDescriptor<UnimplementedNativeViewShadowNode>;
26
25
 
27
26
  void FBReactNativeSpec_registerComponentDescriptorsFromCodegen(
@@ -17,7 +17,6 @@ extern const char AndroidDrawerLayoutComponentName[] = "AndroidDrawerLayout";
17
17
  extern const char AndroidSwipeRefreshLayoutComponentName[] = "AndroidSwipeRefreshLayout";
18
18
  extern const char DebuggingOverlayComponentName[] = "DebuggingOverlay";
19
19
  extern const char PullToRefreshViewComponentName[] = "PullToRefreshView";
20
- extern const char SwitchComponentName[] = "Switch";
21
20
  extern const char UnimplementedNativeViewComponentName[] = "UnimplementedNativeView";
22
21
 
23
22
  } // namespace facebook::react
@@ -73,17 +73,6 @@ using PullToRefreshViewShadowNode = ConcreteViewShadowNode<
73
73
  PullToRefreshViewEventEmitter,
74
74
  PullToRefreshViewState>;
75
75
 
76
- JSI_EXPORT extern const char SwitchComponentName[];
77
-
78
- /*
79
- * `ShadowNode` for <Switch> component.
80
- */
81
- using SwitchShadowNode = ConcreteViewShadowNode<
82
- SwitchComponentName,
83
- SwitchProps,
84
- SwitchEventEmitter,
85
- SwitchState>;
86
-
87
76
  JSI_EXPORT extern const char UnimplementedNativeViewComponentName[];
88
77
 
89
78
  /*
@@ -25,8 +25,6 @@ using DebuggingOverlayState = StateData;
25
25
 
26
26
  using PullToRefreshViewState = StateData;
27
27
 
28
- using SwitchState = StateData;
29
-
30
28
  using UnimplementedNativeViewState = StateData;
31
29
 
32
30
  } // namespace facebook::react
@@ -96,6 +96,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
96
96
 
97
97
  @interface RCTModalHostViewComponentView () <RCTFabricModalHostViewControllerDelegate>
98
98
 
99
+ @property (nonatomic, weak) UIView *accessibilityFocusedView;
100
+
99
101
  @end
100
102
 
101
103
  @implementation RCTModalHostViewComponentView {
@@ -148,6 +150,7 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
148
150
  {
149
151
  BOOL shouldBePresented = !_isPresented && _shouldPresent && self.window;
150
152
  if (shouldBePresented) {
153
+ [self saveAccessibilityFocusedView];
151
154
  self.viewController.presentationController.delegate = self;
152
155
 
153
156
  _isPresented = YES;
@@ -179,6 +182,8 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
179
182
  if (eventEmitter) {
180
183
  eventEmitter->onDismiss(ModalHostViewEventEmitter::OnDismiss{});
181
184
  }
185
+
186
+ [self restoreAccessibilityFocusedView];
182
187
  }];
183
188
  }
184
189
  }
@@ -207,6 +212,23 @@ static ModalHostViewEventEmitter::OnOrientationChange onOrientationChangeStruct(
207
212
  [self ensurePresentedOnlyIfNeeded];
208
213
  }
209
214
 
215
+ - (void)saveAccessibilityFocusedView
216
+ {
217
+ id focusedElement = UIAccessibilityFocusedElement(nil);
218
+ if (focusedElement && [focusedElement isKindOfClass:[UIView class]]) {
219
+ self.accessibilityFocusedView = (UIView *)focusedElement;
220
+ }
221
+ }
222
+
223
+ - (void)restoreAccessibilityFocusedView
224
+ {
225
+ id viewToFocus = self.accessibilityFocusedView;
226
+ if (viewToFocus) {
227
+ UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, viewToFocus);
228
+ self.accessibilityFocusedView = nil;
229
+ }
230
+ }
231
+
210
232
  #pragma mark - RCTFabricModalHostViewControllerDelegate
211
233
 
212
234
  - (void)boundsDidChange:(CGRect)newBounds
@@ -9,10 +9,10 @@
9
9
 
10
10
  #import <React/RCTConversions.h>
11
11
 
12
- #import <react/renderer/components/FBReactNativeSpec/ComponentDescriptors.h>
13
12
  #import <react/renderer/components/FBReactNativeSpec/EventEmitters.h>
14
13
  #import <react/renderer/components/FBReactNativeSpec/Props.h>
15
14
  #import <react/renderer/components/FBReactNativeSpec/RCTComponentViewHelpers.h>
15
+ #import <react/renderer/components/switch/AppleSwitchComponentDescriptor.h>
16
16
 
17
17
  #import "RCTFabricComponentsPlugins.h"
18
18
 
@@ -22,6 +22,7 @@
22
22
  #import "RCTTextInputNativeCommands.h"
23
23
  #import "RCTTextInputUtils.h"
24
24
 
25
+ #import <limits>
25
26
  #import "RCTFabricComponentsPlugins.h"
26
27
 
27
28
  /** Native iOS text field bottom keyboard offset amount */
@@ -447,7 +448,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
447
448
  }
448
449
  }
449
450
 
450
- if (props.maxLength) {
451
+ if (props.maxLength < std::numeric_limits<int>::max()) {
451
452
  NSInteger allowedLength = props.maxLength - _backedTextInputView.attributedText.string.length + range.length;
452
453
 
453
454
  if (allowedLength > 0 && text.length > allowedLength) {
@@ -45,10 +45,7 @@ Pod::Spec.new do |s|
45
45
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
46
46
  }
47
47
 
48
- if ENV['USE_FRAMEWORKS']
49
- s.header_mappings_dir = 'FBReactNativeSpec'
50
- s.module_name = 'React_RCTFBReactNativeSpec'
51
- end
48
+ resolve_use_frameworks(s, header_mappings_dir: 'FBReactNativeSpec', module_name: "React_RCTFBReactNativeSpec")
52
49
 
53
50
  s.dependency "React-jsi"
54
51
  s.dependency "RCTRequired"
@@ -75,6 +75,7 @@ Pod::Spec.new do |s|
75
75
  "react/renderer/components/scrollview/platform/cxx",
76
76
  "react/renderer/components/text/platform/cxx",
77
77
  "react/renderer/components/textinput/platform/ios",
78
+ "react/renderer/components/switch/iosswitch",
78
79
  ]);
79
80
 
80
81
  add_dependency(s, "React-graphics", :additional_framework_paths => ["react/renderer/graphics/platform/ios"])
@@ -35,9 +35,7 @@ Pod::Spec.new do |s|
35
35
  s.header_dir = header_dir
36
36
  s.module_name = module_name
37
37
 
38
- if ENV['USE_FRAMEWORKS']
39
- s.header_mappings_dir = "./"
40
- end
38
+ resolve_use_frameworks(s, header_mappings_dir: "./")
41
39
 
42
40
  s.pod_target_xcconfig = {
43
41
  "OTHER_CFLAGS" => "$(inherited) " + new_arch_flags,
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.81.0
1
+ VERSION_NAME=0.81.1
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -14,7 +14,7 @@ public object ReactNativeVersion {
14
14
  public val VERSION: Map<String, Any?> = mapOf(
15
15
  "major" to 0,
16
16
  "minor" to 81,
17
- "patch" to 0,
17
+ "patch" to 1,
18
18
  "prerelease" to null
19
19
  )
20
20
  }
@@ -32,10 +32,7 @@ Pod::Spec.new do |s|
32
32
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
33
33
  "DEFINES_MODULE" => "YES" }
34
34
 
35
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
36
- s.header_mappings_dir = './'
37
- s.module_name = 'React_Fabric'
38
- end
35
+ resolve_use_frameworks(s, header_mappings_dir: "./", module_name: "React_Fabric")
39
36
 
40
37
  s.dependency "React-jsiexecutor"
41
38
  s.dependency "RCTRequired"
@@ -49,10 +49,7 @@ Pod::Spec.new do |s|
49
49
  "HEADER_SEARCH_PATHS" => header_search_path.join(" "),
50
50
  }
51
51
 
52
- if ENV['USE_FRAMEWORKS']
53
- s.header_mappings_dir = './'
54
- s.module_name = 'React_FabricComponents'
55
- end
52
+ resolve_use_frameworks(s, header_mappings_dir: "./", module_name: "React_FabricComponents")
56
53
 
57
54
  s.dependency "React-jsiexecutor"
58
55
  s.dependency "RCTRequired"
@@ -127,6 +124,14 @@ Pod::Spec.new do |s|
127
124
  sss.header_dir = "react/renderer/components/iostextinput"
128
125
  end
129
126
 
127
+ ss.subspec "switch" do |sss|
128
+ sss.source_files = podspec_sources(
129
+ ["react/renderer/components/switch/iosswitch/**/*.{m,mm,cpp,h}"],
130
+ ["react/renderer/components/switch/iosswitch/**/*.h"])
131
+ sss.exclude_files = "react/renderer/components/switch/iosswitch/**/MacOS*.{m,mm,cpp,h}"
132
+ sss.header_dir = "react/renderer/components/switch/"
133
+ end
134
+
130
135
  ss.subspec "textinput" do |sss|
131
136
  sss.source_files = podspec_sources("react/renderer/components/textinput/*.{m,mm,cpp,h}", "react/renderer/components/textinput/**/*.h")
132
137
  sss.header_dir = "react/renderer/components/textinput"
@@ -50,10 +50,7 @@ Pod::Spec.new do |s|
50
50
  "HEADER_SEARCH_PATHS" => header_search_path.join(" ")
51
51
  }
52
52
 
53
- if ENV['USE_FRAMEWORKS']
54
- s.header_mappings_dir = './'
55
- s.module_name = 'React_FabricImage'
56
- end
53
+ resolve_use_frameworks(s, header_mappings_dir: './', module_name: "React_FabricImage")
57
54
 
58
55
  s.dependency "React-jsiexecutor", version
59
56
  s.dependency "RCTRequired", version
@@ -32,10 +32,7 @@ Pod::Spec.new do |s|
32
32
  s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => ["\"$(PODS_TARGET_SRCROOT)\""], "USE_HEADERMAP" => "YES",
33
33
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard() }
34
34
 
35
- if ENV['USE_FRAMEWORKS']
36
- s.header_mappings_dir = './'
37
- s.module_name = 'React_Mapbuffer'
38
- end
35
+ resolve_use_frameworks(s, header_mappings_dir: './', module_name: "React_Mapbuffer")
39
36
 
40
37
  add_dependency(s, "React-debug")
41
38
  add_rn_third_party_dependencies(s)
@@ -32,9 +32,8 @@ Pod::Spec.new do |s|
32
32
  "DEFINES_MODULE" => "YES",
33
33
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
34
34
  "GCC_WARN_PEDANTIC" => "YES" }
35
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
36
- s.header_mappings_dir = './'
37
- end
35
+
36
+ resolve_use_frameworks(s, header_mappings_dir: './')
38
37
 
39
38
  add_rn_third_party_dependencies(s)
40
39
  add_rncore_dependency(s)
@@ -14,14 +14,14 @@
14
14
 
15
15
  #define REACT_NATIVE_VERSION_MAJOR 0
16
16
  #define REACT_NATIVE_VERSION_MINOR 81
17
- #define REACT_NATIVE_VERSION_PATCH 0
17
+ #define REACT_NATIVE_VERSION_PATCH 1
18
18
 
19
19
  namespace facebook::react {
20
20
 
21
21
  constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 81;
24
- int32_t Patch = 0;
24
+ int32_t Patch = 1;
25
25
  std::string_view Prerelease = "";
26
26
  } ReactNativeVersion;
27
27
 
@@ -32,10 +32,7 @@ Pod::Spec.new do |s|
32
32
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
33
33
  "GCC_WARN_PEDANTIC" => "YES" }
34
34
 
35
- if ENV['USE_FRAMEWORKS']
36
- s.header_mappings_dir = './'
37
- s.module_name = 'React_jsitracing'
38
- end
35
+ resolve_use_frameworks(s, header_mappings_dir: './', module_name: "React_jsitracing")
39
36
 
40
37
  s.dependency "React-jsi"
41
38
  end
@@ -33,10 +33,8 @@ Pod::Spec.new do |s|
33
33
  "USE_HEADERMAP" => "YES",
34
34
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
35
35
  }
36
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
37
- s.header_mappings_dir = '../'
38
- s.module_name = 'React_jserrorhandler'
39
- end
36
+
37
+ resolve_use_frameworks(s, header_mappings_dir: '../', module_name: "React_jserrorhandler")
40
38
 
41
39
  s.dependency "React-jsi"
42
40
  s.dependency "React-cxxreact"
@@ -44,10 +44,9 @@ Pod::Spec.new do |s|
44
44
  "PUBLIC_HEADERS_FOLDER_PATH" => "#{module_name}.framework/Headers/#{header_dir}"
45
45
  } : {})
46
46
 
47
- if ENV['USE_FRAMEWORKS']
48
- s.module_name = module_name
49
- end
47
+ resolve_use_frameworks(s, module_name: module_name)
50
48
 
49
+ add_dependency(s, "React-oscompat") # Needed for USE_FRAMEWORKS=dynamic
51
50
  s.dependency "React-featureflags"
52
51
  add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"])
53
52
  s.dependency "React-jsi"
@@ -41,10 +41,7 @@ Pod::Spec.new do |s|
41
41
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
42
42
  "DEFINES_MODULE" => "YES"}
43
43
 
44
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
45
- s.module_name = module_name
46
- s.header_mappings_dir = "../.."
47
- end
44
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: module_name)
48
45
 
49
46
  add_rn_third_party_dependencies(s)
50
47
  add_rncore_dependency(s)
@@ -41,10 +41,7 @@ Pod::Spec.new do |s|
41
41
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
42
42
  "DEFINES_MODULE" => "YES"}
43
43
 
44
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
45
- s.module_name = module_name
46
- s.header_mappings_dir = "../.."
47
- end
44
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: module_name)
48
45
 
49
46
  add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp')
50
47
  add_dependency(s, "React-featureflags")
@@ -41,10 +41,7 @@ Pod::Spec.new do |s|
41
41
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
42
42
  "DEFINES_MODULE" => "YES"}
43
43
 
44
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
45
- s.module_name = module_name
46
- s.header_mappings_dir = "../.."
47
- end
44
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: module_name)
48
45
 
49
46
  s.dependency "React-oscompat"
50
47
  s.dependency "React-timing"
@@ -28,10 +28,7 @@ Pod::Spec.new do |s|
28
28
  s.source_files = podspec_sources("react/runtime/*.{cpp,h}", "react/runtime/*.h")
29
29
  s.header_dir = "react/runtime"
30
30
 
31
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
32
- s.module_name = "JSITooling"
33
- s.header_mappings_dir = "./"
34
- end
31
+ resolve_use_frameworks(s, header_mappings_dir: "./", module_name: "JSITooling")
35
32
 
36
33
  s.pod_target_xcconfig = {
37
34
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
@@ -30,8 +30,5 @@ Pod::Spec.new do |s|
30
30
  s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
31
31
  "DEFINES_MODULE" => "YES" }
32
32
 
33
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
34
- s.module_name = "React_debug"
35
- s.header_mappings_dir = "../.."
36
- end
33
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_debug")
37
34
  end
@@ -37,10 +37,7 @@ Pod::Spec.new do |s|
37
37
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
38
38
  "DEFINES_MODULE" => "YES" }
39
39
 
40
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
41
- s.module_name = "React_featureflags"
42
- s.header_mappings_dir = "../.."
43
- end
40
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_featureflags")
44
41
 
45
42
  add_rn_third_party_dependencies(s)
46
43
  add_rncore_dependency(s)
@@ -31,9 +31,8 @@ Pod::Spec.new do |s|
31
31
  "USE_HEADERMAP" => "YES",
32
32
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
33
33
  "GCC_WARN_PEDANTIC" => "YES" }
34
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
35
- s.header_mappings_dir = './'
36
- end
34
+
35
+ resolve_use_frameworks(s, header_mappings_dir: './')
37
36
 
38
37
  s.source_files = podspec_sources("ReactCommon/**/*.{mm,cpp,h}", "ReactCommon/**/*.{h}")
39
38
 
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
38
38
  "OTHER_CFLAGS" => "$(inherited)",
39
39
  "DEFINES_MODULE" => "YES" }
40
40
 
41
- if ENV['USE_FRAMEWORKS']
42
- s.module_name = "React_defaultsnativemodule"
43
- s.header_mappings_dir = "../.."
44
- end
41
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_defaultsnativemodule")
45
42
 
46
43
  s.dependency "React-jsi"
47
44
  s.dependency "React-jsiexecutor"
@@ -40,10 +40,7 @@ Pod::Spec.new do |s|
40
40
  "OTHER_CFLAGS" => "$(inherited)",
41
41
  "DEFINES_MODULE" => "YES" }
42
42
 
43
- if ENV['USE_FRAMEWORKS']
44
- s.module_name = "React_domnativemodule"
45
- s.header_mappings_dir = "../.."
46
- end
43
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_domnativemodule")
47
44
 
48
45
  s.dependency "React-jsi"
49
46
  s.dependency "React-jsiexecutor"
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
38
38
  "OTHER_CFLAGS" => "$(inherited)",
39
39
  "DEFINES_MODULE" => "YES" }
40
40
 
41
- if ENV['USE_FRAMEWORKS']
42
- s.module_name = "React_featureflagsnativemodule"
43
- s.header_mappings_dir = "../.."
44
- end
41
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_featureflagsnativemodule")
45
42
 
46
43
  s.dependency "React-jsi"
47
44
  s.dependency "React-jsiexecutor"
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
38
38
  "OTHER_CFLAGS" => "$(inherited)",
39
39
  "DEFINES_MODULE" => "YES" }
40
40
 
41
- if ENV['USE_FRAMEWORKS']
42
- s.module_name = "idlecallbacksnativemodule"
43
- s.header_mappings_dir = "../.."
44
- end
41
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "idlecallbacksnativemodule")
45
42
 
46
43
  s.dependency "React-jsi"
47
44
  s.dependency "React-jsiexecutor"
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
38
38
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
39
39
  "DEFINES_MODULE" => "YES" }
40
40
 
41
- if ENV['USE_FRAMEWORKS']
42
- s.module_name = "React_microtasksnativemodule"
43
- s.header_mappings_dir = "../.."
44
- end
41
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_microtasksnativemodule")
45
42
 
46
43
  s.dependency "React-jsi"
47
44
  s.dependency "React-jsiexecutor"
@@ -40,6 +40,8 @@ Pod::Spec.new do |s|
40
40
  s.framework = "UIKit"
41
41
 
42
42
  if ENV['USE_FRAMEWORKS']
43
+ # Do not use resolve_use_frameworks here - since we're including source files.
44
+ # Then it is not needed.
43
45
  s.header_mappings_dir = './'
44
46
  end
45
47
 
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
38
38
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
39
39
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')}
40
40
 
41
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
42
- s.module_name = "React_performancetimeline"
43
- s.header_mappings_dir = "../../.."
44
- end
41
+ resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_performancetimeline")
45
42
 
46
43
  s.dependency "React-featureflags"
47
44
  add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing')
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include "AppleSwitchShadowNode.h"
11
+
12
+ #include <react/renderer/core/ConcreteComponentDescriptor.h>
13
+
14
+ namespace facebook::react {
15
+
16
+ /*
17
+ * Descriptor for <Switch> component.
18
+ */
19
+ class SwitchComponentDescriptor final
20
+ : public ConcreteComponentDescriptor<SwitchShadowNode> {
21
+ public:
22
+ SwitchComponentDescriptor(const ComponentDescriptorParameters& parameters)
23
+ : ConcreteComponentDescriptor(parameters) {}
24
+
25
+ void adopt(ShadowNode& shadowNode) const override {
26
+ ConcreteComponentDescriptor::adopt(shadowNode);
27
+ }
28
+ };
29
+
30
+ } // namespace facebook::react
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include <react/renderer/components/FBReactNativeSpec/EventEmitters.h>
11
+ #include <react/renderer/components/FBReactNativeSpec/Props.h>
12
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
13
+
14
+ namespace facebook::react {
15
+
16
+ extern const char AppleSwitchComponentName[];
17
+
18
+ /*
19
+ * `ShadowNode` for <IOSSwitch> component.
20
+ */
21
+ class SwitchShadowNode final : public ConcreteViewShadowNode<
22
+ AppleSwitchComponentName,
23
+ SwitchProps,
24
+ SwitchEventEmitter> {
25
+ public:
26
+ using ConcreteViewShadowNode::ConcreteViewShadowNode;
27
+
28
+ static ShadowNodeTraits BaseTraits() {
29
+ auto traits = ConcreteViewShadowNode::BaseTraits();
30
+ traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
31
+ traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode);
32
+ return traits;
33
+ }
34
+
35
+ #pragma mark - LayoutableShadowNode
36
+
37
+ Size measureContent(
38
+ const LayoutContext& layoutContext,
39
+ const LayoutConstraints& layoutConstraints) const override;
40
+ };
41
+
42
+ } // namespace facebook::react
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <React/RCTUtils.h>
9
+ #import <UIKit/UIKit.h>
10
+ #include "AppleSwitchShadowNode.h"
11
+
12
+ namespace facebook::react {
13
+
14
+ extern const char AppleSwitchComponentName[] = "Switch";
15
+
16
+ #pragma mark - LayoutableShadowNode
17
+
18
+ Size SwitchShadowNode::measureContent(
19
+ const LayoutContext & /*layoutContext*/,
20
+ const LayoutConstraints & /*layoutConstraints*/) const
21
+ {
22
+ CGSize uiSwitchSize = RCTSwitchSize();
23
+ // Apple has some error when returning the width of the component and it doesn't
24
+ // account for the borders.
25
+ return {.width = uiSwitchSize.width + 2, .height = uiSwitchSize.height};
26
+ }
27
+
28
+ } // namespace facebook::react
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #import <AppKit/AppKit.h>
9
+ #include "AppleSwitchShadowNode.h"
10
+
11
+ namespace facebook::react {
12
+
13
+ extern const char AppleSwitchComponentName[] = "Switch";
14
+
15
+ #pragma mark - LayoutableShadowNode
16
+
17
+ Size SwitchShadowNode::measureContent(
18
+ const LayoutContext & /*layoutContext*/,
19
+ const LayoutConstraints & /*layoutConstraints*/) const
20
+ {
21
+ static CGSize nsSwitchSize = CGSizeZero;
22
+ static dispatch_once_t onceToken;
23
+ dispatch_once(&onceToken, ^{
24
+ dispatch_sync(dispatch_get_main_queue(), ^{
25
+ nsSwitchSize = [NSSwitch new].intrinsicContentSize;
26
+ });
27
+ });
28
+
29
+ return {.width = nsSwitchSize.width, .height = nsSwitchSize.height};
30
+ }
31
+
32
+ } // namespace facebook::react
@@ -13,6 +13,7 @@
13
13
  #include <react/renderer/components/view/ViewProps.h>
14
14
  #include <react/renderer/core/PropsParserContext.h>
15
15
  #include <react/renderer/graphics/Color.h>
16
+ #include <limits>
16
17
  #include <string>
17
18
 
18
19
  namespace facebook::react {
@@ -60,7 +61,7 @@ class BaseTextInputProps : public ViewProps, public BaseTextProps {
60
61
  // TODO: Rename to `tintColor` and make universal.
61
62
  SharedColor underlineColorAndroid{};
62
63
 
63
- int maxLength{};
64
+ int maxLength = std::numeric_limits<int>::max();
64
65
 
65
66
  /*
66
67
  * "Private" (only used by TextInput.js) props
@@ -38,8 +38,6 @@ Pod::Spec.new do |s|
38
38
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
39
39
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')}
40
40
 
41
- if ENV['USE_FRAMEWORKS']
42
- s.module_name = "React_rendererconsistency"
43
- s.header_mappings_dir = "../../.."
44
- end
41
+ resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_rendererconsistency")
42
+
45
43
  end
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  header_search_paths = []
20
20
 
21
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
21
+ if ENV['USE_FRAMEWORKS']
22
22
  header_search_paths << "\"$(PODS_TARGET_SRCROOT)/../../..\"" # this is needed to allow the renderer/css access its own files
23
23
  end
24
24
 
@@ -40,10 +40,7 @@ Pod::Spec.new do |s|
40
40
  "DEFINES_MODULE" => "YES",
41
41
  }
42
42
 
43
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
44
- s.module_name = "React_renderercss"
45
- s.header_mappings_dir = "../../.."
46
- end
43
+ resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_renderercss")
47
44
 
48
45
  add_dependency(s, "React-debug")
49
46
  add_dependency(s, "React-utils")
@@ -40,10 +40,7 @@ Pod::Spec.new do |s|
40
40
  "DEFINES_MODULE" => "YES"
41
41
  }
42
42
 
43
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
44
- s.module_name = "React_rendererdebug"
45
- s.header_mappings_dir = "../../.."
46
- end
43
+ resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_rendererdebug")
47
44
 
48
45
  add_dependency(s, "React-debug")
49
46
  add_rn_third_party_dependencies(s)
@@ -34,12 +34,12 @@ Pod::Spec.new do |s|
34
34
  s.header_dir = "react/renderer/graphics"
35
35
  s.framework = "UIKit"
36
36
 
37
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
38
- s.module_name = "React_graphics"
39
- s.header_mappings_dir = "../../.."
37
+ if ENV['USE_FRAMEWORKS']
40
38
  header_search_paths = header_search_paths + ["\"$(PODS_TARGET_SRCROOT)/platform/ios\""]
41
39
  end
42
40
 
41
+ resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_graphics")
42
+
43
43
  s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
44
44
  "HEADER_SEARCH_PATHS" => header_search_paths.join(" "),
45
45
  "DEFINES_MODULE" => "YES",
@@ -34,10 +34,7 @@ Pod::Spec.new do |s|
34
34
  s.source_files = podspec_sources(source_files, "**/*.h")
35
35
  s.header_dir = "react/renderer/imagemanager"
36
36
 
37
- if ENV['USE_FRAMEWORKS']
38
- s.module_name = "React_ImageManager"
39
- s.header_mappings_dir = "./"
40
- end
37
+ resolve_use_frameworks(s, header_mappings_dir: "./", module_name: "React_ImageManager")
41
38
 
42
39
  s.pod_target_xcconfig = {
43
40
  "USE_HEADERMAP" => "NO",
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
38
38
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
39
39
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')}
40
40
 
41
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
42
- s.module_name = "React_runtimescheduler"
43
- s.header_mappings_dir = "../../.."
44
- end
41
+ resolve_use_frameworks(s, header_mappings_dir: "../../..", module_name: "React_runtimescheduler")
45
42
 
46
43
  add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"])
47
44
  s.dependency "React-callinvoker"
@@ -33,10 +33,7 @@ Pod::Spec.new do |s|
33
33
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
34
34
  "GCC_WARN_PEDANTIC" => "YES" }
35
35
 
36
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
37
- s.header_mappings_dir = '../../'
38
- s.module_name = 'React_RuntimeCore'
39
- end
36
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_RuntimeCore")
40
37
 
41
38
  s.dependency "React-jsiexecutor"
42
39
  s.dependency "React-cxxreact"
@@ -32,10 +32,7 @@ Pod::Spec.new do |s|
32
32
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
33
33
  "GCC_WARN_PEDANTIC" => "YES" }
34
34
 
35
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
36
- s.header_mappings_dir = '../../'
37
- s.module_name = 'React_RuntimeHermes'
38
- end
35
+ resolve_use_frameworks(s, header_mappings_dir: "../../", module_name: "React_RuntimeHermes")
39
36
 
40
37
  s.dependency "React-jsitracing"
41
38
  s.dependency "React-jsi"
@@ -38,10 +38,7 @@ Pod::Spec.new do |s|
38
38
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
39
39
  "GCC_WARN_PEDANTIC" => "YES" }
40
40
 
41
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
42
- s.header_mappings_dir = './'
43
- s.module_name = 'React_RuntimeApple'
44
- end
41
+ resolve_use_frameworks(s, header_mappings_dir: "./", module_name: "React_RuntimeApple")
45
42
 
46
43
  s.dependency "React-jsiexecutor"
47
44
  s.dependency "React-cxxreact"
@@ -366,6 +366,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
366
366
 
367
367
  RCTScreenSize();
368
368
  RCTScreenScale();
369
+ RCTSwitchSize();
369
370
 
370
371
  std::lock_guard<std::mutex> lock(*mutex);
371
372
  *isReady = true;
@@ -37,8 +37,7 @@ Pod::Spec.new do |s|
37
37
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
38
38
  "DEFINES_MODULE" => "YES" }
39
39
 
40
- if ENV['USE_FRAMEWORKS']
41
- s.module_name = "React_timing"
42
- s.header_mappings_dir = "./"
43
- end
40
+ resolve_use_frameworks(s, header_mappings_dir: "./", module_name: "React_timing")
41
+
42
+ add_dependency(s, "React-debug")
44
43
  end
@@ -34,12 +34,12 @@ Pod::Spec.new do |s|
34
34
  s.header_dir = "react/utils"
35
35
  s.exclude_files = "tests"
36
36
 
37
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
38
- s.module_name = "React_utils"
39
- s.header_mappings_dir = "../.."
37
+ if ENV['USE_FRAMEWORKS']
40
38
  header_search_paths = header_search_paths + ["\"$(PODS_TARGET_SRCROOT)/platform/ios\""]
41
39
  end
42
40
 
41
+ resolve_use_frameworks(s, header_mappings_dir: "../..", module_name: "React_utils")
42
+
43
43
  s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
44
44
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
45
45
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
@@ -33,11 +33,12 @@ Pod::Spec.new do |s|
33
33
  s.source_files = podspec_sources(["ReactCommon/*.{m,mm,cpp,h}", "platform/ios/**/*.{m,mm,cpp,h}"], ["ReactCommon/*.h", "platform/ios/**/*.h"])
34
34
  s.header_dir = "ReactCommon"
35
35
 
36
- if ENV['USE_FRAMEWORKS'] && ReactNativeCoreUtils.build_rncore_from_source()
37
- s.header_mappings_dir = '.'
36
+ if ENV['USE_FRAMEWORKS']
38
37
  header_search_paths = header_search_paths + ["\"$(PODS_TARGET_SRCROOT)/platform/ios\""]
39
38
  end
40
39
 
40
+ resolve_use_frameworks(s, header_mappings_dir: ".")
41
+
41
42
  s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO",
42
43
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
43
44
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.81.0",
3
+ "version": "0.81.1",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -162,13 +162,13 @@
162
162
  },
163
163
  "dependencies": {
164
164
  "@jest/create-cache-key-function": "^29.7.0",
165
- "@react-native/assets-registry": "0.81.0",
166
- "@react-native/codegen": "0.81.0",
167
- "@react-native/community-cli-plugin": "0.81.0",
168
- "@react-native/gradle-plugin": "0.81.0",
169
- "@react-native/js-polyfills": "0.81.0",
170
- "@react-native/normalize-colors": "0.81.0",
171
- "@react-native/virtualized-lists": "0.81.0",
165
+ "@react-native/assets-registry": "0.81.1",
166
+ "@react-native/codegen": "0.81.1",
167
+ "@react-native/community-cli-plugin": "0.81.1",
168
+ "@react-native/gradle-plugin": "0.81.1",
169
+ "@react-native/js-polyfills": "0.81.1",
170
+ "@react-native/normalize-colors": "0.81.1",
171
+ "@react-native/virtualized-lists": "0.81.1",
172
172
  "abort-controller": "^3.0.0",
173
173
  "anser": "^1.4.9",
174
174
  "ansi-regex": "^5.0.0",
@@ -85,6 +85,7 @@ class NewArchitectureHelper
85
85
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-Fabric", "React_Fabric", ["react/renderer/components/view/platform/cxx"]))
86
86
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-FabricImage", "React_FabricImage", []))
87
87
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon", "ReactCommon", ["react/nativemodule/core"]))
88
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-runtimeexecutor", "React_runtimeexecutor", ["platform/ios"]))
88
89
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-NativeModulesApple", "React_NativeModulesApple", []))
89
90
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-RCTFabric", "RCTFabric", []))
90
91
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-utils", "React_utils", []))
@@ -258,7 +258,8 @@ class ReactNativePodsUtils
258
258
  search_paths = []
259
259
 
260
260
  # When building using the prebuilt rncore we can't use framework folders as search paths since these aren't created
261
- if ReactNativeCoreUtils.build_rncore_from_source()
261
+ # Except for when adding search path for ReactCodegen since it contains source code.
262
+ if ReactNativeCoreUtils.build_rncore_from_source() || pod_name === "ReactCodegen"
262
263
  platforms = $RN_PLATFORMS != nil ? $RN_PLATFORMS : []
263
264
 
264
265
  if platforms.empty?() || platforms.length() == 1
@@ -313,6 +314,7 @@ class ReactNativePodsUtils
313
314
  header_search_paths = config.build_settings["HEADER_SEARCH_PATHS"] ||= "$(inherited)"
314
315
 
315
316
  ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon", "ReactCommon", ["react/nativemodule/core"])
317
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-runtimeexecutor", "React_runtimeexecutor", ["platform/ios"]))
316
318
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon-Samples", "ReactCommon_Samples", ["platform/ios"]))
317
319
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-Fabric", "React_Fabric", ["react/renderer/components/view/platform/cxx"], false))
318
320
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-NativeModulesApple", "React_NativeModulesApple", []))
@@ -563,6 +565,7 @@ class ReactNativePodsUtils
563
565
 
564
566
  def self.set_reactcommon_searchpaths(target_installation_result)
565
567
  header_search_paths = ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon", "ReactCommon", ["react/nativemodule/core"])
568
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-runtimeexecutor", "React_runtimeexecutor", ["platform/ios"]))
566
569
  .map { |search_path| "\"#{search_path}\"" }
567
570
  ReactNativePodsUtils.update_header_paths_if_depends_on(target_installation_result, "ReactCommon", header_search_paths)
568
571
  end
@@ -699,4 +702,15 @@ class ReactNativePodsUtils
699
702
  end
700
703
  end
701
704
  end
705
+
706
+ def self.resolve_use_frameworks(spec, header_mappings_dir: nil, module_name: nil)
707
+ return unless ENV['USE_FRAMEWORKS']
708
+ if module_name
709
+ spec.module_name = module_name
710
+ end
711
+
712
+ if header_mappings_dir != nil && ReactNativeCoreUtils.build_rncore_from_source()
713
+ spec.header_mappings_dir = header_mappings_dir
714
+ end
715
+ end
702
716
  end
@@ -83,9 +83,9 @@ export RCT_SCRIPT_APP_PATH="$RCT_SCRIPT_POD_INSTALLATION_ROOT/${relativeAppPath.
83
83
  export RCT_SCRIPT_OUTPUT_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT"
84
84
  export RCT_SCRIPT_TYPE="withCodegenDiscovery"
85
85
 
86
- SCRIPT_PHASES_SCRIPT="$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh"
87
- WITH_ENVIRONMENT="$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh"
88
- /bin/sh -c "$WITH_ENVIRONMENT $SCRIPT_PHASES_SCRIPT"
86
+ export SCRIPT_PHASES_SCRIPT="$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh"
87
+ export WITH_ENVIRONMENT="$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh"
88
+ /bin/sh -c '"$WITH_ENVIRONMENT" "$SCRIPT_PHASES_SCRIPT"'
89
89
  SCRIPT`;
90
90
  }
91
91
 
@@ -33,6 +33,7 @@ if use_frameworks
33
33
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-FabricImage", "React_FabricImage", []))
34
34
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-graphics", "React_graphics", ["react/renderer/graphics/platform/ios"]))
35
35
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon", "ReactCommon", ["react/nativemodule/core"]))
36
+ .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-runtimeexecutor", "React_runtimeexecutor", ["platform/ios"]))
36
37
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-NativeModulesApple", "React_NativeModulesApple", []))
37
38
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-RCTFabric", "RCTFabric", []))
38
39
  .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-debug", "React_debug", []))
@@ -10,7 +10,7 @@
10
10
 
11
11
  # Print commands before executing them (useful for troubleshooting)
12
12
  set -x -e
13
- DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
13
+ DEST="$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH"
14
14
 
15
15
  # Enables iOS devices to get the IP address of the machine running Metro
16
16
  if [[ ! "$SKIP_BUNDLING_METRO_IP" && "$CONFIGURATION" = *Debug* && ! "$PLATFORM_NAME" == *simulator ]]; then
@@ -59,7 +59,7 @@ esac
59
59
  # Path to react-native folder inside node_modules
60
60
  REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
61
61
  # Most projects have their project root, one level up from their Xcode project dir (the "ios" directory)
62
- PROJECT_ROOT=${PROJECT_ROOT:-"$PROJECT_DIR/.."}
62
+ PROJECT_ROOT="${PROJECT_ROOT:-"$PROJECT_DIR/.."}"
63
63
 
64
64
  cd "$PROJECT_ROOT" || exit
65
65
 
@@ -229,6 +229,20 @@ def folly_flags()
229
229
  return NewArchitectureHelper.folly_compiler_flags
230
230
  end
231
231
 
232
+ # Resolve the spec for use with the USE_FRAMEWORKS environment variable. To avoid each podspec
233
+ # to manually specify the header mappings and module name, we can use this helper function.
234
+ # This helper will also resolve header mappings if we're building from source. Precompiled
235
+ # React-Core will not generate frameworks since their podspec files only contains the
236
+ # header files and no source code - so header_mappings should be the same as for without USE_FRAMEWORKS
237
+ #
238
+ # Parameters:
239
+ # - s: the spec to modify
240
+ # - header_mappings_dir: the directory to map headers when building Pod header structure
241
+ # - module_name: the name of the module when exposed to swift
242
+ def resolve_use_frameworks(spec, header_mappings_dir: nil, module_name: nil)
243
+ ReactNativePodsUtils.resolve_use_frameworks(spec, :header_mappings_dir => header_mappings_dir, :module_name => module_name)
244
+ end
245
+
232
246
  # Add a dependency to a spec, making sure that the HEADER_SERACH_PATHS are set properly.
233
247
  # This function automate the requirement to specify the HEADER_SEARCH_PATHS which was error prone
234
248
  # and hard to pull out properly to begin with.
@@ -483,6 +497,13 @@ def react_native_post_install(
483
497
  ReactNativePodsUtils.updateOSDeploymentTarget(installer)
484
498
  ReactNativePodsUtils.set_dynamic_frameworks_flags(installer)
485
499
  ReactNativePodsUtils.add_ndebug_flag_to_pods_in_release(installer)
500
+
501
+ if !ReactNativeCoreUtils.build_rncore_from_source()
502
+ # In XCode 26 we need to revert the new setting SWIFT_ENABLE_EXPLICIT_MODULES when building
503
+ # with precompiled binaries.
504
+ ReactNativePodsUtils.set_build_setting(installer, build_setting: "SWIFT_ENABLE_EXPLICIT_MODULES", value: "NO")
505
+ end
506
+
486
507
  SPM.apply_on_post_install(installer)
487
508
 
488
509
  if privacy_file_aggregation_enabled
@@ -43,5 +43,5 @@ fi
43
43
 
44
44
  # Execute argument, if present
45
45
  if [ -n "$1" ]; then
46
- $1
46
+ "$1"
47
47
  fi
Binary file
Binary file
Binary file
@@ -58,4 +58,5 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
58
58
  export default (codegenNativeComponent<SwitchNativeProps>('Switch', {
59
59
  paperComponentName: 'RCTSwitch',
60
60
  excludedPlatforms: ['android'],
61
+ interfaceOnly: true,
61
62
  }): ComponentType);
@@ -64,7 +64,7 @@ Pod::Spec.new do |spec|
64
64
 
65
65
  cp -R "$HEADERS_PATH/" Headers
66
66
  mkdir -p framework/packages/react-native
67
- cp -R "$XCFRAMEWORK_PATH/.." framework/packages/react-native/
67
+ cp -R "$XCFRAMEWORK_PATH/../." framework/packages/react-native/
68
68
  find "$XCFRAMEWORK_PATH/.." -type f -exec rm {} +
69
69
  find "$CURRENT_PATH" -type d -empty -delete
70
70
  CMD