react-native 0.70.0-rc.0 → 0.70.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/React/Base/RCTVersion.m +1 -1
  3. package/React-Core.podspec +7 -1
  4. package/ReactAndroid/gradle.properties +2 -2
  5. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  6. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  7. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0-debug-sources.jar → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1-debug-sources.jar} +0 -0
  8. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0-debug-sources.jar.md5 → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1-debug-sources.jar.md5} +0 -0
  9. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0-debug-sources.jar.sha1 → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1-debug-sources.jar.sha1} +0 -0
  10. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0-debug-sources.jar.sha256 → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1-debug-sources.jar.sha256} +0 -0
  11. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0-debug-sources.jar.sha512 → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1-debug-sources.jar.sha512} +0 -0
  12. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1-debug.aar +0 -0
  13. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1-debug.aar.md5 +1 -0
  14. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1-debug.aar.sha1 +1 -0
  15. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1-debug.aar.sha256 +1 -0
  16. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1-debug.aar.sha512 +1 -0
  17. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0-release-sources.jar → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1-release-sources.jar} +0 -0
  18. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0-release-sources.jar.md5 → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1-release-sources.jar.md5} +0 -0
  19. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0-release-sources.jar.sha1 → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1-release-sources.jar.sha1} +0 -0
  20. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0-release-sources.jar.sha256 → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1-release-sources.jar.sha256} +0 -0
  21. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0-release-sources.jar.sha512 → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1-release-sources.jar.sha512} +0 -0
  22. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1-release.aar +0 -0
  23. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1-release.aar.md5 +1 -0
  24. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1-release.aar.sha1 +1 -0
  25. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1-release.aar.sha256 +1 -0
  26. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1-release.aar.sha512 +1 -0
  27. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0.module → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1.module} +33 -33
  28. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1.module.md5 +1 -0
  29. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1.module.sha1 +1 -0
  30. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1.module.sha256 +1 -0
  31. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1.module.sha512 +1 -0
  32. package/android/com/facebook/react/hermes-engine/{0.70.0-rc.0/hermes-engine-0.70.0-rc.0.pom → 0.70.0-rc.1/hermes-engine-0.70.0-rc.1.pom} +1 -1
  33. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1.pom.md5 +1 -0
  34. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1.pom.sha1 +1 -0
  35. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1.pom.sha256 +1 -0
  36. package/android/com/facebook/react/hermes-engine/0.70.0-rc.1/hermes-engine-0.70.0-rc.1.pom.sha512 +1 -0
  37. package/android/com/facebook/react/hermes-engine/maven-metadata.xml +4 -4
  38. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.md5 +1 -1
  39. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha1 +1 -1
  40. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha256 +1 -1
  41. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha512 +1 -1
  42. package/android/com/facebook/react/react-native/{0.70.0-rc.0/react-native-0.70.0-rc.0-debug-sources.jar → 0.70.0-rc.1/react-native-0.70.0-rc.1-debug-sources.jar} +0 -0
  43. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-debug-sources.jar.md5 +1 -0
  44. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-debug-sources.jar.sha1 +1 -0
  45. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-debug-sources.jar.sha256 +1 -0
  46. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-debug-sources.jar.sha512 +1 -0
  47. package/android/com/facebook/react/react-native/{0.70.0-rc.0/react-native-0.70.0-rc.0-debug.aar → 0.70.0-rc.1/react-native-0.70.0-rc.1-debug.aar} +0 -0
  48. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-debug.aar.md5 +1 -0
  49. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-debug.aar.sha1 +1 -0
  50. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-debug.aar.sha256 +1 -0
  51. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-debug.aar.sha512 +1 -0
  52. package/android/com/facebook/react/react-native/{0.70.0-rc.0/react-native-0.70.0-rc.0-release-sources.jar → 0.70.0-rc.1/react-native-0.70.0-rc.1-release-sources.jar} +0 -0
  53. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-release-sources.jar.md5 +1 -0
  54. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-release-sources.jar.sha1 +1 -0
  55. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-release-sources.jar.sha256 +1 -0
  56. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-release-sources.jar.sha512 +1 -0
  57. package/android/com/facebook/react/react-native/{0.70.0-rc.0/react-native-0.70.0-rc.0-release.aar → 0.70.0-rc.1/react-native-0.70.0-rc.1-release.aar} +0 -0
  58. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-release.aar.md5 +1 -0
  59. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-release.aar.sha1 +1 -0
  60. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-release.aar.sha256 +1 -0
  61. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1-release.aar.sha512 +1 -0
  62. package/android/com/facebook/react/react-native/{0.70.0-rc.0/react-native-0.70.0-rc.0.module → 0.70.0-rc.1/react-native-0.70.0-rc.1.module} +45 -45
  63. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1.module.md5 +1 -0
  64. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1.module.sha1 +1 -0
  65. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1.module.sha256 +1 -0
  66. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1.module.sha512 +1 -0
  67. package/android/com/facebook/react/react-native/{0.70.0-rc.0/react-native-0.70.0-rc.0.pom → 0.70.0-rc.1/react-native-0.70.0-rc.1.pom} +2 -2
  68. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1.pom.md5 +1 -0
  69. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1.pom.sha1 +1 -0
  70. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1.pom.sha256 +1 -0
  71. package/android/com/facebook/react/react-native/0.70.0-rc.1/react-native-0.70.0-rc.1.pom.sha512 +1 -0
  72. package/android/com/facebook/react/react-native/maven-metadata.xml +4 -4
  73. package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
  74. package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
  75. package/android/com/facebook/react/react-native/maven-metadata.xml.sha256 +1 -1
  76. package/android/com/facebook/react/react-native/maven-metadata.xml.sha512 +1 -1
  77. package/package.json +5 -5
  78. package/scripts/cocoapods/codegen.rb +35 -0
  79. package/scripts/cocoapods/codegen_script_phase_extractor.rb +13 -0
  80. package/scripts/cocoapods/codegen_utils.rb +286 -0
  81. package/scripts/cocoapods/helpers.rb +8 -0
  82. package/scripts/cocoapods/utils.rb +12 -0
  83. package/scripts/react_native_pods.rb +53 -252
  84. package/sdks/.hermesversion +1 -1
  85. package/sdks/hermes-engine/hermes-engine.podspec +3 -1
  86. package/sdks/hermesc/osx-bin/hermesc +0 -0
  87. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  88. package/template/android/app/build.gradle +1 -0
  89. package/template/android/build.gradle +0 -2
  90. package/template/package.json +1 -1
  91. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0-debug.aar +0 -0
  92. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0-debug.aar.md5 +0 -1
  93. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0-debug.aar.sha1 +0 -1
  94. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0-debug.aar.sha256 +0 -1
  95. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0-debug.aar.sha512 +0 -1
  96. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0-release.aar +0 -0
  97. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0-release.aar.md5 +0 -1
  98. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0-release.aar.sha1 +0 -1
  99. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0-release.aar.sha256 +0 -1
  100. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0-release.aar.sha512 +0 -1
  101. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0.module.md5 +0 -1
  102. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0.module.sha1 +0 -1
  103. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0.module.sha256 +0 -1
  104. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0.module.sha512 +0 -1
  105. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0.pom.md5 +0 -1
  106. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0.pom.sha1 +0 -1
  107. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0.pom.sha256 +0 -1
  108. package/android/com/facebook/react/hermes-engine/0.70.0-rc.0/hermes-engine-0.70.0-rc.0.pom.sha512 +0 -1
  109. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-debug-sources.jar.md5 +0 -1
  110. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-debug-sources.jar.sha1 +0 -1
  111. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-debug-sources.jar.sha256 +0 -1
  112. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-debug-sources.jar.sha512 +0 -1
  113. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-debug.aar.md5 +0 -1
  114. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-debug.aar.sha1 +0 -1
  115. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-debug.aar.sha256 +0 -1
  116. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-debug.aar.sha512 +0 -1
  117. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-release-sources.jar.md5 +0 -1
  118. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-release-sources.jar.sha1 +0 -1
  119. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-release-sources.jar.sha256 +0 -1
  120. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-release-sources.jar.sha512 +0 -1
  121. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-release.aar.md5 +0 -1
  122. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-release.aar.sha1 +0 -1
  123. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-release.aar.sha256 +0 -1
  124. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0-release.aar.sha512 +0 -1
  125. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0.module.md5 +0 -1
  126. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0.module.sha1 +0 -1
  127. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0.module.sha256 +0 -1
  128. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0.module.sha512 +0 -1
  129. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0.pom.md5 +0 -1
  130. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0.pom.sha1 +0 -1
  131. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0.pom.sha256 +0 -1
  132. package/android/com/facebook/react/react-native/0.70.0-rc.0/react-native-0.70.0-rc.0.pom.sha512 +0 -1
