react-native 0.66.0 → 0.66.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 (54) hide show
  1. package/Libraries/Components/Keyboard/Keyboard.js +2 -2
  2. package/Libraries/Core/ReactNativeVersion.js +1 -1
  3. package/Libraries/LogBox/Data/LogBoxData.js +18 -18
  4. package/React/Base/RCTVersion.m +1 -1
  5. package/React/CoreModules/RCTAppearance.mm +3 -1
  6. package/React/CoreModules/RCTLogBox.mm +1 -0
  7. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2096 -0
  8. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2554 -0
  9. package/React/Modules/RCTI18nUtil.h +6 -14
  10. package/React/Modules/RCTI18nUtil.m +47 -1
  11. package/ReactAndroid/gradle.properties +1 -1
  12. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +7 -0
  13. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +7 -0
  14. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java +10 -1
  15. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  16. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +8 -8
  17. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  18. package/android/com/facebook/react/react-native/{0.66.0/react-native-0.66.0.aar → 0.66.4/react-native-0.66.4.aar} +0 -0
  19. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.aar.md5 +1 -0
  20. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.aar.sha1 +1 -0
  21. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.aar.sha256 +1 -0
  22. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.aar.sha512 +1 -0
  23. package/android/com/facebook/react/react-native/{0.66.0/react-native-0.66.0.module → 0.66.4/react-native-0.66.4.module} +16 -16
  24. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.module.md5 +1 -0
  25. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.module.sha1 +1 -0
  26. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.module.sha256 +1 -0
  27. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.module.sha512 +1 -0
  28. package/android/com/facebook/react/react-native/{0.66.0/react-native-0.66.0.pom → 0.66.4/react-native-0.66.4.pom} +1 -1
  29. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.pom.md5 +1 -0
  30. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.pom.sha1 +1 -0
  31. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.pom.sha256 +1 -0
  32. package/android/com/facebook/react/react-native/0.66.4/react-native-0.66.4.pom.sha512 +1 -0
  33. package/android/com/facebook/react/react-native/maven-metadata.xml +4 -4
  34. package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
  35. package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
  36. package/android/com/facebook/react/react-native/maven-metadata.xml.sha256 +1 -1
  37. package/android/com/facebook/react/react-native/maven-metadata.xml.sha512 +1 -1
  38. package/jest/preprocessor.js +9 -77
  39. package/package.json +3 -2
  40. package/scripts/react-native-xcode.sh +1 -1
  41. package/scripts/react_native_pods.rb +7 -3
  42. package/template/package.json +1 -1
  43. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.aar.md5 +0 -1
  44. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.aar.sha1 +0 -1
  45. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.aar.sha256 +0 -1
  46. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.aar.sha512 +0 -1
  47. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.module.md5 +0 -1
  48. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.module.sha1 +0 -1
  49. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.module.sha256 +0 -1
  50. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.module.sha512 +0 -1
  51. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.pom.md5 +0 -1
  52. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.pom.sha1 +0 -1
  53. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.pom.sha256 +0 -1
  54. package/android/com/facebook/react/react-native/0.66.0/react-native-0.66.0.pom.sha512 +0 -1
@@ -18,19 +18,11 @@
18
18
  + (instancetype)sharedInstance;
19
19
 
20
20
  - (BOOL)isRTL;
21
-
22
- /**
23
- * Should be used very early during app start up
24
- * Before the bridge is initialized
25
- */
26
- @property (atomic, setter=allowRTL:) BOOL isRTLAllowed;
27
-
28
- /**
29
- * Could be used to test RTL layout with English
30
- * Used for development and testing purpose
31
- */
32
- @property (atomic, setter=forceRTL:) BOOL isRTLForced;
33
-
34
- @property (atomic, setter=swapLeftAndRightInRTL:) BOOL doLeftAndRightSwapInRTL;
21
+ - (BOOL)isRTLAllowed;
22
+ - (void)allowRTL:(BOOL)value;
23
+ - (BOOL)isRTLForced;
24
+ - (void)forceRTL:(BOOL)value;
25
+ - (BOOL)doLeftAndRightSwapInRTL;
26
+ - (void)swapLeftAndRightInRTL:(BOOL)value;
35
27
 
