react-native 0.79.5 → 0.79.7

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 (30) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/React/Base/RCTVersion.m +1 -1
  3. package/ReactAndroid/gradle.properties +1 -1
  4. package/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +2 -2
  5. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +18 -3
  6. package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java +37 -19
  7. package/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt +3 -16
  8. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  9. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/DisplayMetricsHolder.kt +13 -0
  10. package/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +0 -3
  11. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +26 -0
  12. package/ReactCommon/React-FabricComponents.podspec +5 -1
  13. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  14. package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp +12 -8
  15. package/ReactCommon/react/renderer/components/modal/CMakeLists.txt +4 -1
  16. package/ReactCommon/react/renderer/components/modal/ModalHostViewComponentDescriptor.h +3 -2
  17. package/ReactCommon/react/renderer/components/modal/ModalHostViewState.h +4 -12
  18. package/ReactCommon/react/renderer/components/modal/ModalHostViewUtils.h +2 -2
  19. package/ReactCommon/react/renderer/components/modal/ModalHostViewUtils.mm +1 -1
  20. package/ReactCommon/react/renderer/components/modal/platform/android/JReactModalHostView.h +38 -0
  21. package/ReactCommon/react/renderer/components/modal/platform/android/ModalHostViewUtils.cpp +18 -0
  22. package/ReactCommon/react/renderer/components/modal/platform/cxx/ModalHostViewUtils.cpp +17 -0
  23. package/package.json +8 -8
  24. package/sdks/hermes-engine/hermes-utils.rb +4 -1
  25. package/sdks/hermesc/osx-bin/hermes +0 -0
  26. package/sdks/hermesc/osx-bin/hermesc +0 -0
  27. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  28. package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
  29. package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
  30. package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
@@ -16,6 +16,6 @@ export const version: $ReadOnly<{
16
16
  }> = {
17
17
  major: 0,
18
18
  minor: 79,
19
- patch: 5,
19
+ patch: 7,
20
20
  prerelease: null,
21
21
  };
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(79),
26
- RCTVersionPatch: @(5),
26
+ RCTVersionPatch: @(7),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.79.5
1
+ VERSION_NAME=0.79.7
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -1399,14 +1399,14 @@ public class ReactInstanceManager {
1399
1399
  new RuntimeException(
1400
1400
  "detachRootViewFromInstance called with ReactRootView with invalid id"));
1401
1401
  }
1402
-
1403
- clearReactRoot(reactRoot);
1404
1402
  } else {
1405
1403
  reactContext
1406
1404
  .getCatalystInstance()
1407
1405
  .getJSModule(AppRegistry.class)
1408
1406
  .unmountApplicationComponentAtRootTag(reactRoot.getRootViewTag());
1409
1407
  }
1408
+
1409
+ clearReactRoot(reactRoot);
1410
1410
  }
1411
1411
 
1412
1412
  @ThreadConfined(UI)
@@ -685,7 +685,15 @@ public class SurfaceMountingManager {
685
685
  return;
686
686
  }
687
687
 
688
- ViewState viewState = getViewState(reactTag);
688
+ ViewState viewState = getNullableViewState(reactTag);
689
+
690
+ if (viewState == null) {
691
+ ReactSoftExceptionLogger.logSoftException(
692
+ ReactSoftExceptionLogger.Categories.SURFACE_MOUNTING_MANAGER_MISSING_VIEWSTATE,
693
+ new ReactNoCrashSoftException(
694
+ "Unable to find viewState for tag: " + reactTag + " for updateProps"));
695
+ return;
696
+ }
689
697
  viewState.mCurrentProps = new ReactStylesDiffMap(props);
690
698
  View view = viewState.mView;
691
699
 
@@ -833,9 +841,16 @@ public class SurfaceMountingManager {
833
841
  parent.requestLayout();
834
842
  }
835
843
 
836
- ViewState parentViewState = getViewState(parentTag);
844
+ // TODO T212247085: Make this non-nullable again after rolling out
845
+ // disableMountItemReorderingAndroid
846
+ ViewState parentViewState = getNullableViewState(parentTag);
837
847
  IViewGroupManager<?> parentViewManager = null;