@@ -3,11 +3,11 @@
3
3
  <groupId>com.facebook.react</groupId>
4
4
  <artifactId>react-native</artifactId>
5
5
  <versioning>
6
- <latest>0.70.0-rc.0</latest>
7
- <release>0.70.0-rc.0</release>
6
+ <latest>0.70.0-rc.1</latest>
7
+ <release>0.70.0-rc.1</release>
8
8
  <versions>
9
- <version>0.70.0-rc.0</version>
9
+ <version>0.70.0-rc.1</version>
10
10
  </versions>
11
- <lastUpdated>20220715150924</lastUpdated>
11
+ <lastUpdated>20220728140933</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 724d2211a3eb05077c7e281152e93e8d
1
+ 35e31587d9a1a0c753d3b46a1b9a2b6d
@@ -1 +1 @@
1
- dafa5ced561aaef14e358651939c770b4baa588b
1
+ 898df460198861d5ad1c4d6f034fbf0aee7271b6
@@ -1 +1 @@
1
- f58f3d4d0236cecdd7001126a3ee26c93c2dc56b105dc65dc40c019b5494a0e8
1
+ 576c6b7eb1d650ab6ffae1c728447ede921582a03c206a0f5ba725f6eccad643
@@ -1 +1 @@
1
- f993e5133225f713bfa30119f503b7cc18c177bb182aa6b86bfd863caf68081054359d1e9fdbe8779568c7e833ea9b47bd402dd7ab740263049a314ab2fd0738
1
+ 6a700f99921e475d5abf89a705c8ccff0b8736c20a99e5496ac848edd954047b742c15fb829ce36a4045d502bbdfbcf93cf4f0ecc26e16b02e9db324b9582704
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native",
3
- "version": "0.70.0-rc.0",
3
+ "version": "0.70.0-rc.1",
4
4
  "bin": "./cli.js",