36
28
  @end
@@ -18,7 +18,6 @@
18
18
  dispatch_once(&onceToken, ^{
19
19
  sharedInstance = [self new];
20
20
  [sharedInstance swapLeftAndRightInRTL:true];
21
- [sharedInstance allowRTL:true];
22
21
  });
23
22
 
24
23
  return sharedInstance;
@@ -41,6 +40,53 @@
41
40
  return NO;
42
41
  }
43
42
 
43
+ /**
44
+ * Should be used very early during app start up
45
+ * Before the bridge is initialized
46
+ * @return whether the app allows RTL layout, default is true
47
+ */
48
+ - (BOOL)isRTLAllowed
49
+ {
50
+ NSNumber *value = [[NSUserDefaults standardUserDefaults] objectForKey:@"RCTI18nUtil_allowRTL"];
51
+ if (value == nil) {
52
+ return YES;
53
+ }
54
+ return [value boolValue];
55
+ }
56
+
57
+ - (void)allowRTL:(BOOL)rtlStatus
58
+ {
59
+ [[NSUserDefaults standardUserDefaults] setBool:rtlStatus forKey:@"RCTI18nUtil_allowRTL"];
60
+ [[NSUserDefaults standardUserDefaults] synchronize];
61
+ }
62
+
63
+ /**
64
+ * Could be used to test RTL layout with English
65
+ * Used for development and testing purpose
66
+ */
67
+ - (BOOL)isRTLForced
68
+ {
69
+ BOOL rtlStatus = [[NSUserDefaults standardUserDefaults] boolForKey:@"RCTI18nUtil_forceRTL"];
70
+ return rtlStatus;
71
+ }
72
+
73
+ - (void)forceRTL:(BOOL)rtlStatus
74
+ {
75
+ [[NSUserDefaults standardUserDefaults] setBool:rtlStatus forKey:@"RCTI18nUtil_forceRTL"];
76
+ [[NSUserDefaults standardUserDefaults] synchronize];
77
+ }
78
+
79
+ - (BOOL)doLeftAndRightSwapInRTL
80
+ {
81
+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"RCTI18nUtil_makeRTLFlipLeftAndRightStyles"];
82
+ }
83
+
84
+ - (void)swapLeftAndRightInRTL:(BOOL)value
85
+ {
86
+ [[NSUserDefaults standardUserDefaults] setBool:value forKey:@"RCTI18nUtil_makeRTLFlipLeftAndRightStyles"];
87
+ [[NSUserDefaults standardUserDefaults] synchronize];
88
+ }
89
+
44
90
  // Check if the current device language is RTL
45
91
  - (BOOL)isDevicePreferredLanguageRTL
46
92
  {
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.66.0
1
+ VERSION_NAME=0.66.4
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -8,6 +8,7 @@
8
8
  package com.facebook.react;
9
9
 
10
10
  import android.content.Intent;
11
+ import android.content.res.Configuration;
11
12
  import android.os.Bundle;
12
13
  import android.view.KeyEvent;
13
14
  import androidx.annotation.Nullable;
@@ -121,6 +122,12 @@ public abstract class ReactActivity extends AppCompatActivity
121
122
  mDelegate.onWindowFocusChanged(hasFocus);
122
123
  }
123
124
 
125
+ @Override
126
+ public void onConfigurationChanged(Configuration newConfig) {
127
+ super.onConfigurationChanged(newConfig);
128
+ mDelegate.onConfigurationChanged(newConfig);
129
+ }
130
+
124
131
  protected final ReactNativeHost getReactNativeHost() {
125
132
  return mDelegate.getReactNativeHost();
126
133
  }
@@ -11,6 +11,7 @@ import android.annotation.TargetApi;
11
11
  import android.app.Activity;
12
12
  import android.content.Context;
13
13
  import android.content.Intent;
14
+ import android.content.res.Configuration;
14
15
  import android.os.Build;
15
16
  import android.os.Bundle;
16
17
  import android.view.KeyEvent;
@@ -154,6 +155,12 @@ public class ReactActivityDelegate {
154
155
  }
155
156
  }
156
157
 
