react-native 0.75.2 → 0.75.4

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 (28) hide show
  1. package/Libraries/Blob/RCTFileReaderModule.mm +4 -3
  2. package/Libraries/Core/ReactNativeVersion.js +1 -1
  3. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +17 -15
  4. package/React/Base/RCTVersion.m +1 -1
  5. package/React/Views/RCTModalHostView.m +1 -0
  6. package/ReactAndroid/api/ReactAndroid.api +3 -2
  7. package/ReactAndroid/gradle.properties +1 -1
  8. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.java +2 -4
  9. package/ReactAndroid/src/main/java/com/facebook/react/jstasks/HeadlessJsTaskContext.java +13 -14
  10. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  11. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java +9 -4
  12. package/ReactAndroid/src/main/java/com/facebook/react/views/imagehelper/ImageSource.kt +6 -4
  13. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +8 -0
  14. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +1 -8
  15. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocketDelegate.cpp +11 -2
  16. package/ReactAndroid/src/main/jni/react/devsupport/JCxxInspectorPackagerConnectionWebSocketDelegate.h +1 -3
  17. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  18. package/package.json +12 -11
  19. package/scripts/bundle.js +2 -0
  20. package/scripts/cocoapods/autolinking.rb +2 -1
  21. package/scripts/codegen/generate-artifacts-executor.js +3 -2
  22. package/scripts/react-native-xcode.sh +3 -2
  23. package/sdks/hermes-engine/utils/build-ios-framework.sh +2 -2
  24. package/sdks/hermesc/osx-bin/hermes +0 -0
  25. package/sdks/hermesc/osx-bin/hermesc +0 -0
  26. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  27. package/ReactAndroid/src/main/jni/react/devsupport/JOptional.cpp +0 -29
  28. package/ReactAndroid/src/main/jni/react/devsupport/JOptional.h +0 -27
@@ -72,9 +72,10 @@ RCT_EXPORT_METHOD(readAsDataURL
72
72
  nil);
73
73
  } else {
74
74
  NSString *type = [RCTConvert NSString:blob[@"type"]];
75
- NSString *text = [NSString stringWithFormat:@"data:%@;base64,%@",
76
- type != nil && [type length] > 0 ? type : @"application/octet-stream",
77
- [data base64EncodedStringWithOptions:0]];
75
+ NSString *text = [NSString
76
+ stringWithFormat:@"data:%@;base64,%@",
77
+ ![type isEqual:[NSNull null]] && [type length] > 0 ? type : @"application/octet-stream",
78
+ [data base64EncodedStringWithOptions:0]];
78
79
 
79
80
  resolve(text);
80
81
  }
@@ -16,7 +16,7 @@ const version: $ReadOnly<{
16
16
  }> = {
17
17
  major: 0,
18
18
  minor: 75,
19
- patch: 2,
19
+ patch: 4,
20
20
  prerelease: null,
21
21
  };
22
22
 
@@ -182,21 +182,23 @@ type MaximumOneOf<T, K extends keyof T = keyof T> = K extends keyof T
182
182
 
183
183
  export interface TransformsStyle {
184
184
  transform?:
185
- | MaximumOneOf<
186
- PerspectiveTransform &
187
- RotateTransform &
188
- RotateXTransform &
189
- RotateYTransform &
190
- RotateZTransform &
191
- ScaleTransform &
192
- ScaleXTransform &
193
- ScaleYTransform &
194
- TranslateXTransform &
195
- TranslateYTransform &
196
- SkewXTransform &
197
- SkewYTransform &
198
- MatrixTransform
199
- >[]
185
+ | Readonly<
186
+ MaximumOneOf<
187
+ PerspectiveTransform &
188
+ RotateTransform &
189
+ RotateXTransform &
190
+ RotateYTransform &
191
+ RotateZTransform &
192
+ ScaleTransform &
193
+ ScaleXTransform &
194
+ ScaleYTransform &
195
+ TranslateXTransform &
196
+ TranslateYTransform &
197
+ SkewXTransform &
198
+ SkewYTransform &
199
+ MatrixTransform
200
+ >[]
201
+ >
200
202
  | string
201
203
  | undefined;
202
204
  transformOrigin?: Array<string | number> | string | undefined;
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(75),
26
- RCTVersionPatch: @(2),
26
+ RCTVersionPatch: @(4),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -119,6 +119,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : coder)
119
119
  if (_isPresented) {
120
120
  [_delegate dismissModalHostView:self withViewController:_modalViewController animated:[self hasAnimationType]];
121
121
  _isPresented = NO;
122
+ [self setVisible:NO];
122
123
  }