5
5
  "description": "A framework for building native apps using React",
6
6
  "license": "MIT",
@@ -98,9 +98,9 @@
98
98
  },
99
99
  "dependencies": {
100
100
  "@jest/create-cache-key-function": "^27.0.1",
101
- "@react-native-community/cli": "^9.0.0-alpha.3",
102
- "@react-native-community/cli-platform-android": "^9.0.0-alpha.3",
103
- "@react-native-community/cli-platform-ios": "^9.0.0-alpha.3",
101
+ "@react-native-community/cli": "^9.0.0-alpha.5",
102
+ "@react-native-community/cli-platform-android": "^9.0.0-alpha.5",
103
+ "@react-native-community/cli-platform-ios": "^9.0.0-alpha.5",
104
104
  "@react-native/assets": "1.0.0",
105
105
  "@react-native/normalize-color": "2.0.0",
106
106
  "@react-native/polyfills": "2.0.0",
@@ -140,7 +140,7 @@
140
140
  "@babel/generator": "^7.14.0",
141
141
  "@babel/plugin-transform-regenerator": "^7.0.0",
142
142
  "@react-native-community/eslint-plugin": "*",
143
- "@react-native/eslint-plugin-specs": ">0.0.2",
143
+ "@react-native/eslint-plugin-specs": "^0.70.0",
144
144
  "@reactions/component": "^2.0.2",
145
145
  "async": "^3.2.2",
146
146
  "clang-format": "^1.2.4",
@@ -65,3 +65,38 @@ def checkAndGenerateEmptyThirdPartyProvider!(react_native_path, new_arch_enabled
65
65
  File.delete(temp_schema_list_path) if File.exist?(temp_schema_list_path)
66
66
  end
67
67
  end
68
+
69
+ def run_codegen!(
70
+ app_path,
71
+ config_file_dir,
72
+ new_arch_enabled: false,
73
+ disable_codegen: false,
74
+ react_native_path: "../node_modules/react-native",
75
+ fabric_enabled: false,
76
+ codegen_output_dir: 'build/generated/ios',
77
+ config_key: 'codegenConfig',
78
+ package_json_file: '~/app/package.json',
79
+ folly_version: '2021.07.22.00',
80
+ codegen_utils: CodegenUtils.new()
81
+ )
82
+ if new_arch_enabled
83
+ codegen_utils.use_react_native_codegen_discovery!(
84
+ disable_codegen,
85
+ app_path,
86
+ :react_native_path => react_native_path,
87
+ :fabric_enabled => fabric_enabled,
88
+ :config_file_dir => config_file_dir,
89
+ :codegen_output_dir => codegen_output_dir,
90
+ :config_key => config_key,
91
+ :folly_version => folly_version
92
+ )
93
+ else
94
+ # Generate a podspec file for generated files.
95
+ # This gets generated in use_react_native_codegen_discovery when codegen discovery is enabled.
96
+ react_codegen_spec = codegen_utils.get_react_codegen_spec(
97
+ package_json_file,
98
+ :fabric_enabled => fabric_enabled
99
+ )
100
+ codegen_utils.generate_react_codegen_podspec!(react_codegen_spec, codegen_output_dir)
101
+ end
102
+ end
@@ -0,0 +1,13 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ class CodegenScriptPhaseExtractor
7
+ def initialize()
8
+ end
9
+
10
+ def extract_script_phase(options)
11
+ get_script_phases_with_codegen_discovery(options)
12
+ end
13
+ end
@@ -0,0 +1,286 @@
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ #
3
+ # This source code is licensed under the MIT license found in the
4
+ # LICENSE file in the root directory of this source tree.
5
+
6
+ require 'json'
7
+ require_relative './helpers.rb'
8
+ require_relative './codegen_script_phase_extractor.rb'
9
+
10
+ class CodegenUtils
11
+
12
+ def initialize()
13
+ end
14
+
15
+ @@REACT_CODEGEN_PODSPEC_GENERATED = false
16
+
17
+ def self.set_react_codegen_podspec_generated(value)
18
+ @@REACT_CODEGEN_PODSPEC_GENERATED = value
19
+ end
20
+
21
+ def self.react_codegen_podspec_generated
22
+ @@REACT_CODEGEN_PODSPEC_GENERATED
23
+ end
24
+
25
+ @@REACT_CODEGEN_DISCOVERY_DONE = false
26
+
27
+ def self.set_react_codegen_discovery_done(value)
28
+ @@REACT_CODEGEN_DISCOVERY_DONE = value
29
+ end
30
+
31
+ def self.react_codegen_discovery_done
32
+ @@REACT_CODEGEN_DISCOVERY_DONE
33
+ end
34
+
35
+ # It takes some cocoapods specs and writes them into a file
36
+ #
37
+ # Parameters
38
+ # - spec: the cocoapod specs
39
+ # - codegen_output_dir: the output directory for the codegen
40
+ def generate_react_codegen_podspec!(spec, codegen_output_dir)
41
+ # This podspec file should only be create once in the session/pod install.
42
+ # This happens when multiple targets are calling use_react_native!.
43
+ if @@REACT_CODEGEN_PODSPEC_GENERATED
44
+ Pod::UI.puts "[Codegen] Skipping React-Codegen podspec generation."
45
+ return
46
+ end
47
+
48
+ relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd)
49
+ output_dir = "#{relative_installation_root}/#{codegen_output_dir}"
50
+ Pod::Executable.execute_command("mkdir", ["-p", output_dir]);
51
+
52
+ podspec_path = File.join(output_dir, 'React-Codegen.podspec.json')
53
+ Pod::UI.puts "[Codegen] Generating #{podspec_path}"
54
+
55
+ File.open(podspec_path, 'w') do |f|
56
+ f.write(spec.to_json)
57
+ f.fsync
58
+ end
59
+
60
+ @@REACT_CODEGEN_PODSPEC_GENERATED = true
61
+ end
62
+
63
+ # It generates the podspec object that represents the `React-Codegen.podspec` file
64
+ #
65
+ # Parameters
66
+ # - package_json_file: the path to the `package.json`, required to extract the proper React Native version
67
+ # - fabric_enabled: whether fabric is enabled or not.
68
+ # - script_phases: whether we want to add some build script phases or not.
69
+ def get_react_codegen_spec(package_json_file, folly_version: '2021.07.22.00', fabric_enabled: false, script_phases: nil)
70
+ package = JSON.parse(File.read(package_json_file))
71
+ version = package['version']
72
+
73
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
74
+ boost_compiler_flags = '-Wno-documentation'
75
+
76
+ spec = {
77
+ 'name' => "React-Codegen",
78
+ 'version' => version,
79
+ 'summary' => 'Temp pod for generated files for React Native',
80
+ 'homepage' => 'https://facebook.com/',
81
+ 'license' => 'Unlicense',
82
+ 'authors' => 'Facebook',
83
+ 'compiler_flags' => "#{folly_compiler_flags} #{boost_compiler_flags} -Wno-nullability-completeness -std=c++17",
84
+ 'source' => { :git => '' },
85
+ 'header_mappings_dir' => './',
86
+ 'platforms' => {
87
+ 'ios' => '11.0',
88
+ },
89
+ 'source_files' => "**/*.{h,mm,cpp}",
90
+ 'pod_target_xcconfig' => { "HEADER_SEARCH_PATHS" =>
91
+ [
92
+ "\"$(PODS_ROOT)/boost\"",
93
+ "\"$(PODS_ROOT)/RCT-Folly\"",
94
+ "\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
95
+ "\"$(PODS_ROOT)/Headers/Private/React-Fabric\"",
96
+ "\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"",
97
+ ].join(' ')
98
+ },
99
+ 'dependencies': {
100
+ "FBReactNativeSpec": [version],
101
+ "React-jsiexecutor": [version],
102
+ "RCT-Folly": [folly_version],
103
+ "RCTRequired": [version],
104
+ "RCTTypeSafety": [version],
105
+ "React-Core": [version],
106
+ "React-jsi": [version],
107
+ "ReactCommon/turbomodule/core": [version]
108
+ }
109
+ }
110
+
111
+ if fabric_enabled
112
+ spec[:'dependencies'].merge!({
113
+ 'React-graphics': [version],
114
+ 'React-rncore': [version],
115
+ });
116
+ end
117
+
118
+ if script_phases
119
+ Pod::UI.puts "[Codegen] Adding script_phases to React-Codegen."
120
+ spec[:'script_phases'] = script_phases
121
+ end
122
+
123
+ return spec
124
+ end
125
+
126
+ # It extracts the codegen config from the configuration file
127
+ #
128
+ # Parameters
129
+ # - config_path: a path to the configuration file
130
+ # - config_ket: the codegen configuration key
131
+ #
132
+ # Returns: the list of dependencies as extracted from the package.json
133
+ def get_codegen_config_from_file(config_path, config_key)
134
+ empty = {'libraries' => []}
135
+ if !File.exist?(config_path)
136
+ return empty
137
+ end
138
+
139
+ config = JSON.parse(File.read(config_path))
140
+ return config[config_key] ? config[config_key] : empty
141
+ end
142
+
143
+ # It creates a list of JS files that contains the JS specifications that Codegen needs to use to generate the code
144
+ #
145
+ # Parameters
146
+ # - app_codegen_config: an object that contains the configurations
147
+ # - app_path: path to the app
148
+ #
149
+ # Returns: the list of files that needs to be used by Codegen
150
+ def get_list_of_js_specs(app_codegen_config, app_path)
151
+ file_list = []
152
+
153
+ if app_codegen_config['libraries'] then
154
+ Pod::UI.warn '[Deprecated] You are using the old `libraries` array to list all your codegen.\nThis method will be removed in the future.\nUpdate your `package.json` with a single object.'
155
+ app_codegen_config['libraries'].each do |library|
156
+ library_dir = File.join(app_path, library['jsSrcsDir'])
157
+ file_list.concat(Finder.find_codegen_file(library_dir))
158
+ end
159
+ elsif app_codegen_config['jsSrcsDir'] then
160
+ codegen_dir = File.join(app_path, app_codegen_config['jsSrcsDir'])
161
+ file_list.concat (Finder.find_codegen_file(codegen_dir))
162
+ else
163
+ Pod::UI.warn '[Error] Codegen not properly configured. Please add the `codegenConfig` entry to your `package.json`'
164
+ abort
165
+ end
166
+
167
+ input_files = file_list.map { |filename| "${PODS_ROOT}/../#{Pathname.new(filename).realpath().relative_path_from(Pod::Config.instance.installation_root)}" }
168
+
169
+ return input_files
170
+ end
171
+
172
+ # It generates the build script phase for the codegen
173
+ #
174
+ # Parameters
175
+ # - app_path: the path to the app
176
+ # - fabric_enabled: whether fabric is enabled or not
177
+ # - config_file_dir: the directory of the config file
178
+ # - react_native_path: the path to React Native
179
+ # - config_key: the configuration key to use in the package.json for the Codegen
180
+ # - codegen_utils: an object which exposes utilities functions for the codegen
181
+ # - script_phase_extractor: an object that is able to extract the Xcode Script Phases for React Native
182
+ #
183
+ # Return: an object containing the script phase
184
+ def get_react_codegen_script_phases(
185
+ app_path,
186
+ fabric_enabled: false,
187
+ config_file_dir: '',
188
+ react_native_path: "../node_modules/react-native",
189
+ config_key: 'codegenConfig',
190
+ codegen_utils: CodegenUtils.new(),
191
+ script_phase_extractor: CodegenScriptPhaseExtractor.new()
192
+ )
193
+ if !app_path
194
+ Pod::UI.warn '[Codegen] error: app_path is requried to use codegen discovery.'
195
+ abort
196
+ end
197
+
198
+ # We need to convert paths to relative path from installation_root for the script phase for CI.
199
+ relative_app_root = Pathname.new(app_path).realpath().relative_path_from(Pod::Config.instance.installation_root)
200
+
201
+ relative_config_file_dir = ''
202
+ if config_file_dir != ''
203
+ relative_config_file_dir = Pathname.new(config_file_dir).relative_path_from(Pod::Config.instance.installation_root)
204
+ end
205
+
206
+ # Generate input files for in-app libaraies which will be used to check if the script needs to be run.
207
+ # TODO: Ideally, we generate the input_files list from generate-artifacts.js and read the result here.
208
+ # Or, generate this podspec in generate-artifacts.js as well.
209
+ app_package_path = File.join(app_path, 'package.json')
210
+ app_codegen_config = codegen_utils.get_codegen_config_from_file(app_package_path, config_key)
211
+ input_files = codegen_utils.get_list_of_js_specs(app_codegen_config, app_path)
212
+
213
+ # Add a script phase to trigger generate artifact.
214
+ # Some code is duplicated so that it's easier to delete the old way and switch over to this once it's stabilized.
215
+ return {
216
+ 'name': 'Generate Specs',
217
+ 'execution_position': :before_compile,
218
+ 'input_files' => input_files,
219
+ 'show_env_vars_in_log': true,
220
+ 'output_files': ["${DERIVED_FILE_DIR}/react-codegen.log"],
221
+ 'script': script_phase_extractor.extract_script_phase(
222
+ react_native_path: react_native_path,
223
+ relative_app_root: relative_app_root,
224
+ relative_config_file_dir: relative_config_file_dir,
225
+ fabric_enabled: fabric_enabled
226
+ ),
227
+ }
228
+ end
229
+
230
+ def use_react_native_codegen_discovery!(
231
+ codegen_disabled,
232
+ app_path,
233
+ react_native_path: "../node_modules/react-native",
234
+ fabric_enabled: false,
235
+ config_file_dir: '',
236
+ codegen_output_dir: 'build/generated/ios',
237
+ config_key: 'codegenConfig',
238
+ folly_version: '2021.07.22.00',
239
+ codegen_utils: CodegenUtils.new()
240
+ )
241
+ return if codegen_disabled
242
+
243
+ if CodegenUtils.react_codegen_discovery_done()
244
+ Pod::UI.puts "[Codegen] Skipping use_react_native_codegen_discovery."
245
+ return
246
+ end
247
+
248
+ if !app_path
249
+ Pod::UI.warn '[Codegen] Error: app_path is required for use_react_native_codegen_discovery.'
250
+ Pod::UI.warn '[Codegen] If you are calling use_react_native_codegen_discovery! in your Podfile, please remove the call and pass `app_path` and/or `config_file_dir` to `use_react_native!`.'
251
+ abort
252
+ end
253
+
254
+ Pod::UI.warn '[Codegen] warn: using experimental new codegen integration'
255
+ relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd)
256
+
257
+ # Generate React-Codegen podspec here to add the script phases.
258
+ script_phases = codegen_utils.get_react_codegen_script_phases(
259
+ app_path,
260
+ :fabric_enabled => fabric_enabled,
261
+ :config_file_dir => config_file_dir,
262
+ :react_native_path => react_native_path,
263
+ :config_key => config_key
264
+ )
265
+ react_codegen_spec = codegen_utils.get_react_codegen_spec(
266
+ File.join(react_native_path, "package.json"),
267
+ :folly_version => folly_version,
268
+ :fabric_enabled => fabric_enabled,
269
+ :script_phases => script_phases
270
+ )
271
+ codegen_utils.generate_react_codegen_podspec!(react_codegen_spec, codegen_output_dir)
272
+
273
+ out = Pod::Executable.execute_command(
274
+ 'node',
275
+ [
276
+ "#{relative_installation_root}/#{react_native_path}/scripts/generate-artifacts.js",
277
+ "-p", "#{app_path}",
278
+ "-o", Pod::Config.instance.installation_root,
279
+ "-e", "#{fabric_enabled}",
280
+ "-c", "#{config_file_dir}",
281
+ ])
282
+ Pod::UI.puts out;
283
+
284
+ CodegenUtils.set_react_codegen_discovery_done(true)
285
+ end
286
+ end
@@ -18,3 +18,11 @@ class Environment
18
18
  return RUBY_PLATFORM
19
19
  end
20
20
  end
21
+
22
+ class Finder
23
+ def self.find_codegen_file(path)
24
+ js_files = '-name "Native*.js" -or -name "*NativeComponent.js"'
25
+ ts_files = '-name "Native*.ts" -or -name "*NativeComponent.ts"'
26
+ return `find #{path} -type f \\( #{js_files} -or #{ts_files} \\)`.split("\n").sort()
27
+ end
28
+ end
@@ -93,6 +93,18 @@ class ReactNativePodsUtils
93
93
  end
94
94
  end
95
95
 
96
+ def self.fix_react_bridging_header_search_paths(installer)
97
+ installer.target_installation_results.pod_target_installation_results
98
+ .each do |pod_name, target_installation_result|
99
+ target_installation_result.native_target.build_configurations.each do |config|
100
+ # For third party modules who have React-bridging dependency to search correct headers
101
+ config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) '
102
+ config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging" '
103
+ config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers" '
104
+ end
105
+ end
106
+ end
107
+
96
108
  def self.apply_mac_catalyst_patches(installer)
97
109
  # Fix bundle signing issues
98
110
  installer.pods_project.targets.each do |target|