158
+ public void onConfigurationChanged(Configuration newConfig) {
159
+ if (getReactNativeHost().hasInstance()) {
160
+ getReactInstanceManager().onConfigurationChanged(getContext(), newConfig);
161
+ }
162
+ }
163
+
157
164
  @TargetApi(Build.VERSION_CODES.M)
158
165
  public void requestPermissions(
159
166
  String[] permissions, int requestCode, PermissionListener listener) {
@@ -7,6 +7,7 @@
7
7
 
8
8
  package com.facebook.react.modules.appearance;
9
9
 
10
+ import android.app.Activity;
10
11
  import android.content.Context;
11
12
  import android.content.res.Configuration;
12
13
  import androidx.annotation.Nullable;
@@ -74,7 +75,15 @@ public class AppearanceModule extends NativeAppearanceSpec {
74
75
 
75
76
  @Override
76
77
  public String getColorScheme() {
77
- mColorScheme = colorSchemeForCurrentConfiguration(getReactApplicationContext());
78
+ // Attempt to use the Activity context first in order to get the most up to date
79
+ // scheme. This covers the scenario when AppCompatDelegate.setDefaultNightMode()
80
+ // is called directly (which can occur in Brownfield apps for example).
81
+ Activity activity = getCurrentActivity();
82
+
83
+ mColorScheme =
84
+ colorSchemeForCurrentConfiguration(
85
+ activity != null ? activity : getReactApplicationContext());
86
+
78
87
  return mColorScheme;
79
88
  }
80
89
 
@@ -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", 66,
20
- "patch", 0,
20
+ "patch", 4,
21
21
  "prerelease", null);
22
22
  }
@@ -1106,8 +1106,8 @@ public class ReactViewBackgroundDrawable extends Drawable {
1106
1106
  int width = Math.round(borderWidth.left);
1107
1107
  updatePathEffect(width);
1108
1108
  mPaint.setStrokeWidth(width);
1109
- mPathForSingleBorder.moveTo(left, top - borderWidth.top / 2);
1110
- mPathForSingleBorder.lineTo(left, bottom + borderWidth.bottom / 2);
1109
+ mPathForSingleBorder.moveTo(left + width / 2, top);
1110
+ mPathForSingleBorder.lineTo(left + width / 2, bottom);
1111
1111
  canvas.drawPath(mPathForSingleBorder, mPaint);
1112
1112
  }
