react-native 0.72.10 → 0.72.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.java +13 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +53 -20
- package/ReactCommon/React-Fabric.podspec +2 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/debug/React-debug.podspec +4 -1
- package/ReactCommon/react/renderer/graphics/React-graphics.podspec +5 -1
- package/ReactCommon/react/utils/React-utils.podspec +3 -1
- package/package.json +6 -6
- package/scripts/cocoapods/__tests__/new_architecture-test.rb +2 -2
- package/scripts/cocoapods/__tests__/utils-test.rb +51 -5
- package/scripts/cocoapods/new_architecture.rb +5 -1
- package/scripts/cocoapods/utils.rb +40 -8
- package/scripts/react_native_pods.rb +1 -0
- package/sdks/hermes-engine/hermes-engine.podspec +1 -1
- package/sdks/hermes-engine/hermes-utils.rb +1 -1
- package/sdks/hermesc/linux64-bin/hermesc +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/sdks/hermesc/win64-bin/msvcp140.dll +0 -0
- package/sdks/hermesc/win64-bin/vcruntime140.dll +0 -0
- package/sdks/hermesc/win64-bin/vcruntime140_1.dll +0 -0
- package/template/Gemfile +3 -1
- package/template/package.json +3 -3
|
@@ -192,7 +192,7 @@ export function parseComponentStack(message: string): ComponentStack {
|
|
|
192
192
|
if (!s) {
|
|
193
193
|
return null;
|
|
194
194
|
}
|
|
195
|
-
const match = s.match(/(.*) \(at (.*\.js):([\d]+)\)/);
|
|
195
|
+
const match = s.match(/(.*) \(at (.*\.(?:js|jsx|ts|tsx)):([\d]+)\)/);
|
|
196
196
|
if (!match) {
|
|
197
197
|
return null;
|
|
198
198
|
}
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -113,6 +113,7 @@ public abstract class ReactActivity extends AppCompatActivity
|
|
|
113
113
|
@Override
|
|
114
114
|
public void onRequestPermissionsResult(
|
|
115
115
|
int requestCode, String[] permissions, int[] grantResults) {
|
|
116
|
+
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
116
117
|
mDelegate.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
117
118
|
}
|
|
118
119
|
|
package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewGroupDrawingOrderHelper.java
CHANGED
|
@@ -10,6 +10,8 @@ package com.facebook.react.uimanager;
|
|
|
10
10
|
import android.view.View;
|
|
11
11
|
import android.view.ViewGroup;
|
|
12
12
|
import androidx.annotation.Nullable;
|
|
13
|
+
import com.facebook.common.logging.FLog;
|
|
14
|
+
import com.facebook.react.common.ReactConstants;
|
|
13
15
|
import java.util.ArrayList;
|
|
14
16
|
import java.util.Collections;
|
|
15
17
|
import java.util.Comparator;
|
|
@@ -65,6 +67,17 @@ public class ViewGroupDrawingOrderHelper {
|
|
|
65
67
|
* ViewGroup#getChildDrawingOrder}.
|
|
66
68
|
*/
|
|
67
69
|
public int getChildDrawingOrder(int childCount, int index) {
|
|
70
|
+
if (mDrawingOrderIndices != null
|
|
71
|
+
&& (index >= mDrawingOrderIndices.length || mDrawingOrderIndices[index] >= childCount)) {
|
|
72
|
+
FLog.w(
|
|
73
|
+
ReactConstants.TAG,
|
|
74
|
+
"getChildDrawingOrder index out of bounds! Please check any custom view manipulations you"
|
|
75
|
+
+ " may have done. childCount = %d, index = %d",
|
|
76
|
+
childCount,
|
|
77
|
+
index);
|
|
78
|
+
update();
|
|
79
|
+
}
|
|
80
|
+
|
|
68
81
|
if (mDrawingOrderIndices == null) {
|
|
69
82
|
ArrayList<View> viewsToSort = new ArrayList<>();
|
|
70
83
|
for (int i = 0; i < childCount; i++) {
|
|
@@ -420,10 +420,10 @@ public class ReactViewGroup extends ViewGroup
|
|
|
420
420
|
if (!intersects && child.getParent() != null && !isAnimating) {
|
|
421
421
|
// We can try saving on invalidate call here as the view that we remove is out of visible area
|
|
422
422
|
// therefore invalidation is not necessary.
|
|
423
|
-
|
|
423
|
+
removeViewsInLayout(idx - clippedSoFar, 1);
|
|
424
424
|
needUpdateClippingRecursive = true;
|
|
425
425
|
} else if (intersects && child.getParent() == null) {
|
|
426
|
-
|
|
426
|
+
addViewInLayout(child, idx - clippedSoFar, sDefaultLayoutParam, true);
|
|
427
427
|
invalidate();
|
|
428
428
|
needUpdateClippingRecursive = true;
|
|
429
429
|
} else if (intersects) {
|
|
@@ -501,23 +501,18 @@ public class ReactViewGroup extends ViewGroup
|
|
|
501
501
|
return ViewUtil.getUIManagerType(getId()) == UIManagerType.FABRIC;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
// This will get called for every overload of addView so there is not need to override every
|
|
507
|
-
// method.
|
|
504
|
+
private void handleAddView(View view) {
|
|
505
|
+
UiThreadUtil.assertOnUiThread();
|
|
508
506
|
|
|
509
507
|
if (!customDrawOrderDisabled()) {
|
|
510
|
-
getDrawingOrderHelper().handleAddView(
|
|
508
|
+
getDrawingOrderHelper().handleAddView(view);
|
|
511
509
|
setChildrenDrawingOrderEnabled(getDrawingOrderHelper().shouldEnableCustomDrawingOrder());
|
|
512
510
|
} else {
|
|
513
511
|
setChildrenDrawingOrderEnabled(false);
|
|
514
512
|
}
|
|
515
|
-
|
|
516
|
-
super.addView(child, index, params);
|
|
517
513
|
}
|
|
518
514
|
|
|
519
|
-
|
|
520
|
-
public void removeView(View view) {
|
|
515
|
+
private void handleRemoveView(View view) {
|
|
521
516
|
UiThreadUtil.assertOnUiThread();
|
|
522
517
|
|
|
523
518
|
if (!customDrawOrderDisabled()) {
|
|
@@ -526,22 +521,60 @@ public class ReactViewGroup extends ViewGroup
|
|
|
526
521
|
} else {
|
|
527
522
|
setChildrenDrawingOrderEnabled(false);
|
|
528
523
|
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
private void handleRemoveViews(int start, int count) {
|
|
527
|
+
int endIndex = start + count;
|
|
528
|
+
for (int index = start; index < endIndex; index++) {
|
|
529
|
+
if (index < getChildCount()) {
|
|
530
|
+
handleRemoveView(getChildAt(index));
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
@Override
|
|
536
|
+
public void addView(View child, int index, ViewGroup.LayoutParams params) {
|
|
537
|
+
// This will get called for every overload of addView so there is not need to override every
|
|
538
|
+
// method.
|
|
539
|
+
handleAddView(child);
|
|
540
|
+
super.addView(child, index, params);
|
|
541
|
+
}
|
|
529
542
|
|
|
543
|
+
@Override
|
|
544
|
+
protected boolean addViewInLayout(
|
|
545
|
+
View child, int index, LayoutParams params, boolean preventRequestLayout) {
|
|
546
|
+
handleAddView(child);
|
|
547
|
+
return super.addViewInLayout(child, index, params, preventRequestLayout);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
@Override
|
|
551
|
+
public void removeView(View view) {
|
|
552
|
+
handleRemoveView(view);
|
|
530
553
|
super.removeView(view);
|
|
531
554
|
}
|
|
532
555
|
|
|
533
556
|
@Override
|
|
534
557
|
public void removeViewAt(int index) {
|
|
535
|
-
|
|
558
|
+
handleRemoveView(getChildAt(index));
|
|
559
|
+
super.removeViewAt(index);
|
|
560
|
+
}
|
|
536
561
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
}
|
|
562
|
+
@Override
|
|
563
|
+
public void removeViewInLayout(View view) {
|
|
564
|
+
handleRemoveView(view);
|
|
565
|
+
super.removeViewInLayout(view);
|
|
566
|
+
}
|
|
543
567
|
|
|
544
|
-
|
|
568
|
+
@Override
|
|
569
|
+
public void removeViewsInLayout(int start, int count) {
|
|
570
|
+
handleRemoveViews(start, count);
|
|
571
|
+
super.removeViewsInLayout(start, count);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
@Override
|
|
575
|
+
public void removeViews(int start, int count) {
|
|
576
|
+
handleRemoveViews(start, count);
|
|
577
|
+
super.removeViews(start, count);
|
|
545
578
|
}
|
|
546
579
|
|
|
547
580
|
@Override
|
|
@@ -665,7 +698,7 @@ public class ReactViewGroup extends ViewGroup
|
|
|
665
698
|
clippedSoFar++;
|
|
666
699
|
}
|
|
667
700
|
}
|
|
668
|
-
|
|
701
|
+
removeViewsInLayout(index - clippedSoFar, 1);
|
|
669
702
|
}
|
|
670
703
|
removeFromArray(index);
|
|
671
704
|
}
|
|
@@ -33,7 +33,8 @@ Pod::Spec.new do |s|
|
|
|
33
33
|
s.source = source
|
|
34
34
|
s.source_files = "dummyFile.cpp"
|
|
35
35
|
s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES",
|
|
36
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
36
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
37
|
+
"DEFINES_MODULE" => "YES" }
|
|
37
38
|
|
|
38
39
|
if ENV['USE_FRAMEWORKS']
|
|
39
40
|
s.header_mappings_dir = './'
|
|
@@ -27,7 +27,10 @@ Pod::Spec.new do |s|
|
|
|
27
27
|
s.source = source
|
|
28
28
|
s.source_files = "**/*.{cpp,h}"
|
|
29
29
|
s.header_dir = "react/debug"
|
|
30
|
-
s.pod_target_xcconfig = {
|
|
30
|
+
s.pod_target_xcconfig = {
|
|
31
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
32
|
+
"DEFINES_MODULE" => "YES"
|
|
33
|
+
}
|
|
31
34
|
|
|
32
35
|
if ENV['USE_FRAMEWORKS']
|
|
33
36
|
s.module_name = "React_debug"
|
|
@@ -49,7 +49,11 @@ Pod::Spec.new do |s|
|
|
|
49
49
|
header_search_paths = header_search_paths + ["\"$(PODS_TARGET_SRCROOT)/platform/ios\""]
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
s.pod_target_xcconfig = {
|
|
52
|
+
s.pod_target_xcconfig = {
|
|
53
|
+
"USE_HEADERMAP" => "NO",
|
|
54
|
+
"HEADER_SEARCH_PATHS" => header_search_paths.join(" "),
|
|
55
|
+
"DEFINES_MODULE" => "YES"
|
|
56
|
+
}
|
|
53
57
|
|
|
54
58
|
s.dependency "glog"
|
|
55
59
|
s.dependency "RCT-Folly/Fabric", folly_version
|
|
@@ -44,7 +44,9 @@ Pod::Spec.new do |s|
|
|
|
44
44
|
s.exclude_files = "tests"
|
|
45
45
|
s.pod_target_xcconfig = {
|
|
46
46
|
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
47
|
-
"HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
|
|
47
|
+
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
|
|
48
|
+
"DEFINES_MODULE" => "YES"
|
|
49
|
+
}
|
|
48
50
|
|
|
49
51
|
if ENV['USE_FRAMEWORKS']
|
|
50
52
|
s.module_name = "React_utils"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.72.
|
|
3
|
+
"version": "0.72.12",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
5
|
"description": "A framework for building native apps using React",
|
|
6
6
|
"license": "MIT",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@jest/create-cache-key-function": "^29.2.1",
|
|
82
|
-
"@react-native-community/cli": "11.
|
|
83
|
-
"@react-native-community/cli-platform-android": "11.
|
|
84
|
-
"@react-native-community/cli-platform-ios": "11.
|
|
82
|
+
"@react-native-community/cli": "^11.4.1",
|
|
83
|
+
"@react-native-community/cli-platform-android": "^11.4.1",
|
|
84
|
+
"@react-native-community/cli-platform-ios": "^11.4.1",
|
|
85
85
|
"@react-native/assets-registry": "^0.72.0",
|
|
86
86
|
"@react-native/codegen": "^0.72.8",
|
|
87
87
|
"@react-native/gradle-plugin": "^0.72.11",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"jest-environment-node": "^29.2.1",
|
|
100
100
|
"jsc-android": "^250231.0.0",
|
|
101
101
|
"memoize-one": "^5.0.0",
|
|
102
|
-
"metro-runtime": "0.76.
|
|
103
|
-
"metro-source-map": "0.76.
|
|
102
|
+
"metro-runtime": "^0.76.9",
|
|
103
|
+
"metro-source-map": "^0.76.9",
|
|
104
104
|
"mkdirp": "^0.5.1",
|
|
105
105
|
"nullthrows": "^1.1.1",
|
|
106
106
|
"pretty-format": "^26.5.2",
|
|
@@ -128,7 +128,7 @@ class NewArchitectureTests < Test::Unit::TestCase
|
|
|
128
128
|
NewArchitectureHelper.install_modules_dependencies(spec, true, '2021.07.22.00')
|
|
129
129
|
|
|
130
130
|
# Assert
|
|
131
|
-
assert_equal(spec.compiler_flags, NewArchitectureHelper.folly_compiler_flags)
|
|
131
|
+
assert_equal(spec.compiler_flags, "$(inherited) #{NewArchitectureHelper.folly_compiler_flags} -DRCT_NEW_ARCH_ENABLED=1")
|
|
132
132
|
assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"")
|
|
133
133
|
assert_equal(spec.pod_target_xcconfig["CLANG_CXX_LANGUAGE_STANDARD"], "c++17")
|
|
134
134
|
assert_equal(spec.pod_target_xcconfig["OTHER_CPLUSPLUSFLAGS"], "$(inherited) -DRCT_NEW_ARCH_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1")
|
|
@@ -166,7 +166,7 @@ class NewArchitectureTests < Test::Unit::TestCase
|
|
|
166
166
|
NewArchitectureHelper.install_modules_dependencies(spec, false, '2021.07.22.00')
|
|
167
167
|
|
|
168
168
|
# Assert
|
|
169
|
-
assert_equal(spec.compiler_flags, "-Wno-nullability-completeness #{NewArchitectureHelper.folly_compiler_flags}")
|
|
169
|
+
assert_equal(spec.compiler_flags, "$(inherited) -Wno-nullability-completeness #{NewArchitectureHelper.folly_compiler_flags}")
|
|
170
170
|
assert_equal(spec.pod_target_xcconfig["HEADER_SEARCH_PATHS"], "#{other_flags} \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-RCTFabric/RCTFabric.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-utils/React_utils.framework/Headers\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\"")
|
|
171
171
|
assert_equal(spec.pod_target_xcconfig["CLANG_CXX_LANGUAGE_STANDARD"], "c++17")
|
|
172
172
|
assert_equal(
|
|
@@ -179,11 +179,33 @@ class UtilsTests < Test::Unit::TestCase
|
|
|
179
179
|
# ============================ #
|
|
180
180
|
# Test - Exclude Architectures #
|
|
181
181
|
# ============================ #
|
|
182
|
-
def
|
|
182
|
+
def test_excludeArchitectures_whenHermesEngineIsNotIncluded_withNoValue_leaveUnset
|
|
183
|
+
# Arrange
|
|
184
|
+
user_project_mock = prepare_empty_user_project_mock()
|
|
185
|
+
pods_projects_mock = PodsProjectMock.new()
|
|
186
|
+
installer = InstallerMock.new(PodsProjectMock.new(), [
|
|
187
|
+
AggregatedProjectMock.new(user_project_mock)
|
|
188
|
+
])
|
|
189
|
+
|
|
190
|
+
# Act
|
|
191
|
+
ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
|
|
192
|
+
|
|
193
|
+
# Assert
|
|
194
|
+
user_project_mock.build_configurations.each do |config|
|
|
195
|
+
assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], nil)
|
|
196
|
+
end
|
|
197
|
+
assert_equal(user_project_mock.save_invocation_count, 0)
|
|
198
|
+
assert_equal(pods_projects_mock.save_invocation_count, 0)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def test_excludeArchitectures_whenHermesEngineIsNotIncluded_withExistingValue_preserveExistingValue
|
|
183
202
|
# Arrange
|
|
184
203
|
user_project_mock = prepare_empty_user_project_mock()
|
|
204
|
+
user_project_mock.build_configurations.each do |config|
|
|
205
|
+
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
|
|
206
|
+
end
|
|
185
207
|
pods_projects_mock = PodsProjectMock.new()
|
|
186
|
-
installer = InstallerMock.new(
|
|
208
|
+
installer = InstallerMock.new(pods_projects_mock, [
|
|
187
209
|
AggregatedProjectMock.new(user_project_mock)
|
|
188
210
|
])
|
|
189
211
|
|
|
@@ -192,13 +214,14 @@ class UtilsTests < Test::Unit::TestCase
|
|
|
192
214
|
|
|
193
215
|
# Assert
|
|
194
216
|
user_project_mock.build_configurations.each do |config|
|
|
195
|
-
assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], "")
|
|
217
|
+
assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], "arm64")
|
|
196
218
|
end
|
|
197
|
-
|
|
219
|
+
|
|
220
|
+
assert_equal(user_project_mock.save_invocation_count, 0)
|
|
198
221
|
assert_equal(pods_projects_mock.save_invocation_count, 0)
|
|
199
222
|
end
|
|
200
223
|
|
|
201
|
-
def
|
|
224
|
+
def test_excludeArchitectures_whenHermesEngineIsIncluded_withNoValue_onlyExcludeI386
|
|
202
225
|
# Arrange
|
|
203
226
|
user_project_mock = prepare_empty_user_project_mock()
|
|
204
227
|
pods_projects_mock = PodsProjectMock.new([], {"hermes-engine" => {}})
|
|
@@ -218,6 +241,29 @@ class UtilsTests < Test::Unit::TestCase
|
|
|
218
241
|
assert_equal(pods_projects_mock.save_invocation_count, 1)
|
|
219
242
|
end
|
|
220
243
|
|
|
244
|
+
def test_excludeArchitectures_whenHermesEngineIsIncluded_withExistingValue_appendI386
|
|
245
|
+
# Arrange
|
|
246
|
+
user_project_mock = prepare_empty_user_project_mock()
|
|
247
|
+
user_project_mock.build_configurations.each do |config|
|
|
248
|
+
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
|
|
249
|
+
end
|
|
250
|
+
pods_projects_mock = PodsProjectMock.new([], {"hermes-engine" => {}})
|
|
251
|
+
installer = InstallerMock.new(pods_projects_mock, [
|
|
252
|
+
AggregatedProjectMock.new(user_project_mock)
|
|
253
|
+
])
|
|
254
|
+
|
|
255
|
+
# Act
|
|
256
|
+
ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
|
|
257
|
+
|
|
258
|
+
# Assert
|
|
259
|
+
user_project_mock.build_configurations.each do |config|
|
|
260
|
+
assert_equal(config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"], "arm64 i386")
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
assert_equal(user_project_mock.save_invocation_count, 1)
|
|
264
|
+
assert_equal(pods_projects_mock.save_invocation_count, 1)
|
|
265
|
+
end
|
|
266
|
+
|
|
221
267
|
# ================= #
|
|
222
268
|
# Test - Fix Config #
|
|
223
269
|
# ================= #
|
|
@@ -87,6 +87,10 @@ class NewArchitectureHelper
|
|
|
87
87
|
current_config = hash["pod_target_xcconfig"] != nil ? hash["pod_target_xcconfig"] : {}
|
|
88
88
|
current_headers = current_config["HEADER_SEARCH_PATHS"] != nil ? current_config["HEADER_SEARCH_PATHS"] : ""
|
|
89
89
|
|
|
90
|
+
flags_to_add = new_arch_enabled ?
|
|
91
|
+
"#{@@folly_compiler_flags} -DRCT_NEW_ARCH_ENABLED=1" :
|
|
92
|
+
"#{@@folly_compiler_flags}"
|
|
93
|
+
|
|
90
94
|
header_search_paths = ["\"$(PODS_ROOT)/boost\""]
|
|
91
95
|
if ENV['USE_FRAMEWORKS']
|
|
92
96
|
header_search_paths << "\"$(PODS_ROOT)/DoubleConversion\""
|
|
@@ -100,7 +104,7 @@ class NewArchitectureHelper
|
|
|
100
104
|
header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\""
|
|
101
105
|
end
|
|
102
106
|
header_search_paths_string = header_search_paths.join(" ")
|
|
103
|
-
spec.compiler_flags = compiler_flags.empty? ?
|
|
107
|
+
spec.compiler_flags = compiler_flags.empty? ? "$(inherited) #{flags_to_add}" : "$(inherited) #{compiler_flags} #{flags_to_add}"
|
|
104
108
|
current_config["HEADER_SEARCH_PATHS"] = current_headers.empty? ?
|
|
105
109
|
header_search_paths_string :
|
|
106
110
|
"#{current_headers} #{header_search_paths_string}"
|
|
@@ -54,17 +54,49 @@ class ReactNativePodsUtils
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def self.exclude_i386_architecture_while_using_hermes(installer)
|
|
57
|
-
|
|
57
|
+
is_using_hermes = self.has_pod(installer, 'hermes-engine')
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
if is_using_hermes
|
|
60
|
+
key = "EXCLUDED_ARCHS[sdk=iphonesimulator*]"
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
project.build_configurations.each do |config|
|
|
64
|
-
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = excluded_archs_default
|
|
65
|
-
end
|
|
62
|
+
projects = self.extract_projects(installer)
|
|
66
63
|
|
|
67
|
-
|
|
64
|
+
projects.each do |project|
|
|
65
|
+
project.build_configurations.each do |config|
|
|
66
|
+
current_setting = config.build_settings[key] || ""
|
|
67
|
+
|
|
68
|
+
excluded_archs_includes_I386 = current_setting.include?("i386")
|
|
69
|
+
|
|
70
|
+
if !excluded_archs_includes_I386
|
|
71
|
+
# Hermes does not support `i386` architecture
|
|
72
|
+
config.build_settings[key] = "#{current_setting} i386".strip
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
project.save()
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def self.fix_flipper_for_xcode_15_3(installer)
|
|
82
|
+
|
|
83
|
+
installer.pods_project.targets.each do |target|
|
|
84
|
+
if target.name == 'Flipper'
|
|
85
|
+
file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
|
|
86
|
+
if !File.exist?(file_path)
|
|
87
|
+
return
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
contents = File.read(file_path)
|
|
91
|
+
if contents.include?('#include <functional>')
|
|
92
|
+
return
|
|
93
|
+
end
|
|
94
|
+
mod_content = contents.gsub("#pragma once", "#pragma once\n#include <functional>")
|
|
95
|
+
File.chmod(0755, file_path)
|
|
96
|
+
File.open(file_path, 'w') do |file|
|
|
97
|
+
file.puts(mod_content)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
68
100
|
end
|
|
69
101
|
end
|
|
70
102
|
|
|
@@ -248,6 +248,7 @@ def react_native_post_install(
|
|
|
248
248
|
ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled)
|
|
249
249
|
ReactNativePodsUtils.apply_xcode_15_patch(installer)
|
|
250
250
|
ReactNativePodsUtils.updateIphoneOSDeploymentTarget(installer)
|
|
251
|
+
ReactNativePodsUtils.fix_flipper_for_xcode_15_3(installer)
|
|
251
252
|
|
|
252
253
|
NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer)
|
|
253
254
|
is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == "1"
|
|
@@ -17,7 +17,7 @@ version = package['version']
|
|
|
17
17
|
|
|
18
18
|
# sdks/.hermesversion
|
|
19
19
|
hermestag_file = File.join(react_native_path, "sdks", ".hermesversion")
|
|
20
|
-
build_from_source = ENV['
|
|
20
|
+
build_from_source = ENV['RCT_BUILD_HERMES_FROM_SOURCE'] === 'true'
|
|
21
21
|
|
|
22
22
|
git = "https://github.com/facebook/hermes.git"
|
|
23
23
|
|
|
@@ -17,7 +17,7 @@ end
|
|
|
17
17
|
# - To use a specific tarball, install the dependencies with:
|
|
18
18
|
# `HERMES_ENGINE_TARBALL_PATH=<path_to_tarball> bundle exec pod install`
|
|
19
19
|
# - To force a build from source, install the dependencies with:
|
|
20
|
-
# `
|
|
20
|
+
# `RCT_BUILD_HERMES_FROM_SOURCE=true bundle exec pod install`
|
|
21
21
|
# If none of the two are provided, Cocoapods will check whether there is a tarball for the current version
|
|
22
22
|
# (either release or nightly). If not, it will fall back building from source (the latest commit on main).
|
|
23
23
|
#
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/template/Gemfile
CHANGED
|
@@ -3,5 +3,7 @@ source 'https://rubygems.org'
|
|
|
3
3
|
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
|
4
4
|
ruby ">= 2.6.10"
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
|
|
7
|
+
# bound in the template on Cocoapods with next React Native release.
|
|
8
|
+
gem 'cocoapods', '>= 1.13', '< 1.15'
|
|
7
9
|
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
|
package/template/package.json
CHANGED
|
@@ -11,21 +11,21 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"react": "18.2.0",
|
|
14
|
-
"react-native": "0.72.
|
|
14
|
+
"react-native": "0.72.12"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@babel/core": "^7.20.0",
|
|
18
18
|
"@babel/preset-env": "^7.20.0",
|
|
19
19
|
"@babel/runtime": "^7.20.0",
|
|
20
20
|
"@react-native/eslint-config": "^0.72.2",
|
|
21
|
-
"@react-native/metro-config": "^0.72.
|
|
21
|
+
"@react-native/metro-config": "^0.72.12",
|
|
22
22
|
"@tsconfig/react-native": "^3.0.0",
|
|
23
23
|
"@types/react": "^18.0.24",
|
|
24
24
|
"@types/react-test-renderer": "^18.0.0",
|
|
25
25
|
"babel-jest": "^29.2.1",
|
|
26
26
|
"eslint": "^8.19.0",
|
|
27
27
|
"jest": "^29.2.1",
|
|
28
|
-
"metro-react-native-babel-preset": "0.76.
|
|
28
|
+
"metro-react-native-babel-preset": "^0.76.9",
|
|
29
29
|
"prettier": "^2.4.1",
|
|
30
30
|
"react-test-renderer": "18.2.0",
|
|
31
31
|
"typescript": "4.8.4"
|