123
124
  }
124
125
 
@@ -6459,9 +6459,9 @@ public class com/facebook/react/views/imagehelper/ImageSource {
6459
6459
  public final fun getSize ()D
6460
6460
  public final fun getSource ()Ljava/lang/String;
6461
6461
  public static final fun getTransparentBitmapImageSource (Landroid/content/Context;)Lcom/facebook/react/views/imagehelper/ImageSource;
6462
- public final fun getUri ()Landroid/net/Uri;
6462
+ public fun getUri ()Landroid/net/Uri;
6463
6463
  public fun hashCode ()I
6464
- public final fun isResource ()Z
6464
+ public fun isResource ()Z
6465
6465
  }
6466
6466
 
6467
6467
  public final class com/facebook/react/views/imagehelper/ImageSource$Companion {
@@ -7732,6 +7732,7 @@ public class com/facebook/react/views/textinput/ReactEditText : androidx/appcomp
7732
7732
  public fun setBorderStyle (Ljava/lang/String;)V
7733
7733
  public fun setBorderWidth (IF)V
7734
7734
  public fun setContentSizeWatcher (Lcom/facebook/react/views/textinput/ContentSizeWatcher;)V
7735
+ public fun setContextMenuHidden (Z)V
7735
7736
  public fun setDisableFullscreenUI (Z)V
7736
7737
  public fun setFontFamily (Ljava/lang/String;)V
7737
7738
  public fun setFontFeatureSettings (Ljava/lang/String;)V
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.75.2
1
+ VERSION_NAME=0.75.4
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -13,7 +13,6 @@ import androidx.annotation.Nullable;
13
13
  import com.facebook.jni.HybridData;
14
14
  import com.facebook.proguard.annotations.DoNotStrip;
15
15
  import java.io.Closeable;
16
- import java.util.OptionalInt;
17
16
  import java.util.concurrent.TimeUnit;
18
17
  import okhttp3.OkHttpClient;
19
18
  import okhttp3.Request;
@@ -47,7 +46,7 @@ import okhttp3.WebSocketListener;
47
46
  private static class WebSocketDelegate implements Closeable {
48
47
  private final HybridData mHybridData;
49
48
 
50
- public native void didFailWithError(OptionalInt posixCode, String error);
49
+ public native void didFailWithError(@Nullable Integer posixCode, String error);
51
50
 
52
51
  public native void didReceiveMessage(String message);
53
52
 
@@ -103,8 +102,7 @@ import okhttp3.WebSocketListener;
103
102
  @Override
104
103
  public void onFailure(WebSocket _unused, Throwable t, @Nullable Response response) {
105
104
  @Nullable String message = t.getMessage();
106
- delegate.didFailWithError(
107
- OptionalInt.empty(), message != null ? message : "<Unknown error>");
105
+ delegate.didFailWithError(null, message != null ? message : "<Unknown error>");
108
106
  // "No further calls to this listener will be made." -OkHttp docs for
109
107
  // WebSocketListener.onFailure
110
108
  delegate.close();
@@ -169,26 +169,25 @@ public class HeadlessJsTaskContext {
169
169
 
170
170
  /**
171
171
  * Finish a JS task. Doesn't actually stop the task on the JS side, only removes it from the list
172
- * of active tasks and notifies listeners. A task can only be finished once.
172
+ * of active tasks and notifies listeners.
173
173
  *
174
174
  * @param taskId the unique id returned by {@link #startTask}.
175
175
  */
176
176
  public synchronized void finishTask(final int taskId) {
177
- Assertions.assertCondition(
178
- mActiveTasks.remove(taskId), "Tried to finish non-existent task with id " + taskId + ".");
179
- Assertions.assertCondition(
180
- mActiveTaskConfigs.remove(taskId) != null,
181
- "Tried to remove non-existent task config with id " + taskId + ".");
177
+ boolean removed = mActiveTasks.remove(taskId);
178
+ mActiveTaskConfigs.remove(taskId);
182
179
  removeTimeout(taskId);
183
- UiThreadUtil.runOnUiThread(
184
- new Runnable() {
185
- @Override
186
- public void run() {
187
- for (HeadlessJsTaskEventListener listener : mHeadlessJsTaskEventListeners) {
188
- listener.onHeadlessJsTaskFinish(taskId);
180
+ if (removed) {
181
+ UiThreadUtil.runOnUiThread(
182
+ new Runnable() {
183
+ @Override
184
+ public void run() {
185
+ for (HeadlessJsTaskEventListener listener : mHeadlessJsTaskEventListeners) {
186
+ listener.onHeadlessJsTaskFinish(taskId);
187
+ }
189
188
  }
190
- }
191
- });
189
+ });
190
+ }
192
191
  }
193
192
 
194
193
  private void removeTimeout(int taskId) {
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 75,
20
- "patch", 2,
20
+ "patch", 4,
21
21
  "prerelease", null);
22
22
  }
@@ -605,6 +605,7 @@ public class CSSBackgroundDrawable extends Drawable {
605
605
  }
606
606
 
607
607
  // Clip border ONLY if its color is non transparent
608
+ float pathAdjustment = 0f;
608
609
  if (Color.alpha(colorLeft) != 0
609
610
  && Color.alpha(colorTop) != 0
610
611
  && Color.alpha(colorRight) != 0
@@ -615,6 +616,10 @@ public class CSSBackgroundDrawable extends Drawable {
615
616
  mInnerClipTempRectForBorderRadius.bottom -= borderWidth.bottom;
616
617
  mInnerClipTempRectForBorderRadius.left += borderWidth.left;
617
618
  mInnerClipTempRectForBorderRadius.right -= borderWidth.right;
619
+
620
+ // only close gap between border and main path if we draw the border, otherwise
621
+ // we wind up pixelating small pixel-radius curves
622
+ pathAdjustment = mGapBetweenPaths;
618
623
  }
619
624
 
620
625
  mTempRectForCenterDrawPath.top += borderWidth.top * 0.5f;
@@ -661,10 +666,10 @@ public class CSSBackgroundDrawable extends Drawable {
661
666
  // (mInnerClipTempRectForBorderRadius), ensuring the border can be
662
667
  // drawn on top without the gap.
663
668
  mBackgroundColorRenderPath.addRoundRect(
664
- mInnerClipTempRectForBorderRadius.left - mGapBetweenPaths,
665
- mInnerClipTempRectForBorderRadius.top - mGapBetweenPaths,
666
- mInnerClipTempRectForBorderRadius.right + mGapBetweenPaths,
667
- mInnerClipTempRectForBorderRadius.bottom + mGapBetweenPaths,
669
+ mInnerClipTempRectForBorderRadius.left - pathAdjustment,
670
+ mInnerClipTempRectForBorderRadius.top - pathAdjustment,
671
+ mInnerClipTempRectForBorderRadius.right + pathAdjustment,
672
+ mInnerClipTempRectForBorderRadius.bottom + pathAdjustment,
668
673
  new float[] {
669
674
  innerTopLeftRadiusX,
670
675
  innerTopLeftRadiusY,
@@ -23,12 +23,14 @@ constructor(
23
23
  ) {
24
24
 
25
25
  /** Get the URI for this image - can be either a parsed network URI or a resource URI. */
26
- public val uri: Uri = computeUri(context)
26
+ public open val uri: Uri = computeUri(context)
27
27
  /** Get the area of this image. */
28
28
  public val size: Double = width * height
29
29
  /** Get whether this image source represents an Android resource or a network URI. */
30
- public var isResource: Boolean = false
31
- private set
30
+ public open val isResource: Boolean
31
+ get() = _isResource
32
+
33
+ private var _isResource: Boolean = false
32
34
 
33
35
  override fun equals(other: Any?): Boolean {
34
36
  if (this === other) {
@@ -58,7 +60,7 @@ constructor(
58
60
  }
59
61
 
60
62
  private fun computeLocalUri(context: Context): Uri {
61
- isResource = true
63
+ _isResource = true
62
64
  return ResourceDrawableIdHelper.instance.getResourceDrawableUri(context, source)
63
65
  }
64
66
 
@@ -118,6 +118,7 @@ public class ReactEditText extends AppCompatEditText {
118
118
  private int mFontWeight = ReactConstants.UNSET;
119
119
  private int mFontStyle = ReactConstants.UNSET;
120
120
  private boolean mAutoFocus = false;
121
+ private boolean mContextMenuHidden = false;
121
122
  private boolean mDidAttachToWindow = false;
122
123
  private @Nullable String mPlaceholder = null;
123
124
 
@@ -191,6 +192,9 @@ public class ReactEditText extends AppCompatEditText {
191
192
  */
192
193
  @Override
193
194
  public boolean onCreateActionMode(ActionMode mode, Menu menu) {
195
+ if (mContextMenuHidden) {
196
+ return false;
197
+ }
194
198
  menu.removeItem(android.R.id.pasteAsPlainText);
195
199
  return true;
196
200
  }
@@ -1121,6 +1125,10 @@ public class ReactEditText extends AppCompatEditText {
1121
1125
  mAutoFocus = autoFocus;
1122
1126
  }
1123
1127
 
1128
+ public void setContextMenuHidden(boolean contextMenuHidden) {
1129
+ mContextMenuHidden = contextMenuHidden;
1130
+ }
1131
+
1124
1132
  protected void applyTextAttributes() {
1125
1133
  // In general, the `getEffective*` functions return `Float.NaN` if the
1126
1134
  // property hasn't been set.
@@ -651,14 +651,7 @@ public class ReactTextInputManager extends BaseViewManager<ReactEditText, Layout
651
651
 
652
652
  @ReactProp(name = "contextMenuHidden", defaultBoolean = false)
653
653
  public void setContextMenuHidden(ReactEditText view, boolean contextMenuHidden) {
654
- final boolean _contextMenuHidden = contextMenuHidden;
655
- view.setOnLongClickListener(
656
- new View.OnLongClickListener() {
657
- public boolean onLongClick(View v) {
658
- return _contextMenuHidden;
659
- }
660
- ;
661
- });
654
+ view.setContextMenuHidden(contextMenuHidden);
662
655
  }
663
656
 
664
657
  @ReactProp(name = "selectTextOnFocus", defaultBoolean = false)
@@ -7,6 +7,8 @@
7
7
 
8
8
  #include "JCxxInspectorPackagerConnectionWebSocketDelegate.h"
9
9
 
10
+ #include <optional>
11
+
10
12
  using namespace facebook::jni;
11
13
 
12
14
  namespace facebook::react::jsinspector_modern {
@@ -17,10 +19,17 @@ JCxxInspectorPackagerConnectionWebSocketDelegate::
17
19
  : cxxDelegate_(cxxDelegate) {}
18
20
 
19
21
  void JCxxInspectorPackagerConnectionWebSocketDelegate::didFailWithError(
20
- alias_ref<JOptionalInt::javaobject> posixCode,
22
+ alias_ref<jni::JInteger> posixCode,
21
23
  const std::string& error) {
24
+ std::optional<int> posixCodeVal;
25
+
26
+ // Handle @Nullable JInteger param
27
+ if (posixCode.get() != nullptr) {
28
+ posixCodeVal = posixCode->intValue();
29
+ }
30
+
22
31
  if (auto delegate = cxxDelegate_.lock()) {
23
- delegate->didFailWithError(*posixCode, error);
32
+ delegate->didFailWithError(posixCodeVal, error);
24
33
  }
25
34
  }
26
35
 
@@ -7,8 +7,6 @@
7
7
 
8
8
  #pragma once
9
9
 
10
- #include "JOptional.h"
11
-
12
10
  #include <fbjni/fbjni.h>
13
11
  #include <jsinspector-modern/InspectorPackagerConnection.h>
14
12
 
@@ -29,7 +27,7 @@ class JCxxInspectorPackagerConnectionWebSocketDelegate
29
27
  "Lcom/facebook/react/devsupport/CxxInspectorPackagerConnection$WebSocketDelegate;";
30
28
 
31
29
  void didFailWithError(
32
- jni::alias_ref<JOptionalInt::javaobject> posixCode,
30
+ jni::alias_ref<jni::JInteger> posixCode,
33
31
  const std::string& error);
34
32
 
35
33
  void didReceiveMessage(const std::string& message);
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 75;
20
- int32_t Patch = 2;
20
+ int32_t Patch = 4;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.75.2",
3
+ "version": "0.75.4",
4
4
  "description": "A framework for building native apps using React",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -109,21 +109,22 @@
109
109
  },
110
110
  "dependencies": {
111
111
  "@jest/create-cache-key-function": "^29.6.3",
112
- "@react-native-community/cli": "14.0.0",
113
- "@react-native-community/cli-platform-android": "14.0.0",
114
- "@react-native-community/cli-platform-ios": "14.0.0",
115
- "@react-native/assets-registry": "0.75.2",
116
- "@react-native/codegen": "0.75.2",
117
- "@react-native/community-cli-plugin": "0.75.2",
118
- "@react-native/gradle-plugin": "0.75.2",
119
- "@react-native/js-polyfills": "0.75.2",
120
- "@react-native/normalize-colors": "0.75.2",
121
- "@react-native/virtualized-lists": "0.75.2",
112
+ "@react-native-community/cli": "14.1.0",
113
+ "@react-native-community/cli-platform-android": "14.1.0",
114
+ "@react-native-community/cli-platform-ios": "14.1.0",
115
+ "@react-native/assets-registry": "0.75.4",
116
+ "@react-native/codegen": "0.75.4",
117
+ "@react-native/community-cli-plugin": "0.75.4",
118
+ "@react-native/gradle-plugin": "0.75.4",
119
+ "@react-native/js-polyfills": "0.75.4",
120
+ "@react-native/normalize-colors": "0.75.4",
121
+ "@react-native/virtualized-lists": "0.75.4",
122
122
  "abort-controller": "^3.0.0",
123
123
  "anser": "^1.4.9",
124
124
  "ansi-regex": "^5.0.0",
125
125
  "base64-js": "^1.5.1",
126
126
  "chalk": "^4.0.0",
127
+ "commander": "^9.4.1",
127
128
  "event-target-shim": "^5.0.1",
128
129
  "flow-enums-runtime": "^0.0.6",
129
130
  "glob": "^7.1.1",
package/scripts/bundle.js CHANGED
@@ -31,6 +31,8 @@ program
31
31
  'npx react-native config',
32
32
  )
33
33
  .option('--load-config <string>', 'JSON project config')
34
+ .option('--verbose', 'Additional logs', () => true, false)
35
+ .allowUnknownOption()
34
36
  .action(async function handleAction() {
35
37
  let config = null;
36
38
  let options = program.opts();
@@ -73,6 +73,7 @@ def list_native_modules!(config_command)
73
73
  found_pods.push({
74
74
  "configurations": configurations,
75
75
  "name": name,
76
+ "root": package["root"],
76
77
  "path": relative_path.to_path,
77
78
  "podspec_path": podspec_path,
78
79
  "script_phases": script_phases
@@ -168,7 +169,7 @@ def link_native_modules!(config)
168
169
 
169
170
  # Support passing in a path relative to the root of the package
170
171
  if phase["path"]
171
- phase["script"] = File.read(File.expand_path(phase["path"], package[:path]))
172
+ phase["script"] = File.read(File.expand_path(phase["path"], package[:root]))
172
173
  phase.delete("path")
173
174
  end
174
175
 
@@ -225,7 +225,7 @@ function extractSupportedApplePlatforms(dependency, dependencyPath) {
225
225
  return supportedPlatformsMap;
226
226
  }
227
227
 
228
- function findExternalLibraries(pkgJson) {
228
+ function findExternalLibraries(pkgJson, projectRoot) {
229
229
  const dependencies = {
230
230
  ...pkgJson.dependencies,
231
231
  ...pkgJson.devDependencies,
@@ -240,6 +240,7 @@ function findExternalLibraries(pkgJson) {
240
240
  try {
241
241
  const configFilePath = require.resolve(
242
242
  path.join(dependency, 'package.json'),
243
+ {paths: [projectRoot]},
243
244
  );
244
245
  const configFile = JSON.parse(fs.readFileSync(configFilePath));
245
246
  const codegenConfigFileDir = path.dirname(configFilePath);
@@ -533,7 +534,7 @@ function findCodegenEnabledLibraries(pkgJson, projectRoot) {
533
534
  } else {
534
535
  return [
535
536
  ...projectLibraries,
536
- ...findExternalLibraries(pkgJson),
537
+ ...findExternalLibraries(pkgJson, projectRoot),
537
538
  ...findLibrariesFromReactNativeConfig(projectRoot),
538
539
  ];
539
540
  }
@@ -92,6 +92,8 @@ fi
92
92
 
93
93
  [ -z "$CLI_PATH" ] && CLI_PATH="$REACT_NATIVE_DIR/scripts/bundle.js"
94
94
 
95
+ [ -z "$BUNDLE_COMMAND" ] && BUNDLE_COMMAND="bundle"
96
+
95
97
  [ -z "$COMPOSE_SOURCEMAP_PATH" ] && COMPOSE_SOURCEMAP_PATH="$REACT_NATIVE_DIR/scripts/compose-source-maps.js"
96
98
 
97
99
  if [[ -z "$BUNDLE_CONFIG" ]]; then
@@ -141,7 +143,7 @@ fi
141
143
  if [[ -n "$CONFIG_JSON" ]]; then
142
144
  EXTRA_ARGS+=("--load-config" "$CONFIG_JSON")
143
145
  elif [[ -n "$CONFIG_CMD" ]]; then
144
- EXTRA_ARGS+=("--config-cmd" "$CONFIG_APP")
146
+ EXTRA_ARGS+=("--config-cmd" "$CONFIG_CMD")
145
147
  else
146
148
  EXTRA_ARGS+=("--config-cmd" "$NODE_BINARY $NODE_ARGS $REACT_NATIVE_DIR/cli.js config")
147
149
  fi
@@ -149,7 +151,6 @@ fi
149
151
  # shellcheck disable=SC2086
150
152
  "$NODE_BINARY" $NODE_ARGS "$CLI_PATH" $BUNDLE_COMMAND \
151
153
  $CONFIG_ARG \
152
- --config-cmd "$CONFIG" \
153
154
  --entry-file "$ENTRY_FILE" \
154
155
  --platform "$BUNDLE_PLATFORM" \
155
156
  --dev $DEV \
@@ -12,9 +12,9 @@ set -e
12
12
  # Given a specific target, retrieve the right architecture for it
13
13
  # $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, xros, xrsimulator
14
14
  function get_architecture {
15
- if [[ $1 == "iphoneos" || $1 == "xros" || $1 == "xrsimulator" ]]; then
15
+ if [[ $1 == "iphoneos" || $1 == "xros" ]]; then
16
16
  echo "arm64"
17
- elif [[ $1 == "iphonesimulator" ]]; then
17
+ elif [[ $1 == "iphonesimulator" || $1 == "xrsimulator" ]]; then
18
18
  echo "x86_64;arm64"
19
19
  elif [[ $1 == "catalyst" ]]; then
20
20
  echo "x86_64;arm64"
Binary file
Binary file
Binary file
@@ -1,29 +0,0 @@
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
- #include "JOptional.h"
9
-
10
- namespace facebook::react {
11
-
12
- int JOptionalInt::getAsInt() const {
13
- static auto method = javaClassStatic()->getMethod<jint()>("getAsInt");
14
- return method(self());
15
- }
16
-
17
- bool JOptionalInt::isPresent() const {
18
- static auto method = javaClassStatic()->getMethod<jboolean()>("isPresent");
19
- return method(self());
20
- }
21
-
22
- JOptionalInt::operator std::optional<int>() const {
23
- if (!isPresent()) {
24
- return {};
25
- }
26
- return getAsInt();
27
- }
28
-
29
- } // namespace facebook::react
@@ -1,27 +0,0 @@
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 <fbjni/fbjni.h>
11
-
12
- #include <optional>
13
-
14
- // TODO(moti): Consider moving this into fbjni
15
-
16
- namespace facebook::react {
17
-
18
- class JOptionalInt : public facebook::jni::JavaClass<JOptionalInt> {
19
- public:
20
- static auto constexpr kJavaDescriptor = "Ljava/util/OptionalInt;";
21
-
22
- int getAsInt() const;
23
- bool isPresent() const;
24
- operator std::optional<int>() const;
25
- };
26
-
27
- } // namespace facebook::react