1113
1113
  if (borderTop > 0) {
@@ -1115,8 +1115,8 @@ public class ReactViewBackgroundDrawable extends Drawable {
1115
1115
  int width = Math.round(borderWidth.top);
1116
1116
  updatePathEffect(width);
1117
1117
  mPaint.setStrokeWidth(width);
1118
- mPathForSingleBorder.moveTo(left, top);
1119
- mPathForSingleBorder.lineTo(right, top);
1118
+ mPathForSingleBorder.moveTo(left, top + width / 2);
1119
+ mPathForSingleBorder.lineTo(right, top + width / 2);
1120
1120
  canvas.drawPath(mPathForSingleBorder, mPaint);
1121
1121
  }
1122
1122
  if (borderRight > 0) {
@@ -1124,8 +1124,8 @@ public class ReactViewBackgroundDrawable extends Drawable {
1124
1124
  int width = Math.round(borderWidth.right);
1125
1125
  updatePathEffect(width);
1126
1126
  mPaint.setStrokeWidth(width);
1127
- mPathForSingleBorder.moveTo(right, top - borderWidth.top / 2);
1128
- mPathForSingleBorder.lineTo(right, bottom + borderWidth.bottom / 2);
1127
+ mPathForSingleBorder.moveTo(right - width / 2, top);
1128
+ mPathForSingleBorder.lineTo(right - width / 2, bottom);
1129
1129
  canvas.drawPath(mPathForSingleBorder, mPaint);
1130
1130
  }
1131
1131
  if (borderBottom > 0) {
@@ -1133,8 +1133,8 @@ public class ReactViewBackgroundDrawable extends Drawable {
1133
1133
  int width = Math.round(borderWidth.bottom);
1134
1134
  updatePathEffect(width);
1135
1135
  mPaint.setStrokeWidth(width);
1136
- mPathForSingleBorder.moveTo(left, bottom);
1137
- mPathForSingleBorder.lineTo(right, bottom);
1136
+ mPathForSingleBorder.moveTo(left, bottom - width / 2);
1137
+ mPathForSingleBorder.lineTo(right, bottom - width / 2);
1138
1138
  canvas.drawPath(mPathForSingleBorder, mPaint);
1139
1139
  }
1140
1140
  }
@@ -17,7 +17,7 @@ namespace facebook::react {
17
17
  constexpr struct {
18
18
  int32_t Major = 0;
19
19
  int32_t Minor = 66;
20
- int32_t Patch = 0;
20
+ int32_t Patch = 4;
21
21
  std::string_view Prerelease = "";
22
22
  } ReactNativeVersion;
23
23
 
@@ -0,0 +1 @@
1
+ e812e6358cbea21b00660c0c2cba01f9
@@ -0,0 +1 @@
1
+ 673d65136b846a67305ea56685691a38b4890442
@@ -0,0 +1 @@
1
+ 24bd7f5067d8254630b21465c4971c53ac959fcae6296555a7d03dcf503b38c1
@@ -0,0 +1 @@
1
+ 8c82dddf79e73fb7df35e62b22b4c439651f1fc1501f968f9e34ead98a0fa7fbdbdc2588430a96d8f701d549ee0b92d467c2bdef8cd0f8e28558bba00f408ba5
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "com.facebook.react",
5
5
  "module": "react-native",
6
- "version": "0.66.0",
6
+ "version": "0.66.4",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -11,7 +11,7 @@
11
11
  "createdBy": {
12
12
  "gradle": {
13
13
  "version": "6.9",
14
- "buildId": "57hpspsdpbcmrg6vrfykm4i6ca"
14
+ "buildId": "rhkmqqvtxncldme6kwnaoxk3y4"
15
15
  }
16
16
  },
17
17
  "variants": [
@@ -132,13 +132,13 @@
132
132
  ],
133
133
  "files": [
134
134
  {
135
- "name": "react-native-0.66.0.aar",
136
- "url": "react-native-0.66.0.aar",
137
- "size": 17709971,
138
- "sha512": "9307f5f9fbaf46f225724c772cb6453aa783d327600624f32cbb57b0998cd10f0c0c8719b113c85f853eece8ce3ebdc8ebd4c8b405b6966a16ba1683760d3c98",
139
- "sha256": "e5b1160770d8ad76c12293f71af81177365d39dfe5023d2ba945cd5ba9075eba",
140
- "sha1": "fce4971f4b9d2e14a7c9b9c937de50c2f540aeed",
141
- "md5": "97aa9ee16c73b2719e734dfca7955cc7"
135
+ "name": "react-native-0.66.4.aar",
136
+ "url": "react-native-0.66.4.aar",
137
+ "size": 17710262,
138
+ "sha512": "8c82dddf79e73fb7df35e62b22b4c439651f1fc1501f968f9e34ead98a0fa7fbdbdc2588430a96d8f701d549ee0b92d467c2bdef8cd0f8e28558bba00f408ba5",
139
+ "sha256": "24bd7f5067d8254630b21465c4971c53ac959fcae6296555a7d03dcf503b38c1",
140
+ "sha1": "673d65136b846a67305ea56685691a38b4890442",
141
+ "md5": "e812e6358cbea21b00660c0c2cba01f9"
142
142
  }
143
143
  ]
144
144
  },
@@ -259,13 +259,13 @@
259
259
  ],
260
260
  "files": [
261
261
  {
262
- "name": "react-native-0.66.0.aar",
263
- "url": "react-native-0.66.0.aar",
264
- "size": 17709971,
265
- "sha512": "9307f5f9fbaf46f225724c772cb6453aa783d327600624f32cbb57b0998cd10f0c0c8719b113c85f853eece8ce3ebdc8ebd4c8b405b6966a16ba1683760d3c98",
266
- "sha256": "e5b1160770d8ad76c12293f71af81177365d39dfe5023d2ba945cd5ba9075eba",
267
- "sha1": "fce4971f4b9d2e14a7c9b9c937de50c2f540aeed",
268
- "md5": "97aa9ee16c73b2719e734dfca7955cc7"
262
+ "name": "react-native-0.66.4.aar",
263
+ "url": "react-native-0.66.4.aar",
264
+ "size": 17710262,
265
+ "sha512": "8c82dddf79e73fb7df35e62b22b4c439651f1fc1501f968f9e34ead98a0fa7fbdbdc2588430a96d8f701d549ee0b92d467c2bdef8cd0f8e28558bba00f408ba5",
266
+ "sha256": "24bd7f5067d8254630b21465c4971c53ac959fcae6296555a7d03dcf503b38c1",
267
+ "sha1": "673d65136b846a67305ea56685691a38b4890442",
268
+ "md5": "e812e6358cbea21b00660c0c2cba01f9"
269
269
  }
270
270
  ]
271
271
  }