838
- if (parentViewState.mViewManager != null) {
848
+ if (parentViewState == null) {
849
+ ReactSoftExceptionLogger.logSoftException(
850
+ ReactSoftExceptionLogger.Categories.SURFACE_MOUNTING_MANAGER_MISSING_VIEWSTATE,
851
+ new ReactNoCrashSoftException(
852
+ "Unable to find viewState for tag: " + parentTag + " for updateLayout"));
853
+ } else if (parentViewState.mViewManager != null) {
839
854
  parentViewManager = (IViewGroupManager) parentViewState.mViewManager;
840
855
  }
841
856
  if (parentViewManager == null || !parentViewManager.needsCustomLayoutForChildren()) {
@@ -22,6 +22,7 @@ import com.facebook.react.fabric.mounting.SurfaceMountingManager;
22
22
  import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags;
23
23
  import com.facebook.react.uimanager.StateWrapper;
24
24
  import com.facebook.systrace.Systrace;
25
+ import java.util.Locale;
25
26
 
26
27
  /**
27
28
  * This class represents a batch of {@link MountItem}s, represented directly as int buffers to
@@ -199,7 +200,7 @@ final class IntBufferBatchMountItem implements BatchMountItem {
199
200
  public String toString() {
200
201
  try {
201
202
  StringBuilder s = new StringBuilder();
202
- s.append(String.format("IntBufferBatchMountItem [surface:%d]:\n", mSurfaceId));
203
+ s.append(String.format(Locale.ROOT, "IntBufferBatchMountItem [surface:%d]:\n", mSurfaceId));
203
204
  int i = 0, j = 0;
204
205
  while (i < mIntBufferLen) {
205
206
  int rawType = mIntBuffer[i++];
@@ -211,49 +212,65 @@ final class IntBufferBatchMountItem implements BatchMountItem {
211
212
  j += 3;
212
213
  s.append(
213
214
  String.format(
215
+ Locale.ROOT,
214
216
  "CREATE [%d] - layoutable:%d - %s\n",
215
- mIntBuffer[i++], mIntBuffer[i++], componentName));
217
+ mIntBuffer[i++],
218
+ mIntBuffer[i++],
219
+ componentName));
216
220
  } else if (type == INSTRUCTION_DELETE) {
217
- s.append(String.format("DELETE [%d]\n", mIntBuffer[i++]));
221
+ s.append(String.format(Locale.ROOT, "DELETE [%d]\n", mIntBuffer[i++]));
218
222
  } else if (type == INSTRUCTION_INSERT) {
219
223
  s.append(
220
224
  String.format(
221
- "INSERT [%d]->[%d] @%d\n", mIntBuffer[i++], mIntBuffer[i++], mIntBuffer[i++]));
225
+ Locale.ROOT,
226
+ "INSERT [%d]->[%d] @%d\n",
227
+ mIntBuffer[i++],
228
+ mIntBuffer[i++],
229
+ mIntBuffer[i++]));
222
230
  } else if (type == INSTRUCTION_REMOVE) {
223
231
  s.append(
224
232
  String.format(
225
- "REMOVE [%d]->[%d] @%d\n", mIntBuffer[i++], mIntBuffer[i++], mIntBuffer[i++]));
233
+ Locale.ROOT,
234
+ "REMOVE [%d]->[%d] @%d\n",
235
+ mIntBuffer[i++],
236
+ mIntBuffer[i++],
237
+ mIntBuffer[i++]));
226
238
  } else if (type == INSTRUCTION_UPDATE_PROPS) {
227
239
  Object props = mObjBuffer[j++];
228
240
  String propsString =
229
241
  IS_DEVELOPMENT_ENVIRONMENT
230
242
  ? (props != null ? props.toString() : "<null>")
231
243
  : "<hidden>";
232
- s.append(String.format("UPDATE PROPS [%d]: %s\n", mIntBuffer[i++], propsString));
244
+ s.append(
245
+ String.format(
246
+ Locale.ROOT, "UPDATE PROPS [%d]: %s\n", mIntBuffer[i++], propsString));
233
247
  } else if (type == INSTRUCTION_UPDATE_STATE) {
234
248
  StateWrapper state = (StateWrapper) mObjBuffer[j++];
235
249
  String stateString =
236
250
  IS_DEVELOPMENT_ENVIRONMENT
237
251
  ? (state != null ? state.toString() : "<null>")
238
252
  : "<hidden>";
239
- s.append(String.format("UPDATE STATE [%d]: %s\n", mIntBuffer[i++], stateString));
253
+ s.append(
254
+ String.format(
255
+ Locale.ROOT, "UPDATE STATE [%d]: %s\n", mIntBuffer[i++], stateString));
240
256
  } else if (type == INSTRUCTION_UPDATE_LAYOUT) {
241
- int reactTag = mIntBuffer[i++];
242
- int parentTag = mIntBuffer[i++];
243
- int x = mIntBuffer[i++];
244
- int y = mIntBuffer[i++];
245
- int w = mIntBuffer[i++];
246
- int h = mIntBuffer[i++];
247
- int displayType = mIntBuffer[i++];
248
- int layoutDirection = mIntBuffer[i++];
249
257
  s.append(
250
258
  String.format(
251
- "UPDATE LAYOUT [%d]->[%d]: x:%d y:%d w:%d h:%d displayType:%d layoutDirection:"
252
- + " %d\n",
253
- parentTag, reactTag, x, y, w, h, displayType, layoutDirection));
259
+ Locale.ROOT,
260
+ "UPDATE LAYOUT [%d]->[%d]: x:%d y:%d w:%d h:%d displayType:%d"
261
+ + " layoutDirection:%d\n",
262
+ mIntBuffer[i++],
263
+ mIntBuffer[i++],
264
+ mIntBuffer[i++],
265
+ mIntBuffer[i++],
266
+ mIntBuffer[i++],
267
+ mIntBuffer[i++],
268
+ mIntBuffer[i++],
269
+ mIntBuffer[i++]));
254
270
  } else if (type == INSTRUCTION_UPDATE_PADDING) {
255
271
  s.append(
256
272
  String.format(
273
+ Locale.ROOT,
257
274
  "UPDATE PADDING [%d]: top:%d right:%d bottom:%d left:%d\n",
258
275
  mIntBuffer[i++],
259
276
  mIntBuffer[i++],
@@ -263,6 +280,7 @@ final class IntBufferBatchMountItem implements BatchMountItem {
263
280
  } else if (type == INSTRUCTION_UPDATE_OVERFLOW_INSET) {
264
281
  s.append(
265
282
  String.format(
283
+ Locale.ROOT,
266
284
  "UPDATE OVERFLOWINSET [%d]: left:%d top:%d right:%d bottom:%d\n",
267
285
  mIntBuffer[i++],
268
286
  mIntBuffer[i++],
@@ -271,7 +289,7 @@ final class IntBufferBatchMountItem implements BatchMountItem {
271
289
  mIntBuffer[i++]));
272
290
  } else if (type == INSTRUCTION_UPDATE_EVENT_EMITTER) {
273
291
  j += 1;
274
- s.append(String.format("UPDATE EVENTEMITTER [%d]\n", mIntBuffer[i++]));
292
+ s.append(String.format(Locale.ROOT, "UPDATE EVENTEMITTER [%d]\n", mIntBuffer[i++]));
275
293
  } else {
276
294
  FLog.e(TAG, "String so far: " + s.toString());
277
295
  throw new IllegalArgumentException(
@@ -13,8 +13,6 @@ import android.os.Build
13
13
  import android.view.View
14
14
  import android.view.WindowInsetsController
15
15
  import android.view.WindowManager
16
- import androidx.core.view.ViewCompat
17
- import androidx.core.view.WindowInsetsCompat
18
16
  import com.facebook.common.logging.FLog
19
17
  import com.facebook.fbreact.specs.NativeStatusBarManagerAndroidSpec
20
18
  import com.facebook.react.bridge.GuardedRunnable
@@ -23,6 +21,7 @@ import com.facebook.react.bridge.ReactApplicationContext
23
21
  import com.facebook.react.bridge.UiThreadUtil
24
22
  import com.facebook.react.common.ReactConstants
25
23
  import com.facebook.react.module.annotations.ReactModule
24
+ import com.facebook.react.uimanager.DisplayMetricsHolder.getStatusBarHeightPx
26
25
  import com.facebook.react.uimanager.PixelUtil
27
26
  import com.facebook.react.views.view.setStatusBarTranslucency
28
27
  import com.facebook.react.views.view.setStatusBarVisibility
@@ -34,29 +33,17 @@ public class StatusBarModule(reactContext: ReactApplicationContext?) :
34
33
 
35
34
  @Suppress("DEPRECATION")
36
35
  override fun getTypedExportedConstants(): Map<String, Any> {
36
+ val currentActivity = reactApplicationContext.currentActivity
37
37
  val statusBarColor =
38
38
  currentActivity?.window?.statusBarColor?.let { color ->
39
39
  String.format("#%06X", 0xFFFFFF and color)
40
40
  } ?: "black"
41
41
  return mapOf(
42
- HEIGHT_KEY to PixelUtil.toDIPFromPixel(getStatusBarHeightPx()),
42
+ HEIGHT_KEY to PixelUtil.toDIPFromPixel(getStatusBarHeightPx(currentActivity).toFloat()),
43
43
  DEFAULT_BACKGROUND_COLOR_KEY to statusBarColor,
44
44
  )
45
45
  }
46
46
 
47
- @Suppress("DEPRECATION")
48
- private fun getStatusBarHeightPx(): Float {
49
- val windowInsets =
50
- currentActivity?.window?.decorView?.let(ViewCompat::getRootWindowInsets) ?: return 0f
51
- return windowInsets
52
- .getInsets(
53
- WindowInsetsCompat.Type.statusBars() or
54
- WindowInsetsCompat.Type.navigationBars() or
55
- WindowInsetsCompat.Type.displayCutout())
56
- .top
57
- .toFloat()
58
- }
59
-
60
47
  @Suppress("DEPRECATION")
61
48
  override fun setColor(colorDouble: Double, animated: Boolean) {
62
49
  val color = colorDouble.toInt()
@@ -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", 79,
20
- "patch", 5,
20
+ "patch", 7,
21
21
  "prerelease", null);
22
22
  }
@@ -7,9 +7,12 @@
7
7
 
8
8
  package com.facebook.react.uimanager
9
9
 
10
+ import android.app.Activity
10
11
  import android.content.Context
11
12
  import android.util.DisplayMetrics
12
13
  import android.view.WindowManager
14
+ import androidx.core.view.ViewCompat
15
+ import androidx.core.view.WindowInsetsCompat
13
16
  import com.facebook.react.bridge.WritableMap
14
17
  import com.facebook.react.bridge.WritableNativeMap
15
18
 
@@ -99,4 +102,14 @@ public object DisplayMetricsHolder {
99
102
  putDouble("fontScale", fontScale)
100
103
  putDouble("densityDpi", displayMetrics.densityDpi.toDouble())
101
104
  }
105
+
106
+ internal fun getStatusBarHeightPx(activity: Activity?): Int {
107
+ val windowInsets = activity?.window?.decorView?.let(ViewCompat::getRootWindowInsets) ?: return 0
108
+ return windowInsets
109
+ .getInsets(
110
+ WindowInsetsCompat.Type.statusBars() or
111
+ WindowInsetsCompat.Type.navigationBars() or
112
+ WindowInsetsCompat.Type.displayCutout())
113
+ .top
114
+ }
102
115
  }
@@ -671,9 +671,6 @@ public class NativeViewHierarchyManager {
671
671
  View rootView = mTagsToViews.get(rootViewTag);
672
672
  dropView(rootView);
673
673
  mRootTags.delete(rootViewTag);
674
- if (rootView != null) {
675
- rootView.setId(View.NO_ID);
676
- }
677
674
  }
678
675
 
679
676
  /**
@@ -39,6 +39,8 @@ import com.facebook.react.bridge.WritableNativeMap
39
39
  import com.facebook.react.common.ReactConstants
40
40
  import com.facebook.react.common.annotations.VisibleForTesting
41
41
  import com.facebook.react.config.ReactFeatureFlags
42
+ import com.facebook.react.uimanager.DisplayMetricsHolder
43
+ import com.facebook.react.uimanager.DisplayMetricsHolder.getStatusBarHeightPx
42
44
  import com.facebook.react.uimanager.JSPointerDispatcher
43
45
  import com.facebook.react.uimanager.JSTouchDispatcher
44
46
  import com.facebook.react.uimanager.PixelUtil.pxToDp
@@ -52,6 +54,7 @@ import com.facebook.react.views.view.ReactViewGroup
52
54
  import com.facebook.react.views.view.setStatusBarTranslucency
53
55
  import com.facebook.react.views.view.setSystemBarsTranslucency
54
56
  import java.util.Objects
57
+ import com.facebook.yoga.annotations.DoNotStrip
55
58
 
56
59
  /**
57
60
  * ReactModalHostView is a view that sits in the view hierarchy representing a Modal view.
@@ -66,6 +69,7 @@ import java.util.Objects
66
69
  * addition and removal of views to the DialogRootViewGroup.
67
70
  */
68
71
  @SuppressLint("ViewConstructor")
72
+ @DoNotStrip
69
73
  public class ReactModalHostView(context: ThemedReactContext) :
70
74
  ViewGroup(context), LifecycleEventListener {
71
75
 
@@ -121,6 +125,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
121
125
  private var createNewDialog = false
122
126
 
123
127
  init {
128
+ initStatusBarHeight(context)
124
129
  dialogRootViewGroup = DialogRootViewGroup(context)
125
130
  }
126
131
 
@@ -448,6 +453,26 @@ public class ReactModalHostView(context: ThemedReactContext) :
448
453
 
449
454
  private companion object {
450
455
  private const val TAG = "ReactModalHost"
456
+
457
+ // We store the status bar height to be able to properly position
458
+ // the modal on the first render.
459
+ private var statusBarHeight = 0
460
+
461
+ private fun initStatusBarHeight(reactContext: ReactContext) {
462
+ statusBarHeight = getStatusBarHeightPx(reactContext.currentActivity)
463
+ }
464
+
465
+ @JvmStatic
466
+ @DoNotStrip
467
+ private fun getScreenDisplayMetricsWithoutInsets(): Long {
468
+ val displayMetrics = DisplayMetricsHolder.getScreenDisplayMetrics()
469
+ return encodeFloatsToLong(
470
+ displayMetrics.widthPixels.toFloat().pxToDp(),
471
+ (displayMetrics.heightPixels - statusBarHeight).toFloat().pxToDp())
472
+ }
473
+
474
+ private fun encodeFloatsToLong(width: Float, height: Float): Long =
475
+ (width.toRawBits().toLong()) shl 32 or (height.toRawBits().toLong())
451
476
  }
452
477
 
453
478
  /**
@@ -463,6 +488,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
463
488
  */
464
489
  public class DialogRootViewGroup internal constructor(context: Context) :
465
490
  ReactViewGroup(context), RootView {
491
+
466
492
  internal var stateWrapper: StateWrapper? = null
467
493
  internal var eventDispatcher: EventDispatcher? = null
468
494
 
@@ -109,7 +109,11 @@ Pod::Spec.new do |s|
109
109
  sss.dependency folly_dep_name, folly_version
110
110
  sss.compiler_flags = folly_compiler_flags
111
111
  sss.source_files = "react/renderer/components/modal/**/*.{m,mm,cpp,h}"
112
- sss.exclude_files = "react/renderer/components/modal/tests"
112
+ sss.exclude_files = [
113
+ "react/renderer/components/modal/tests",
114
+ "react/renderer/components/modal/platform/android/**/*.{cpp,h}",
115
+ "react/renderer/components/modal/platform/cxx/**/*.{cpp,h}"
116
+ ]
113
117
  sss.header_dir = "react/renderer/components/modal"
114
118
  end
115
119
 
@@ -14,14 +14,14 @@
14
14
 
15
15
  #define REACT_NATIVE_VERSION_MAJOR 0
16
16
  #define REACT_NATIVE_VERSION_MINOR 79
17
- #define REACT_NATIVE_VERSION_PATCH 5
17
+ #define REACT_NATIVE_VERSION_PATCH 7
18
18
 
19
19
  namespace facebook::react {
20
20
 
21
21
  constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 79;
24
- int32_t Patch = 5;
24
+ int32_t Patch = 7;
25
25
  std::string_view Prerelease = "";
26
26
  } ReactNativeVersion;
27
27
 
@@ -989,15 +989,19 @@ void JavaTurboModule::setEventEmitterCallback(
989
989
  *eventEmitterMap_[eventName].get());
990
990
  };
991
991
 
992
- jvalue arg;
993
- arg.l = JCxxCallbackImpl::newObjectCxxArgs([eventEmitterLookup = std::move(
994
- eventEmitterLookup)](
992
+ auto callback = JCxxCallbackImpl::newObjectCxxArgs([eventEmitterLookup = std::move(eventEmitterLookup)](
995
993
  folly::dynamic args) {
996
- auto eventName = args.at(0).asString();
997
- auto eventArgs = args.size() > 1 ? args.at(1) : nullptr;
998
- eventEmitterLookup(eventName).emit(std::move(eventArgs));
999
- }).release();
1000
- env->CallVoidMethod(instance, cachedMethodId, arg);
994
+ auto eventName = args.at(0).asString();
995
+ auto eventArgs = args.size() > 1 ? args.at(1) : nullptr;
996
+ eventEmitterLookup(eventName).emit(std::move(eventArgs));
997
+ });
998
+
999
+ jvalue args[1];
1000
+ args[0].l = callback.release();
1001
+ // CallVoidMethod is replaced with CallVoidMethodA as it's unsafe on 32bit and
1002
+ // causes crashes https://github.com/facebook/react-native/issues/51628
1003
+ env->CallVoidMethodA(instance_.get(), cachedMethodId, args);
1004
+ FACEBOOK_JNI_THROW_PENDING_EXCEPTION();
1001
1005
  }
1002
1006
 
1003
1007
  } // namespace facebook::react
@@ -14,7 +14,10 @@ add_compile_options(
14
14
  -Wpedantic
15
15
  -DLOG_TAG=\"Fabric\")
16
16
 
17
- file(GLOB rrc_modal_SRC CONFIGURE_DEPENDS *.cpp)
17
+ file(GLOB rrc_modal_SRC CONFIGURE_DEPENDS
18
+ *.cpp
19
+ platform/android/*.cpp)
20
+
18
21
  add_library(rrc_modal STATIC ${rrc_modal_SRC})
19
22
 
20
23
  target_include_directories(rrc_modal PUBLIC ${REACT_COMMON_DIR})
@@ -30,8 +30,9 @@ class ModalHostViewComponentDescriptor final
30
30
  *shadowNode.getState())
31
31
  .getData();
32
32
 
33
- layoutableShadowNode.setSize(
34
- Size{stateData.screenSize.width, stateData.screenSize.height});
33
+ layoutableShadowNode.setSize(Size{
34
+ .width = stateData.screenSize.width,
35
+ .height = stateData.screenSize.height});
35
36
  layoutableShadowNode.setPositionType(YGPositionTypeAbsolute);
36
37
 
37
38
  ConcreteComponentDescriptor::adopt(shadowNode);
@@ -9,15 +9,12 @@
9
9
 
10
10
  #include <react/renderer/core/graphicsConversions.h>
11
11
  #include <react/renderer/graphics/Float.h>
12
+ #include "ModalHostViewUtils.h"
12
13
 
13
14
  #ifdef ANDROID
14
15
  #include <folly/dynamic.h>
15
16
  #endif
16
17
 
17
- #if defined(__APPLE__) && TARGET_OS_IOS
18
- #include "ModalHostViewUtils.h"
19
- #endif
20
-
21
18
  namespace facebook::react {
22
19
 
23
20
  /*
@@ -27,12 +24,7 @@ class ModalHostViewState final {
27
24
  public:
28
25
  using Shared = std::shared_ptr<const ModalHostViewState>;
29
26
 
30
- #if defined(__APPLE__) && TARGET_OS_IOS
31
- ModalHostViewState() : screenSize(RCTModalHostViewScreenSize()) {
32
- #else
33
- ModalHostViewState(){
34
- #endif
35
- };
27
+ ModalHostViewState() : screenSize(ModalHostViewScreenSize()) {}
36
28
  ModalHostViewState(Size screenSize_) : screenSize(screenSize_){};
37
29
 
38
30
  #ifdef ANDROID
@@ -40,8 +32,8 @@ class ModalHostViewState final {
40
32
  const ModalHostViewState& previousState,
41
33
  folly::dynamic data)
42
34
  : screenSize(Size{
43
- (Float)data["screenWidth"].getDouble(),
44
- (Float)data["screenHeight"].getDouble()}){};
35
+ .width = (Float)data["screenWidth"].getDouble(),
36
+ .height = (Float)data["screenHeight"].getDouble()}){};
45
37
  #endif
46
38
 
47
39
  const Size screenSize{};
@@ -7,10 +7,10 @@
7
7
 
8
8
  #pragma once
9
9
 
10
- #include <react/renderer/core/graphicsConversions.h>
10
+ #include <react/renderer/graphics/Size.h>
11
11
 
12
12
  namespace facebook::react {
13
13
 
14
- Size RCTModalHostViewScreenSize(void);
14
+ Size ModalHostViewScreenSize(void);
15
15
 
16
16
  } // namespace facebook::react
@@ -11,7 +11,7 @@
11
11
 
12
12
  namespace facebook::react {
13
13
 
14
- Size RCTModalHostViewScreenSize(void)
14
+ Size ModalHostViewScreenSize(void)
15
15
  {
16
16
  CGSize screenSize = RCTScreenSize();
17
17
  return {screenSize.width, screenSize.height};
@@ -0,0 +1,38 @@
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
+ #include <react/renderer/graphics/Size.h>
12
+
13
+ namespace facebook::react {
14
+
15
+ class JReactModalHostView
16
+ : public facebook::jni::JavaClass<JReactModalHostView> {
17
+ public:
18
+ static auto constexpr kJavaDescriptor =
19
+ "Lcom/facebook/react/views/modal/ReactModalHostView;";
20
+
21
+ static Size getDisplayMetrics() {
22
+ static auto method =
23
+ JReactModalHostView::javaClassStatic()->getStaticMethod<jlong()>(
24
+ "getScreenDisplayMetricsWithoutInsets");
25
+ auto result = method(javaClassStatic());
26
+
27
+ // Inspired from yogaMeassureToSize from conversions.h
28
+ int32_t wBits = 0xFFFFFFFF & (result >> 32);
29
+ int32_t hBits = 0xFFFFFFFF & result;
30
+
31
+ auto* measuredWidth = reinterpret_cast<float*>(&wBits);
32
+ auto* measuredHeight = reinterpret_cast<float*>(&hBits);
33
+
34
+ return Size{.width = *measuredWidth, .height = *measuredHeight};
35
+ }
36
+ };
37
+
38
+ } // namespace facebook::react
@@ -0,0 +1,18 @@
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 <react/renderer/components/modal/ModalHostViewUtils.h>
9
+ #include <react/renderer/graphics/Size.h>
10
+ #include "JReactModalHostView.h"
11
+
12
+ namespace facebook::react {
13
+
14
+ Size ModalHostViewScreenSize() {
15
+ return JReactModalHostView::getDisplayMetrics();
16
+ }
17
+
18
+ } // namespace facebook::react
@@ -0,0 +1,17 @@
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 <react/renderer/components/modal/ModalHostViewUtils.h>
9
+ #include <react/renderer/graphics/Size.h>
10
+
11
+ namespace facebook::react {
12
+
13
+ Size ModalHostViewScreenSize() {
14
+ return Size{0, 0};
15
+ }
16
+
17
+ } // namespace facebook::react
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.79.5",
3
+ "version": "0.79.7",
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.7.0",
112
- "@react-native/assets-registry": "0.79.5",
113
- "@react-native/codegen": "0.79.5",
114
- "@react-native/community-cli-plugin": "0.79.5",
115
- "@react-native/gradle-plugin": "0.79.5",
116
- "@react-native/js-polyfills": "0.79.5",
117
- "@react-native/normalize-colors": "0.79.5",
118
- "@react-native/virtualized-lists": "0.79.5",
112
+ "@react-native/assets-registry": "0.79.7",
113
+ "@react-native/codegen": "0.79.7",
114
+ "@react-native/community-cli-plugin": "0.79.7",
115
+ "@react-native/gradle-plugin": "0.79.7",
116
+ "@react-native/js-polyfills": "0.79.7",
117
+ "@react-native/normalize-colors": "0.79.7",
118
+ "@react-native/virtualized-lists": "0.79.7",
119
119
  "abort-controller": "^3.0.0",
120
120
  "anser": "^1.4.9",
121
121
  "ansi-regex": "^5.0.0",
@@ -204,7 +204,10 @@ def hermestag_file(react_native_path)
204
204
  end
205
205
 
206
206
  def release_tarball_url(version, build_type)
207
- maven_repo_url = "https://repo1.maven.org/maven2"
207
+ maven_repo_url =
208
+ ENV['ENTERPRISE_REPOSITORY'] != nil && ENV['ENTERPRISE_REPOSITORY'] != "" ?
209
+ ENV['ENTERPRISE_REPOSITORY'] :
210
+ "https://repo1.maven.org/maven2"
208
211
  namespace = "com/facebook/react"
209
212
  # Sample url from Maven:
210
213
  # https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.71.0/react-native-artifacts-0.71.0-hermes-ios-debug.tar.gz
Binary file
Binary file
Binary file
Binary file