@@ -0,0 +1 @@
1
+ 80815ffae5babcc30adf9706710f7b34
@@ -0,0 +1 @@
1
+ 3f0b7629422a5d11ab4e442521be0bcc0cfbba88
@@ -0,0 +1 @@
1
+ 9393670d6e468fa64921b93be7f9c5efbe5a456e624da5e99062163e49395b2b
@@ -0,0 +1 @@
1
+ d510c4e25f8686113d7840f5033a07a65db5a45630c8985686e732f7b80a40a0bf3bced58e3443a2050c7503deed29b006f6733bef372acdcb5929c53192d30e
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>com.facebook.react</groupId>
11
11
  <artifactId>react-native</artifactId>
12
- <version>0.66.0</version>
12
+ <version>0.66.4</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>ReactNative</name>
15
15
  <description>A framework for building native apps with React</description>
@@ -0,0 +1 @@
1
+ 455a2bbc362c87dd3aef2062e2fa6d27
@@ -0,0 +1 @@
1
+ 24f2ae6ad77948508bc7252ca54e91a839852015
@@ -0,0 +1 @@
1
+ 1dd34b30662c29b762b0a04670c8a837e9ec66de871c7e2a24d417e9fc33360a
@@ -0,0 +1 @@
1
+ f9aa8c4f8e95b2b50293b59e2c5e50091cca203bb8760b402c3a1f11b47e0efb7de9a7ea090fc8d55e44223c240e2a370f7460adc64b153191e4492fa00ddda7
@@ -3,11 +3,11 @@
3
3
  <groupId>com.facebook.react</groupId>
4
4
  <artifactId>react-native</artifactId>
5
5
  <versioning>
6
- <latest>0.66.0</latest>
7
- <release>0.66.0</release>
6
+ <latest>0.66.4</latest>
7
+ <release>0.66.4</release>
8
8
  <versions>
9
- <version>0.66.0</version>
9
+ <version>0.66.4</version>
10
10
  </versions>
11
- <lastUpdated>20211001223545</lastUpdated>
11
+ <lastUpdated>20211209204740</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 3578b20b35f340227083483d8d5401d3
1
+ 52e431bb760a6821458836fe1b22e0d5
@@ -1 +1 @@
1
- c612415fcb86b829334b27163c4e423dbc870c70
1
+ 7165103039cf2360070f2c23ef76db7b827d338d
@@ -1 +1 @@
1
- 6538e853192ba67d6fdb5b5914312e5e0de465355fd257137fce47bd53b66710
1
+ e0e4c615f915c421fa3f1ac4197a384a7ec2cb52c0b40283123e422dec88548d
@@ -1 +1 @@
1
- c335bffc0464fbe8cb7bde0daf7c408f301f57f0207ec404cd385078788f1aec52628d00af7b73f01b543fc59a1c7b8426bc2af84087b8036f3ba84f101804ae
1
+ a6d3e57b55e84d72ac59e8a6489c7a6d8cb0bd4c48ff54d5364c8330a0294290d4252b000d0c6297535717958a710a3cd4b0bf27f9d4ced4bbea5a2f71d444d1
@@ -13,42 +13,10 @@
13
13
  'use strict';
14
14
 
15
15
  const babelRegisterOnly = require('metro-babel-register');
16
- const nullthrows = require('nullthrows');
17
- const createCacheKeyFunction = require('@jest/create-cache-key-function')
18
- .default;
19
- const t = require('@babel/types');
20
- const {statements} = require('@babel/template').default;
16
+ const createCacheKeyFunction =
17
+ require('@jest/create-cache-key-function').default;
21
18
 
22
- const importDefault = '__importDefault__';
23
- const importAll = '__importAll__';
24
-
25
- // prelude
26
- const importPrelude = statements(`
27
- function ${importDefault}(moduleId) {
28
- const exports = require(moduleId);
29
-
30
- if (exports && exports.__esModule) {
31
- return exports.default;
32
- }
33
-
34
- return exports;
35
- };
36
-
37
- function ${importAll}(moduleId) {
38
- const exports = require(moduleId);
39
-
40
- if (exports && exports.__esModule) {
41
- return exports;
42
- }
43
-
44
- return Object.assign({}, exports, {default: exports});
45
- };
46
- `);
47
-
48
- const {
49
- transformSync: babelTransformSync,
50
- transformFromAstSync: babelTransformFromAstSync,
51
- } = require('@babel/core');
19
+ const {transformSync: babelTransformSync} = require('@babel/core');
52
20
  const generate = require('@babel/generator').default;
53
21
 
54
22
  const nodeFiles = new RegExp(
@@ -73,13 +41,13 @@ module.exports = {
73
41
  }).code;
74
42
  }
75
43
 
76
- let {ast} = transformer.transform({
44
+ const {ast} = transformer.transform({
77
45
  filename: file,
78
46
  options: {
79
47
  ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044
80
48
  dev: true,
81
49
  enableBabelRuntime: false,
82
- experimentalImportSupport: true,
50
+ experimentalImportSupport: false,
83
51
  globalPrefix: '',
84
52
  hot: false,
85
53
  inlineRequires: true,
@@ -111,6 +79,10 @@ module.exports = {
111
79
  [require('@babel/plugin-transform-regenerator')],
112
80
  [require('@babel/plugin-transform-sticky-regex')],
113
81
  [require('@babel/plugin-transform-unicode-regex')],
82
+ [
83
+ require('@babel/plugin-transform-modules-commonjs'),
84
+ {strict: false, allowTopLevelThis: true},
85
+ ],
114
86
  [require('@babel/plugin-transform-classes')],
115
87
  [require('@babel/plugin-transform-arrow-functions')],
116
88
  [require('@babel/plugin-transform-spread')],
@@ -127,46 +99,6 @@ module.exports = {
127
99
  ],
128
100
  });
129
101
 
130
- // We're not using @babel/plugin-transform-modules-commonjs so
131
- // we need to add 'use strict' manually
132
- const directives = ast.program.directives;
133
-
134
- if (
135
- ast.program.sourceType === 'module' &&
136
- (directives == null ||
137
- directives.findIndex(d => d.value.value === 'use strict') === -1)
138
- ) {
139
- ast.program.directives = [
140
- ...(directives || []),
141
- t.directive(t.directiveLiteral('use strict')),
142
- ];
143
- }
144
-
145
- // Postprocess the transformed module to handle ESM and inline requires.
146
- // We need to do this in a separate pass to avoid issues tracking references.
147
- const babelTransformResult = babelTransformFromAstSync(ast, src, {
148
- ast: true,
149
- retainLines: true,
150
- plugins: [
151
- [
152
- require('metro-transform-plugins').importExportPlugin,
153
- {importDefault, importAll},
154
- ],
155
- [
156
- require('babel-preset-fbjs/plugins/inline-requires.js'),
157
- {inlineableCalls: [importDefault, importAll]},
158
- ],
159
- ],
160
- sourceType: 'module',
161
- });
162
-
163
- ast = nullthrows(babelTransformResult.ast);
164
-
165
- // Inject import helpers *after* running the inline-requires transform,
166
- // because otherwise it will assume they are user code and bail out of
167
- // inlining calls to them.
168
- ast.program.body.unshift(...importPrelude());
169
-
170
102
  return generate(
171
103
  ast,
172
104
  // $FlowFixMe[prop-missing] Error found when improving flow typing for libs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.66.0",
3
+ "version": "0.66.4",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -157,7 +157,8 @@
157
157
  "shelljs": "^0.7.8",
158
158
  "signedsource": "^1.0.0",
159
159
  "ws": "^6.1.4",
160
- "yargs": "^15.3.1"
160
+ "yargs": "^15.3.1",
161
+ "metro-babel-register": "0.66.2"
161
162
  },
162
163
  "detox": {
163
164
  "test-runner": "jest",
@@ -81,7 +81,7 @@ fi
81
81
 
82
82
  # Find path to Node
83
83
  # shellcheck source=/dev/null
84
- source "$RN_DIR/scripts/find-node.sh"
84
+ source "$REACT_NATIVE_DIR/scripts/find-node.sh"
85
85
 
86
86
  # check and assign NODE_BINARY env
87
87
  # shellcheck source=/dev/null
@@ -237,13 +237,17 @@ def __apply_Xcode_12_5_M1_post_install_workaround(installer)
237
237
  # The most reliable known workaround is to bump iOS deployment target to match react-native (iOS 11 now).
238
238
  installer.pods_project.targets.each do |target|
239
239
  target.build_configurations.each do |config|
240
- config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
240
+ # ensure IPHONEOS_DEPLOYMENT_TARGET is at least 11.0
241
+ should_upgrade = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].split('.')[0].to_i < 11
242
+ if should_upgrade
243
+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
241
244
  end
245
+ end
242
246
  end
243
247
 
244
248
  # But... doing so caused another issue in Flipper:
245
249
  # "Time.h:52:17: error: typedef redefinition with different types"
246
- # We need to make a patch to RCT-Folly - set `__IPHONE_10_0` to our iOS target + 1.
250
+ # We need to make a patch to RCT-Folly - remove the `__IPHONE_OS_VERSION_MIN_REQUIRED` check.
247
251
  # See https://github.com/facebook/flipper/issues/834 for more details.
248
- `sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' #{installer.sandbox.root}/RCT-Folly/folly/portability/Time.h`
252
+ `sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' Pods/RCT-Folly/folly/portability/Time.h`
249
253
  end
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "17.0.2",
14
- "react-native": "0.66.0"
14
+ "react-native": "0.66.4"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",
@@ -1 +0,0 @@
1
- 97aa9ee16c73b2719e734dfca7955cc7
@@ -1 +0,0 @@
1
- fce4971f4b9d2e14a7c9b9c937de50c2f540aeed
@@ -1 +0,0 @@
1
- e5b1160770d8ad76c12293f71af81177365d39dfe5023d2ba945cd5ba9075eba
@@ -1 +0,0 @@
1
- 9307f5f9fbaf46f225724c772cb6453aa783d327600624f32cbb57b0998cd10f0c0c8719b113c85f853eece8ce3ebdc8ebd4c8b405b6966a16ba1683760d3c98
@@ -1 +0,0 @@
1
- 7f7afb752108d7497f173a51a2a7c1d3
@@ -1 +0,0 @@
1
- ea73cda3891c16705811a0ad97e4d4154043f8b2
@@ -1 +0,0 @@
1
- 37be5cd2ca88190d762a5b0bc69b26cb1a70e55947796f230670ceae87945150
@@ -1 +0,0 @@
1
- c99c0ec2456727ac36143e82b256e0d4922e4f0389c18128170e80f220a751b9157bed31c09f8d3625e5e6cb93123a66139028b717fe0fd5c877682c4e9e1a41
@@ -1 +0,0 @@
1
- f6d3eb2b4c08088306510ea5ff5a613b
@@ -1 +0,0 @@
1
- 38b15b9076259f70d460230d125e538e2a9773c0
@@ -1 +0,0 @@
1
- 4983b3276f63f2d5d19cdebcc515f3f5f0a7edb75f31537231c1ffe6cdd1cf44
@@ -1 +0,0 @@
1
- 0666cb4555fd23528d7bb7cc9ae5b8089df8bc2161c77ee7d2d59dff7bb5b929ebe1add1f139ac84598161ef1c2d8c040438e586f9e82382f169237af85da00a