react-native-stallion 2.5.0-alpha.1 → 2.5.0-alpha.3

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 (254) hide show
  1. package/README.md +45 -16
  2. package/android/src/main/java/com/stallion/networkmanager/StallionApiConstants.java +4 -0
  3. package/android/src/main/java/com/stallion/networkmanager/StallionApiManager.java +2 -0
  4. package/android/src/main/java/com/stallion/networkmanager/StallionFileDownloader.java +8 -2
  5. package/android/src/main/java/com/stallion/networkmanager/StallionPatchHandler.java +4 -1
  6. package/android/src/main/java/com/stallion/networkmanager/StallionStageManager.java +7 -2
  7. package/android/src/main/java/com/stallion/networkmanager/StallionSyncHandler.java +14 -9
  8. package/android/src/main/java/com/stallion/storage/StallionConfig.java +2 -10
  9. package/android/src/main/java/com/stallion/utils/StallionSlotManager.java +1 -0
  10. package/ios/main/StallionConfig.m +2 -6
  11. package/ios/main/StallionConstants.swift +4 -0
  12. package/ios/main/StallionFileDownloader.swift +7 -3
  13. package/ios/main/StallionPatchHandler.swift +4 -1
  14. package/ios/main/StallionSlotManager.m +5 -4
  15. package/ios/main/StallionStageManager.swift +10 -4
  16. package/ios/main/StallionSyncHandler.swift +9 -2
  17. package/package.json +12 -4
  18. package/src/index.js +2 -0
  19. package/src/index.js.map +1 -1
  20. package/src/main/components/StallionDevMenu.js +69 -0
  21. package/src/main/components/StallionDevMenu.js.map +1 -0
  22. package/src/main/components/common/BackButton/index.js +19 -42
  23. package/src/main/components/common/BackButton/index.js.map +1 -1
  24. package/src/main/components/common/Chevron/index.js +64 -0
  25. package/src/main/components/common/Chevron/index.js.map +1 -0
  26. package/src/main/components/common/CrossButton/index.js +18 -11
  27. package/src/main/components/common/CrossButton/index.js.map +1 -1
  28. package/src/main/components/common/Header/index.js +3 -15
  29. package/src/main/components/common/Header/index.js.map +1 -1
  30. package/src/main/components/common/Header/styles.js +0 -22
  31. package/src/main/components/common/Header/styles.js.map +1 -1
  32. package/src/main/components/modules/devMenu/components/ActionButton.js +45 -0
  33. package/src/main/components/modules/devMenu/components/ActionButton.js.map +1 -0
  34. package/src/main/components/modules/devMenu/components/AppHeader.js +17 -0
  35. package/src/main/components/modules/devMenu/components/AppHeader.js.map +1 -0
  36. package/src/main/components/modules/devMenu/components/BucketRow.js +34 -0
  37. package/src/main/components/modules/devMenu/components/BucketRow.js.map +1 -0
  38. package/src/main/components/modules/devMenu/components/BundleHistoryCard.js +92 -0
  39. package/src/main/components/modules/devMenu/components/BundleHistoryCard.js.map +1 -0
  40. package/src/main/components/modules/devMenu/components/Chip.js +16 -0
  41. package/src/main/components/modules/devMenu/components/Chip.js.map +1 -0
  42. package/src/main/components/modules/devMenu/components/DetailHeader.js +32 -0
  43. package/src/main/components/modules/devMenu/components/DetailHeader.js.map +1 -0
  44. package/src/main/components/modules/devMenu/components/DeviceCard.js +31 -0
  45. package/src/main/components/modules/devMenu/components/DeviceCard.js.map +1 -0
  46. package/src/main/components/modules/devMenu/components/ErrorBanner.js +17 -0
  47. package/src/main/components/modules/devMenu/components/ErrorBanner.js.map +1 -0
  48. package/src/main/components/modules/devMenu/components/ModeToggle.js +54 -0
  49. package/src/main/components/modules/devMenu/components/ModeToggle.js.map +1 -0
  50. package/src/main/components/modules/devMenu/components/ProdBundleCard.js +47 -0
  51. package/src/main/components/modules/devMenu/components/ProdBundleCard.js.map +1 -0
  52. package/src/main/components/modules/devMenu/components/ReleaseNote.js +44 -0
  53. package/src/main/components/modules/devMenu/components/ReleaseNote.js.map +1 -0
  54. package/src/main/components/modules/devMenu/components/SectionLabel.js +13 -0
  55. package/src/main/components/modules/devMenu/components/SectionLabel.js.map +1 -0
  56. package/src/main/components/modules/devMenu/components/StateCard.js +30 -0
  57. package/src/main/components/modules/devMenu/components/StateCard.js.map +1 -0
  58. package/src/main/components/modules/devMenu/components/Wordmark.js +35 -0
  59. package/src/main/components/modules/devMenu/components/Wordmark.js.map +1 -0
  60. package/src/main/components/modules/devMenu/components/styles/index.js +403 -0
  61. package/src/main/components/modules/devMenu/components/styles/index.js.map +1 -0
  62. package/src/main/components/modules/devMenu/index.js +47 -0
  63. package/src/main/components/modules/devMenu/index.js.map +1 -0
  64. package/src/main/components/modules/devMenu/screens/BundleHistory.js +142 -0
  65. package/src/main/components/modules/devMenu/screens/BundleHistory.js.map +1 -0
  66. package/src/main/components/modules/devMenu/screens/Production.js +65 -0
  67. package/src/main/components/modules/devMenu/screens/Production.js.map +1 -0
  68. package/src/main/components/modules/devMenu/screens/TestingBuckets.js +81 -0
  69. package/src/main/components/modules/devMenu/screens/TestingBuckets.js.map +1 -0
  70. package/src/main/components/modules/devMenu/styles.js +50 -0
  71. package/src/main/components/modules/devMenu/styles.js.map +1 -0
  72. package/src/main/components/modules/modal/StallionModal.js +15 -51
  73. package/src/main/components/modules/modal/StallionModal.js.map +1 -1
  74. package/src/main/components/modules/modal/hooks/useStallionModal.js +21 -19
  75. package/src/main/components/modules/modal/hooks/useStallionModal.js.map +1 -1
  76. package/src/main/constants/appConstants.js +56 -53
  77. package/src/main/constants/appConstants.js.map +1 -1
  78. package/src/main/constants/colors.js +1 -10
  79. package/src/main/constants/colors.js.map +1 -1
  80. package/src/main/constants/designTokens.js +80 -0
  81. package/src/main/constants/designTokens.js.map +1 -0
  82. package/src/main/index.js +3 -1
  83. package/src/main/index.js.map +1 -1
  84. package/src/main/state/useStallionEvents.js.map +1 -1
  85. package/src/main/utils/useStallionConfig.js +14 -0
  86. package/src/main/utils/useStallionConfig.js.map +1 -0
  87. package/src/types/bundle.types.js +7 -0
  88. package/src/types/bundle.types.js.map +1 -1
  89. package/types/index.d.ts +2 -0
  90. package/types/index.d.ts.map +1 -1
  91. package/types/main/components/StallionDevMenu.d.ts +5 -0
  92. package/types/main/components/StallionDevMenu.d.ts.map +1 -0
  93. package/types/main/components/common/BackButton/index.d.ts +4 -3
  94. package/types/main/components/common/BackButton/index.d.ts.map +1 -1
  95. package/types/main/components/common/Chevron/index.d.ts +11 -0
  96. package/types/main/components/common/Chevron/index.d.ts.map +1 -0
  97. package/types/main/components/common/CrossButton/index.d.ts +4 -3
  98. package/types/main/components/common/CrossButton/index.d.ts.map +1 -1
  99. package/types/main/components/common/Header/index.d.ts +0 -2
  100. package/types/main/components/common/Header/index.d.ts.map +1 -1
  101. package/types/main/components/common/Header/styles.d.ts +0 -21
  102. package/types/main/components/common/Header/styles.d.ts.map +1 -1
  103. package/types/main/components/modules/devMenu/components/ActionButton.d.ts +19 -0
  104. package/types/main/components/modules/devMenu/components/ActionButton.d.ts.map +1 -0
  105. package/types/main/components/modules/devMenu/components/AppHeader.d.ts +7 -0
  106. package/types/main/components/modules/devMenu/components/AppHeader.d.ts.map +1 -0
  107. package/types/main/components/modules/devMenu/components/BucketRow.d.ts +11 -0
  108. package/types/main/components/modules/devMenu/components/BucketRow.d.ts.map +1 -0
  109. package/types/main/components/modules/devMenu/components/BundleHistoryCard.d.ts +22 -0
  110. package/types/main/components/modules/devMenu/components/BundleHistoryCard.d.ts.map +1 -0
  111. package/types/main/components/modules/devMenu/components/Chip.d.ts +9 -0
  112. package/types/main/components/modules/devMenu/components/Chip.d.ts.map +1 -0
  113. package/types/main/components/modules/devMenu/components/DetailHeader.d.ts +10 -0
  114. package/types/main/components/modules/devMenu/components/DetailHeader.d.ts.map +1 -0
  115. package/types/main/components/modules/devMenu/components/DeviceCard.d.ts +8 -0
  116. package/types/main/components/modules/devMenu/components/DeviceCard.d.ts.map +1 -0
  117. package/types/main/components/modules/devMenu/components/ErrorBanner.d.ts +6 -0
  118. package/types/main/components/modules/devMenu/components/ErrorBanner.d.ts.map +1 -0
  119. package/types/main/components/modules/devMenu/components/ModeToggle.d.ts +8 -0
  120. package/types/main/components/modules/devMenu/components/ModeToggle.d.ts.map +1 -0
  121. package/types/main/components/modules/devMenu/components/ProdBundleCard.d.ts +13 -0
  122. package/types/main/components/modules/devMenu/components/ProdBundleCard.d.ts.map +1 -0
  123. package/types/main/components/modules/devMenu/components/ReleaseNote.d.ts +11 -0
  124. package/types/main/components/modules/devMenu/components/ReleaseNote.d.ts.map +1 -0
  125. package/types/main/components/modules/devMenu/components/SectionLabel.d.ts +6 -0
  126. package/types/main/components/modules/devMenu/components/SectionLabel.d.ts.map +1 -0
  127. package/types/main/components/modules/devMenu/components/StateCard.d.ts +9 -0
  128. package/types/main/components/modules/devMenu/components/StateCard.d.ts.map +1 -0
  129. package/types/main/components/modules/{listing/index.d.ts → devMenu/components/Wordmark.d.ts} +1 -1
  130. package/types/main/components/modules/devMenu/components/Wordmark.d.ts.map +1 -0
  131. package/types/main/components/modules/devMenu/components/styles/index.d.ts +353 -0
  132. package/types/main/components/modules/devMenu/components/styles/index.d.ts.map +1 -0
  133. package/types/main/components/modules/devMenu/index.d.ts +14 -0
  134. package/types/main/components/modules/devMenu/index.d.ts.map +1 -0
  135. package/types/main/components/modules/devMenu/screens/BundleHistory.d.ts +4 -0
  136. package/types/main/components/modules/devMenu/screens/BundleHistory.d.ts.map +1 -0
  137. package/types/main/components/modules/devMenu/screens/Production.d.ts +4 -0
  138. package/types/main/components/modules/devMenu/screens/Production.d.ts.map +1 -0
  139. package/types/main/components/modules/devMenu/screens/TestingBuckets.d.ts +4 -0
  140. package/types/main/components/modules/devMenu/screens/TestingBuckets.d.ts.map +1 -0
  141. package/types/main/components/modules/devMenu/styles.d.ts +46 -0
  142. package/types/main/components/modules/devMenu/styles.d.ts.map +1 -0
  143. package/types/main/components/modules/modal/StallionModal.d.ts.map +1 -1
  144. package/types/main/components/modules/modal/hooks/useStallionModal.d.ts +5 -6
  145. package/types/main/components/modules/modal/hooks/useStallionModal.d.ts.map +1 -1
  146. package/types/main/constants/appConstants.d.ts +46 -48
  147. package/types/main/constants/appConstants.d.ts.map +1 -1
  148. package/types/main/constants/colors.d.ts +0 -9
  149. package/types/main/constants/colors.d.ts.map +1 -1
  150. package/types/main/constants/designTokens.d.ts +73 -0
  151. package/types/main/constants/designTokens.d.ts.map +1 -0
  152. package/types/main/index.d.ts +1 -0
  153. package/types/main/index.d.ts.map +1 -1
  154. package/types/main/state/useStallionEvents.d.ts +2 -0
  155. package/types/main/state/useStallionEvents.d.ts.map +1 -1
  156. package/types/main/utils/useStallionConfig.d.ts +5 -0
  157. package/types/main/utils/useStallionConfig.d.ts.map +1 -0
  158. package/types/types/bundle.types.d.ts +7 -0
  159. package/types/types/bundle.types.d.ts.map +1 -1
  160. package/types/types/utils.types.d.ts +3 -0
  161. package/types/types/utils.types.d.ts.map +1 -1
  162. package/src/main/components/common/ErrorView/index.js +0 -24
  163. package/src/main/components/common/ErrorView/index.js.map +0 -1
  164. package/src/main/components/common/ErrorView/styles.js +0 -30
  165. package/src/main/components/common/ErrorView/styles.js.map +0 -1
  166. package/src/main/components/common/Footer/index.js +0 -50
  167. package/src/main/components/common/Footer/index.js.map +0 -1
  168. package/src/main/components/common/Footer/styles.js +0 -91
  169. package/src/main/components/common/Footer/styles.js.map +0 -1
  170. package/src/main/components/common/FooterLoader/index.js +0 -11
  171. package/src/main/components/common/FooterLoader/index.js.map +0 -1
  172. package/src/main/components/common/FooterLoader/styles.js +0 -12
  173. package/src/main/components/common/FooterLoader/styles.js.map +0 -1
  174. package/src/main/components/common/OverlayLoader/index.js +0 -26
  175. package/src/main/components/common/OverlayLoader/index.js.map +0 -1
  176. package/src/main/components/common/OverlayLoader/styles.js +0 -33
  177. package/src/main/components/common/OverlayLoader/styles.js.map +0 -1
  178. package/src/main/components/modules/listing/components/BucketCard.js +0 -33
  179. package/src/main/components/modules/listing/components/BucketCard.js.map +0 -1
  180. package/src/main/components/modules/listing/components/BucketCardInfoSection.js +0 -56
  181. package/src/main/components/modules/listing/components/BucketCardInfoSection.js.map +0 -1
  182. package/src/main/components/modules/listing/components/BundleCard.js +0 -42
  183. package/src/main/components/modules/listing/components/BundleCard.js.map +0 -1
  184. package/src/main/components/modules/listing/components/BundleCardInfoSection.js +0 -82
  185. package/src/main/components/modules/listing/components/BundleCardInfoSection.js.map +0 -1
  186. package/src/main/components/modules/listing/components/CardDescriptionContent.js +0 -36
  187. package/src/main/components/modules/listing/components/CardDescriptionContent.js.map +0 -1
  188. package/src/main/components/modules/listing/components/ConfigView.js +0 -29
  189. package/src/main/components/modules/listing/components/ConfigView.js.map +0 -1
  190. package/src/main/components/modules/listing/components/MetaCard.js +0 -39
  191. package/src/main/components/modules/listing/components/MetaCard.js.map +0 -1
  192. package/src/main/components/modules/listing/components/SlotView.js +0 -80
  193. package/src/main/components/modules/listing/components/SlotView.js.map +0 -1
  194. package/src/main/components/modules/listing/components/styles/index.js +0 -121
  195. package/src/main/components/modules/listing/components/styles/index.js.map +0 -1
  196. package/src/main/components/modules/listing/hooks/useListing.js +0 -84
  197. package/src/main/components/modules/listing/hooks/useListing.js.map +0 -1
  198. package/src/main/components/modules/listing/index.js +0 -75
  199. package/src/main/components/modules/listing/index.js.map +0 -1
  200. package/src/main/components/modules/listing/styles.js +0 -24
  201. package/src/main/components/modules/listing/styles.js.map +0 -1
  202. package/src/main/components/modules/prod/index.js +0 -3
  203. package/src/main/components/modules/prod/index.js.map +0 -1
  204. package/src/main/components/modules/prod/prod.js +0 -30
  205. package/src/main/components/modules/prod/prod.js.map +0 -1
  206. package/src/main/components/modules/prod/styles/index.js +0 -29
  207. package/src/main/components/modules/prod/styles/index.js.map +0 -1
  208. package/types/__tests__/parseTokenRegion.test.d.ts +0 -2
  209. package/types/__tests__/parseTokenRegion.test.d.ts.map +0 -1
  210. package/types/main/components/common/ErrorView/index.d.ts +0 -8
  211. package/types/main/components/common/ErrorView/index.d.ts.map +0 -1
  212. package/types/main/components/common/ErrorView/styles.d.ts +0 -27
  213. package/types/main/components/common/ErrorView/styles.d.ts.map +0 -1
  214. package/types/main/components/common/Footer/index.d.ts +0 -10
  215. package/types/main/components/common/Footer/index.d.ts.map +0 -1
  216. package/types/main/components/common/Footer/styles.d.ts +0 -88
  217. package/types/main/components/common/Footer/styles.d.ts.map +0 -1
  218. package/types/main/components/common/FooterLoader/index.d.ts +0 -4
  219. package/types/main/components/common/FooterLoader/index.d.ts.map +0 -1
  220. package/types/main/components/common/FooterLoader/styles.d.ts +0 -10
  221. package/types/main/components/common/FooterLoader/styles.d.ts.map +0 -1
  222. package/types/main/components/common/OverlayLoader/index.d.ts +0 -7
  223. package/types/main/components/common/OverlayLoader/index.d.ts.map +0 -1
  224. package/types/main/components/common/OverlayLoader/styles.d.ts +0 -30
  225. package/types/main/components/common/OverlayLoader/styles.d.ts.map +0 -1
  226. package/types/main/components/modules/listing/components/BucketCard.d.ts +0 -13
  227. package/types/main/components/modules/listing/components/BucketCard.d.ts.map +0 -1
  228. package/types/main/components/modules/listing/components/BucketCardInfoSection.d.ts +0 -11
  229. package/types/main/components/modules/listing/components/BucketCardInfoSection.d.ts.map +0 -1
  230. package/types/main/components/modules/listing/components/BundleCard.d.ts +0 -15
  231. package/types/main/components/modules/listing/components/BundleCard.d.ts.map +0 -1
  232. package/types/main/components/modules/listing/components/BundleCardInfoSection.d.ts +0 -15
  233. package/types/main/components/modules/listing/components/BundleCardInfoSection.d.ts.map +0 -1
  234. package/types/main/components/modules/listing/components/CardDescriptionContent.d.ts +0 -8
  235. package/types/main/components/modules/listing/components/CardDescriptionContent.d.ts.map +0 -1
  236. package/types/main/components/modules/listing/components/ConfigView.d.ts +0 -8
  237. package/types/main/components/modules/listing/components/ConfigView.d.ts.map +0 -1
  238. package/types/main/components/modules/listing/components/MetaCard.d.ts +0 -8
  239. package/types/main/components/modules/listing/components/MetaCard.d.ts.map +0 -1
  240. package/types/main/components/modules/listing/components/SlotView.d.ts +0 -5
  241. package/types/main/components/modules/listing/components/SlotView.d.ts.map +0 -1
  242. package/types/main/components/modules/listing/components/styles/index.d.ts +0 -118
  243. package/types/main/components/modules/listing/components/styles/index.d.ts.map +0 -1
  244. package/types/main/components/modules/listing/hooks/useListing.d.ts +0 -15
  245. package/types/main/components/modules/listing/hooks/useListing.d.ts.map +0 -1
  246. package/types/main/components/modules/listing/index.d.ts.map +0 -1
  247. package/types/main/components/modules/listing/styles.d.ts +0 -21
  248. package/types/main/components/modules/listing/styles.d.ts.map +0 -1
  249. package/types/main/components/modules/prod/index.d.ts +0 -3
  250. package/types/main/components/modules/prod/index.d.ts.map +0 -1
  251. package/types/main/components/modules/prod/prod.d.ts +0 -4
  252. package/types/main/components/modules/prod/prod.d.ts.map +0 -1
  253. package/types/main/components/modules/prod/styles/index.d.ts +0 -25
  254. package/types/main/components/modules/prod/styles/index.d.ts.map +0 -1
package/README.md CHANGED
@@ -2,10 +2,13 @@
2
2
 
3
3
  # React Native Stallion – Best CodePush Alternative & Expo Updates Replacement
4
4
 
5
- [![npm Version](https://img.shields.io/npm/v/react-native-stallion.svg)](https://www.npmjs.com/package/react-native-stallion)
6
- [![License](https://img.shields.io/npm/l/react-native-stallion.svg)](https://www.npmjs.com/package/react-native-stallion)
5
+ [![npm Version](https://img.shields.io/npm/v/react-native-stallion.svg)](https://www.npmjs.com/package/react-native-stallion)   [![GitHub Stars](https://img.shields.io/github/stars/stallion-tech/react-native-stallion)](https://github.com/stallion-tech/react-native-stallion)   [![npm Downloads](https://img.shields.io/npm/dm/react-native-stallion.svg)](https://www.npmjs.com/package/react-native-stallion)   [![SOC 2 Type 1](https://img.shields.io/badge/SOC%202-Type%201%20Compliant-blue)](https://stalliontech.io/trust)   [![License](https://img.shields.io/npm/l/react-native-stallion.svg)](https://www.npmjs.com/package/react-native-stallion)
7
6
 
8
- **React Native Stallion** is the modern **CodePush alternative** and **App Center replacement** for React Native apps. Ship app updates instantly with **up to 98% smaller patches (depending on changes)**—no app store resubmission required for JavaScript updates. The best **Expo Updates alternative** with advanced OTA controls, patch-based updates, and advanced security features.
7
+ ⭐ If React Native Stallion helps you ship OTA updates, [consider starring the repo on GitHub](https://github.com/stallion-tech/react-native-stallion)!
8
+
9
+ **React Native Stallion** is a modern **CodePush alternative** and **App Center replacement** for React Native apps. Ship app updates instantly with **up to 98% smaller patches (depending on changes)**—no app store resubmission required for JavaScript updates. A full-featured **Expo EAS Update alternative** with advanced OTA controls, patch-based updates, and enterprise security.
10
+
11
+ Trusted by **2,500+ organizations** serving **500M+ users**. **10,000 MAU free tier** — no credit card required.
9
12
 
10
13
  👉 **[Sign up with Stallion](https://console.stalliontech.io/)** to start shipping OTA updates today
11
14
 
@@ -13,7 +16,7 @@
13
16
 
14
17
  ## Why Choose React Native Stallion?
15
18
 
16
- React Native Stallion is the **best CodePush alternative** for teams that need modern OTA update capabilities:
19
+ React Native Stallion is a leading **CodePush replacement** for teams that need modern OTA update capabilities:
17
20
 
18
21
  - **Up to 98% Smaller Patch Updates (Depending on Changes)** – Binary-safe differential updates, not full bundles
19
22
  - **Automatic Rollback & Crash Recovery** – Instant rollback on crashes or failures
@@ -55,6 +58,12 @@ const UpdateModal = () => {
55
58
 
56
59
  ---
57
60
 
61
+ ## Migrating from CodePush?
62
+
63
+ Replace deprecated CodePush with React Native Stallion in minutes. **[Read the migration guide →](https://stalliontech.io/learn/docs/migrating-from-codepush)**
64
+
65
+ ---
66
+
58
67
  ## Key Features
59
68
 
60
69
  ### Patch Updates (Up to 98% Smaller, Depending on Changes)
@@ -109,7 +118,7 @@ yarn add react-native-stallion@latest
109
118
 
110
119
  For complete setup instructions, native integration steps, and environment configurations, visit:
111
120
 
112
- **📚 [Full Installation Guide](https://learn.stalliontech.io/docs/sdk/installation)**
121
+ **📚 [Full Installation Guide](https://stalliontech.io/learn/docs/sdk/installation)**
113
122
 
114
123
  ### Step 3: Configure Stallion
115
124
 
@@ -125,15 +134,27 @@ export default withStallion(RootComponent);
125
134
 
126
135
  ### Complete Documentation
127
136
 
128
- - **[Full Documentation](https://learn.stalliontech.io)** – Complete API reference and guides
129
- - **[SDK Installation](https://learn.stalliontech.io/docs/sdk/installation)** – Step-by-step setup
130
- - **[Bundle Signing](https://learn.stalliontech.io/docs/bundle-signing)** – Security best practices
131
- - **[Custom Update UI](https://learn.stalliontech.io/blogs/react-native-over-the-air-updates-with-custom-ui)** – Build custom flows
132
- - **[CI/CD Integration](https://learn.stalliontech.io/docs/release-automation)** – Automate deployments
137
+ - **[Full Documentation](https://stalliontech.io/learn)** – Complete API reference and guides
138
+ - **[SDK Installation](https://stalliontech.io/learn/docs/sdk/installation)** – Step-by-step setup
139
+ - **[Bundle Signing](https://stalliontech.io/learn/docs/bundle-signing)** – Security best practices
140
+ - **[Custom Update UI](https://stalliontech.io/learn/blogs/react-native-over-the-air-updates-with-custom-ui)** – Build custom flows
141
+ - **[CI/CD Integration](https://stalliontech.io/learn/docs/release-automation)** – Automate deployments
142
+
143
+ ### Featured Guides
144
+
145
+ - **[New Architecture Support](https://stalliontech.io/react-native-new-architecture)** – Fabric, TurboModules, and React Native 0.76+
146
+ - **[Patch Updates Explained](https://stalliontech.io/react-native-patch-updates)** – How binary-safe diffs work
147
+ - **[OTA Security Guide](https://stalliontech.io/ota-update-security)** – Bundle signing, integrity, and rollbacks
148
+ - **[OTA Best Practices (2026)](https://stalliontech.io/learn/blogs/react-native-ota-best-practices-stallion)** – Safer release workflows
149
+ - **[React Native OTA Updates Guide](https://stalliontech.io/react-native-ota-updates-guide)** – Complete OTA overview
150
+ - **[API Reference](https://stalliontech.io/learn/docs/sdk/api-reference)** – SDK hooks and methods
151
+ - **[Getting Started](https://stalliontech.io/learn/docs/introduction)** – Platform overview
152
+ - **[Pricing](https://stalliontech.io/pricing)** – Plans and free tier details
153
+ - **[Trust Center](https://stalliontech.io/trust)** – Compliance and security resources
133
154
 
134
155
  ### Migration Guides
135
156
 
136
- - **[CodePush Migration](https://learn.stalliontech.io/docs/migrating-from-codepush)** – Migrate from CodePush
157
+ - **[CodePush Migration](https://stalliontech.io/learn/docs/migrating-from-codepush)** – Migrate from CodePush
137
158
  - **[App Center Migration](https://stalliontech.io/app-center-alternative)** – Replace App Center
138
159
  - **[Expo Updates Migration](https://stalliontech.io/expo-eas-update)** – Switch from Expo Updates
139
160
 
@@ -143,7 +164,7 @@ export default withStallion(RootComponent);
143
164
 
144
165
  ### CodePush Alternative
145
166
 
146
- React Native Stallion is the **best CodePush alternative** for teams migrating from deprecated CodePush or App Center:
167
+ React Native Stallion is a **modern CodePush replacement** for teams migrating from deprecated CodePush or App Center:
147
168
 
148
169
  - ✅ CodePush-compatible API
149
170
  - ✅ Patch updates (CodePush doesn't support)
@@ -152,7 +173,7 @@ React Native Stallion is the **best CodePush alternative** for teams migrating f
152
173
 
153
174
  ### Expo Updates Replacement
154
175
 
155
- The best **Expo Updates alternative** with more features:
176
+ A strong **Expo Updates replacement** with more features:
156
177
 
157
178
  - ✅ Patch updates (up to 98% smaller, depending on changes)
158
179
  - ✅ Advanced OTA controls
@@ -170,6 +191,12 @@ Enterprise-ready OTA update solution:
170
191
 
171
192
  ---
172
193
 
194
+ ## Security
195
+
196
+ React Native Stallion is SOC 2 Type 1 compliant (Security, Availability, Confidentiality).
197
+
198
+ ---
199
+
173
200
  ## Security Features
174
201
 
175
202
  - **Cryptographic Bundle Signing** – Customer-managed keys for tamper-proof updates
@@ -205,7 +232,7 @@ We welcome contributions! Please see the [CONTRIBUTING.md](./CONTRIBUTING.md) fi
205
232
  ## Issues & Support
206
233
 
207
234
  - **[Open Issues](https://github.com/stallion-tech/react-native-stallion/issues)** – Report bugs or request features
208
- - **[Documentation](https://learn.stalliontech.io)** – Complete guides and API reference
235
+ - **[Documentation](https://stalliontech.io/learn)** – Complete guides and API reference
209
236
  - **[Contact Support](https://stalliontech.io/)** – Get help from our team
210
237
 
211
238
  ---
@@ -213,10 +240,12 @@ We welcome contributions! Please see the [CONTRIBUTING.md](./CONTRIBUTING.md) fi
213
240
  ## 🔗 Links
214
241
 
215
242
  - **Website:** [https://stalliontech.io](https://stalliontech.io)
216
- - **Documentation:** [https://learn.stalliontech.io](https://learn.stalliontech.io)
243
+ - **Documentation:** [https://stalliontech.io/learn](https://stalliontech.io/learn)
217
244
  - **Console:** [https://console.stalliontech.io](https://console.stalliontech.io)
245
+ - **GitHub:** [https://github.com/stallion-tech/react-native-stallion](https://github.com/stallion-tech/react-native-stallion)
246
+ - **Pricing:** [https://stalliontech.io/pricing](https://stalliontech.io/pricing)
218
247
  - **NPM Package:** [https://www.npmjs.com/package/react-native-stallion](https://www.npmjs.com/package/react-native-stallion)
219
248
 
220
249
  ---
221
250
 
222
- > **React Native Stallion** – The fastest, safest way to manage React Native OTA updates. The best **CodePush alternative** and **Expo Updates replacement** with patch-based updates, advanced security features, and up to 98% smaller deployments (depending on changes).
251
+ > **React Native Stallion** – The fastest, safest way to manage React Native OTA updates. A **CodePush alternative** and **Expo EAS Update replacement** with patch-based updates, enterprise security, and up to 98% smaller deployments (depending on changes).
@@ -4,6 +4,10 @@ public class StallionApiConstants {
4
4
  // Buffer Size
5
5
  public static final int DOWNLOAD_BUFFER_SIZE = 1024 * 256;
6
6
 
7
+ // Network timeouts (aligned with iOS URLSession defaults)
8
+ public static final int CONNECT_TIMEOUT_MS = 30_000;
9
+ public static final int READ_TIMEOUT_MS = 60_000;
10
+
7
11
  // File and Folder Names
8
12
  public static final String ZIP_FILE_NAME = "build.zip";
9
13
  public static final String UNZIP_FOLDER_NAME = "/build";
@@ -28,6 +28,8 @@ public class StallionApiManager {
28
28
  URL url = new URL(urlString);
29
29
  urlConnection = (HttpURLConnection) url.openConnection();
30
30
  urlConnection.setRequestMethod("POST");
31
+ urlConnection.setConnectTimeout(StallionApiConstants.CONNECT_TIMEOUT_MS);
32
+ urlConnection.setReadTimeout(StallionApiConstants.READ_TIMEOUT_MS);
31
33
  urlConnection.setRequestProperty("Content-Type", "application/json");
32
34
 
33
35
  String appToken = stallionConfig.getAppToken();
@@ -69,6 +69,10 @@ public class StallionFileDownloader {
69
69
 
70
70
  } catch (Exception e) {
71
71
  Log.e(TAG, "Error in downloadBundle: " + e.getMessage(), e);
72
+ stallionDownloadCallback.onReject(
73
+ StallionApiConstants.DOWNLOAD_ERROR_PREFIX,
74
+ e.getMessage() != null ? e.getMessage() : "Unknown download error"
75
+ );
72
76
  }
73
77
  });
74
78
  }
@@ -159,8 +163,8 @@ public class StallionFileDownloader {
159
163
  return;
160
164
  }
161
165
  } catch (IOException e) {
162
- callback.onReject(StallionApiConstants.DOWNLOAD_ERROR_PREFIX, "IOException occurred: ");
163
- throw e;
166
+ String message = e.getMessage() != null ? e.getMessage() : "Unknown IO error";
167
+ throw new IOException("IOException occurred: " + message, e);
164
168
  } finally {
165
169
  connection.disconnect();
166
170
  }
@@ -176,6 +180,8 @@ public class StallionFileDownloader {
176
180
  URL url = new URL(downloadUrl);
177
181
  HttpURLConnection connection = (HttpURLConnection) url.openConnection();
178
182
  connection.setRequestMethod("GET");
183
+ connection.setConnectTimeout(StallionApiConstants.CONNECT_TIMEOUT_MS);
184
+ connection.setReadTimeout(StallionApiConstants.READ_TIMEOUT_MS);
179
185
 
180
186
  if (offset > 0) {
181
187
  connection.setRequestProperty("Range", "bytes=" + offset + "-");
@@ -50,7 +50,10 @@ public class StallionPatchHandler {
50
50
  // Create a temporary directory for the patched bundle
51
51
  File tempPatchedDir = new File(diffDir.getParent(), diffDir.getName() + "_patched_temp");
52
52
  try {
53
- // Copy base bundle to temporary location
53
+ // Clear any leftover temp dir, then copy base bundle
54
+ if (tempPatchedDir.exists()) {
55
+ StallionFileManager.deleteFileOrFolderSilently(tempPatchedDir);
56
+ }
54
57
  StallionFileManager.copyDirectory(baseBundleDir, tempPatchedDir);
55
58
 
56
59
  // Read and parse manifest.json
@@ -29,6 +29,7 @@ public class StallionStageManager {
29
29
  long alreadyDownloaded = StallionDownloadCacheManager.getDownloadCache(config, receivedDownloadUrl, downloadPath);
30
30
 
31
31
  emitDownloadStartedStage(receivedHash, alreadyDownloaded > 0);
32
+ final long downloadStartMs = System.currentTimeMillis();
32
33
 
33
34
  StallionFileDownloader.downloadBundle(
34
35
  receivedDownloadUrl,
@@ -43,10 +44,11 @@ public class StallionStageManager {
43
44
 
44
45
  @Override
45
46
  public void onSuccess(String successPayload) {
47
+ long downloadTimeMs = System.currentTimeMillis() - downloadStartMs;
46
48
  stallionStateManager.stallionMeta.setCurrentStageSlot(StallionMetaConstants.SlotStates.NEW_SLOT);
47
49
  stallionStateManager.stallionMeta.setStageTempHash(receivedHash);
48
50
  stallionStateManager.syncStallionMeta();
49
- emitDownloadSuccessStage(receivedHash);
51
+ emitDownloadSuccessStage(receivedHash, downloadTimeMs);
50
52
  StallionDownloadCacheManager.deleteDownloadCache(downloadPath);
51
53
  promise.resolve(successPayload);
52
54
  }
@@ -60,10 +62,13 @@ public class StallionStageManager {
60
62
  }
61
63
  }
62
64
 
63
- private static void emitDownloadSuccessStage(String releaseHash) {
65
+ private static void emitDownloadSuccessStage(String releaseHash, long downloadTimeMs) {
64
66
  JSONObject successPayload = new JSONObject();
65
67
  try {
66
68
  successPayload.put("releaseHash", releaseHash);
69
+ JSONObject meta = new JSONObject();
70
+ meta.put("downloadTime", downloadTimeMs);
71
+ successPayload.put("meta", meta.toString());
67
72
  } catch (Exception ignored) { }
68
73
  StallionEventManager.getInstance().sendEvent(
69
74
  StallionEventConstants.NativeStageEventTypes.DOWNLOAD_COMPLETE_STAGE.toString(),
@@ -171,6 +171,7 @@ public class StallionSyncHandler {
171
171
  long alreadyDownloaded = StallionDownloadCacheManager.getDownloadCache(config, downloadUrl, downloadPath);
172
172
 
173
173
  emitDownloadStarted(newReleaseHash, alreadyDownloaded > 0, bundleDiffIdForEvents);
174
+ final long downloadStartMs = System.currentTimeMillis();
174
175
 
175
176
  StallionFileDownloader.downloadBundle(
176
177
  downloadUrl,
@@ -185,6 +186,7 @@ public class StallionSyncHandler {
185
186
 
186
187
  @Override
187
188
  public void onSuccess(String successPayload) {
189
+ long downloadTimeMs = System.currentTimeMillis() - downloadStartMs;
188
190
  isDownloadInProgress.set(false);
189
191
  StallionDownloadCacheManager.deleteDownloadCache(downloadPath);
190
192
 
@@ -224,14 +226,14 @@ public class StallionSyncHandler {
224
226
  }
225
227
  }
226
228
 
227
- stateManager.stallionMeta.setCurrentProdSlot(StallionMetaConstants.SlotStates.NEW_SLOT);
228
- stateManager.stallionMeta.setProdTempHash(newReleaseHash);
229
- String currentProdNewHash = stateManager.stallionMeta.getProdNewHash();
230
- if(currentProdNewHash != null && !currentProdNewHash.isEmpty()) {
231
- StallionSlotManager.stabilizeProd();
232
- }
233
- stateManager.syncStallionMeta();
234
- emitDownloadSuccess(newReleaseHash, bundleDiffIdForEvents);
229
+ stateManager.stallionMeta.setCurrentProdSlot(StallionMetaConstants.SlotStates.NEW_SLOT);
230
+ stateManager.stallionMeta.setProdTempHash(newReleaseHash);
231
+ String currentProdNewHash = stateManager.stallionMeta.getProdNewHash();
232
+ if(currentProdNewHash != null && !currentProdNewHash.isEmpty()) {
233
+ StallionSlotManager.stabilizeProd();
234
+ }
235
+ stateManager.syncStallionMeta();
236
+ emitDownloadSuccess(newReleaseHash, bundleDiffIdForEvents, downloadTimeMs);
235
237
  }
236
238
 
237
239
  @Override
@@ -282,13 +284,16 @@ public class StallionSyncHandler {
282
284
  );
283
285
  }
284
286
 
285
- private static void emitDownloadSuccess(String releaseHash, String bundleDiffId) {
287
+ private static void emitDownloadSuccess(String releaseHash, String bundleDiffId, long downloadTimeMs) {
286
288
  JSONObject successPayload = new JSONObject();
287
289
  try {
288
290
  successPayload.put("releaseHash", releaseHash);
289
291
  if (bundleDiffId != null && !bundleDiffId.isEmpty()) {
290
292
  successPayload.put("diffId", bundleDiffId);
291
293
  }
294
+ JSONObject meta = new JSONObject();
295
+ meta.put("downloadTime", downloadTimeMs);
296
+ successPayload.put("meta", meta.toString());
292
297
  } catch (Exception ignored) { }
293
298
  StallionEventManager.getInstance().sendEvent(
294
299
  NativeProdEventTypes.DOWNLOAD_COMPLETE_PROD.toString(),
@@ -4,7 +4,6 @@ import android.content.Context;
4
4
  import android.content.SharedPreferences;
5
5
  import android.content.pm.PackageInfo;
6
6
  import android.content.res.Resources;
7
- import android.provider.Settings;
8
7
 
9
8
  import org.json.JSONException;
10
9
  import org.json.JSONObject;
@@ -53,7 +52,7 @@ public class StallionConfig {
53
52
  );
54
53
  this.publicSigningKey = stallionPublicKeyRes != 0 ? context.getString(stallionPublicKeyRes) : "";
55
54
 
56
- // get or generate UID
55
+ // get or generate UID (random install-scoped UUID)
57
56
  String cachedUniqueId = sharedPreferences.getString(
58
57
  StallionConfigConstants.UNIQUE_ID_IDENTIFIER,
59
58
  ""
@@ -61,14 +60,7 @@ public class StallionConfig {
61
60
  if(!cachedUniqueId.isEmpty()) {
62
61
  this.uid = cachedUniqueId;
63
62
  } else {
64
- try {
65
- this.uid = Settings.Secure.getString(
66
- context.getContentResolver(),
67
- Settings.Secure.ANDROID_ID
68
- );
69
- } catch (Exception ignored) {
70
- this.uid = UUID.randomUUID().toString();
71
- }
63
+ this.uid = UUID.randomUUID().toString();
72
64
  SharedPreferences.Editor editor = sharedPreferences.edit();
73
65
  editor.putString(StallionConfigConstants.UNIQUE_ID_IDENTIFIER, this.uid);
74
66
  editor.apply();
@@ -69,6 +69,7 @@ public class StallionSlotManager {
69
69
  File newSlot = new File(baseFolderPath, StallionConfigConstants.PROD_DIRECTORY + StallionConfigConstants.NEW_FOLDER_SLOT);
70
70
  File stableSlot = new File(baseFolderPath, StallionConfigConstants.PROD_DIRECTORY + StallionConfigConstants.STABLE_FOLDER_SLOT);
71
71
 
72
+ StallionFileManager.deleteFileOrFolderSilently(stableSlot);
72
73
  StallionFileManager.copyDirectory(newSlot, stableSlot);
73
74
 
74
75
  String newReleaseHash = stateManager.stallionMeta.getProdNewHash();
@@ -23,16 +23,12 @@
23
23
  _lastUnverifiedHash = [defaults stringForKey:LAST_UNVERIFIED_KEY_IDENTIFIER] ?: @"";
24
24
  _baseUrl = [defaults stringForKey:BASE_URL_IDENTIFIER] ?: @"";
25
25
 
26
+ // get or generate UID (random install-scoped UUID)
26
27
  NSString *cachedUid = [defaults stringForKey:UNIQUE_ID_IDENTIFIER];
27
28
  if (cachedUid && ![cachedUid isEqualToString:@""]) {
28
29
  _uid = cachedUid;
29
30
  } else {
30
- NSString *newUid = @"";
31
- if ([UIDevice currentDevice].identifierForVendor) {
32
- newUid = [UIDevice currentDevice].identifierForVendor.UUIDString;
33
- } else {
34
- newUid = [[NSUUID UUID] UUIDString];
35
- }
31
+ NSString *newUid = [[NSUUID UUID] UUIDString];
36
32
  [defaults setObject:newUid forKey:UNIQUE_ID_IDENTIFIER];
37
33
  [defaults synchronize];
38
34
  _uid = newUid;
@@ -35,6 +35,10 @@ class StallionConstants {
35
35
  }
36
36
  static let PROGRESS_EVENT_THRESHOLD: Float = 0.05;
37
37
  static let PROGRESS_THROTTLE_INTERVAL_MS: TimeInterval = 0.3; // 300ms
38
+
39
+ // Network timeouts (aligned with Android HttpURLConnection)
40
+ static let CONNECT_TIMEOUT_MS: TimeInterval = 30_000
41
+ static let READ_TIMEOUT_MS: TimeInterval = 60_000
38
42
 
39
43
  static let PROD_DIRECTORY = "StallionProd"
40
44
  static let STAGE_DIRECTORY = "StallionStage"
@@ -9,9 +9,13 @@ import Foundation
9
9
  import ZIPFoundation
10
10
 
11
11
  class StallionFileDownloader: NSObject {
12
- private lazy var urlSession = URLSession(configuration: .default,
13
- delegate: self,
14
- delegateQueue: nil)
12
+ private lazy var urlSession: URLSession = {
13
+ let configuration = URLSessionConfiguration.default
14
+ configuration.timeoutIntervalForRequest = StallionConstants.READ_TIMEOUT_MS / 1000
15
+ return URLSession(configuration: configuration,
16
+ delegate: self,
17
+ delegateQueue: nil)
18
+ }()
15
19
  private var downloadTask: URLSessionDownloadTask?
16
20
  private var _resolve: RCTPromiseResolveBlock?
17
21
  private var _reject: RCTPromiseRejectBlock?
@@ -54,7 +54,10 @@ class StallionPatchHandler {
54
54
  }
55
55
  }
56
56
 
57
- // Copy base bundle to temporary location
57
+ // Clear any leftover temp dir, then copy base bundle
58
+ if FileManager.default.fileExists(atPath: tempPatchedDir.path) {
59
+ try? FileManager.default.removeItem(at: tempPatchedDir)
60
+ }
58
61
  StallionFileManager.copyFileOrDirectory(from: baseBundlePath, to: tempPatchedDir.path)
59
62
 
60
63
  // Verify copy succeeded
@@ -50,9 +50,9 @@
50
50
  StallionStateManager *stateManager = [StallionStateManager sharedInstance];
51
51
  NSString *baseFolderPath = stateManager.stallionConfig.filesDirectory;
52
52
 
53
- [StallionFileManager deleteFileOrFolderSilently:[NSString stringWithFormat:@"%@%@%@", baseFolderPath, StallionObjConstants.prod_directory, StallionObjConstants.new_folder_slot]];
54
- [StallionFileManager deleteFileOrFolderSilently:[NSString stringWithFormat:@"%@%@%@", baseFolderPath, StallionObjConstants.prod_directory, StallionObjConstants.stable_folder_slot]];
55
- [StallionFileManager deleteFileOrFolderSilently:[NSString stringWithFormat:@"%@%@%@", baseFolderPath, StallionObjConstants.prod_directory, StallionObjConstants.temp_folder_slot]];
53
+ [StallionFileManager deleteFileOrFolderSilently:[NSString stringWithFormat:@"%@/%@/%@", baseFolderPath, StallionObjConstants.prod_directory, StallionObjConstants.new_folder_slot]];
54
+ [StallionFileManager deleteFileOrFolderSilently:[NSString stringWithFormat:@"%@/%@/%@", baseFolderPath, StallionObjConstants.prod_directory, StallionObjConstants.stable_folder_slot]];
55
+ [StallionFileManager deleteFileOrFolderSilently:[NSString stringWithFormat:@"%@/%@/%@", baseFolderPath, StallionObjConstants.prod_directory, StallionObjConstants.temp_folder_slot]];
56
56
 
57
57
  [stateManager clearStallionMeta];
58
58
  }
@@ -74,7 +74,8 @@
74
74
  NSString *newSlotPath = [NSString stringWithFormat:@"%@/%@/%@", baseFolderPath, StallionObjConstants.prod_directory, StallionObjConstants.new_folder_slot];
75
75
  NSString *stableSlotPath = [NSString stringWithFormat:@"%@/%@/%@", baseFolderPath, StallionObjConstants.prod_directory, StallionObjConstants.stable_folder_slot];
76
76
 
77
- [StallionFileManager moveFileFrom:newSlotPath to:stableSlotPath];
77
+ [StallionFileManager deleteFileOrFolderSilently:stableSlotPath];
78
+ [StallionFileManager copyFileOrDirectoryFrom:newSlotPath to:stableSlotPath];
78
79
 
79
80
  NSString *newReleaseHash = stateManager.stallionMeta.prodNewHash;
80
81
  [stateManager.stallionMeta setProdStableHash:newReleaseHash];
@@ -43,6 +43,7 @@ class StallionStageManager: NSObject {
43
43
  }
44
44
 
45
45
  emitDownloadStartedStage(releaseHash: receivedHash)
46
+ let downloadStartMs = Int(Date().timeIntervalSince1970 * 1000)
46
47
 
47
48
  // Start bundle download
48
49
  StallionFileDownloader().downloadBundle(
@@ -52,10 +53,11 @@ class StallionStageManager: NSObject {
52
53
  emitDownloadProgressStage(releaseHash: receivedHash, progress: progress)
53
54
  },
54
55
  resolve: { _ in
56
+ let downloadTimeMs = Int(Date().timeIntervalSince1970 * 1000) - downloadStartMs
55
57
  stallionStateManager.stallionMeta.currentStageSlot = SlotStates.newSlot
56
58
  stallionStateManager.stallionMeta.stageTempHash = receivedHash
57
59
  stallionStateManager.syncStallionMeta()
58
- emitDownloadSuccessStage(releaseHash: receivedHash)
60
+ emitDownloadSuccessStage(releaseHash: receivedHash, downloadTimeMs: downloadTimeMs)
59
61
  resolveClosure("Stage download success")
60
62
  },
61
63
  reject: { code, prefix, error in
@@ -79,9 +81,13 @@ class StallionStageManager: NSObject {
79
81
  )
80
82
  }
81
83
 
82
- private static func emitDownloadSuccessStage(releaseHash: String) {
83
- let successPayload: NSDictionary = ["releaseHash": releaseHash]
84
- Stallion.sendEventToRn(eventName: StallionConstants.NativeEventTypesStage.DOWNLOAD_COMPLETE_STAGE,eventBody: successPayload,
84
+ private static func emitDownloadSuccessStage(releaseHash: String, downloadTimeMs: Int) {
85
+ var successPayload: [String: Any] = ["releaseHash": releaseHash]
86
+ if let metaData = try? JSONSerialization.data(withJSONObject: ["downloadTime": downloadTimeMs]),
87
+ let metaString = String(data: metaData, encoding: .utf8) {
88
+ successPayload["meta"] = metaString
89
+ }
90
+ Stallion.sendEventToRn(eventName: StallionConstants.NativeEventTypesStage.DOWNLOAD_COMPLETE_STAGE,eventBody: successPayload as NSDictionary,
85
91
  shouldCache: true
86
92
  )
87
93
  }
@@ -67,6 +67,7 @@ class StallionSyncHandler {
67
67
 
68
68
  var request = URLRequest(url: url)
69
69
  request.httpMethod = "POST"
70
+ request.timeoutInterval = StallionConstants.READ_TIMEOUT_MS / 1000
70
71
  request.setValue("application/json", forHTTPHeaderField: "Content-Type")
71
72
 
72
73
  // Add tokens
@@ -231,6 +232,7 @@ class StallionSyncHandler {
231
232
  guard let fromUrl = URL(string: urlToDownload + "?projectId=" + projectId) else { return }
232
233
 
233
234
  emitDownloadStarted(releaseHash: newReleaseHash, bundleDiffId: bundleDiffIdForEvents)
235
+ let downloadStartMs = Int(Date().timeIntervalSince1970 * 1000)
234
236
 
235
237
  StallionFileDownloader().downloadBundle(
236
238
  url: fromUrl,
@@ -239,6 +241,7 @@ class StallionSyncHandler {
239
241
  emitDownloadProgress(releaseHash: newReleaseHash, progress: progress)
240
242
  },
241
243
  resolve: { _ in
244
+ let downloadTimeMs = Int(Date().timeIntervalSince1970 * 1000) - downloadStartMs
242
245
  completeDownload()
243
246
 
244
247
  // If this was a diff download, handle patch
@@ -287,7 +290,7 @@ class StallionSyncHandler {
287
290
  StallionSlotManager.stabilizeProd()
288
291
  }
289
292
  stateManager.syncStallionMeta()
290
- emitDownloadSuccess(releaseHash: newReleaseHash, bundleDiffId: bundleDiffIdForEvents)
293
+ emitDownloadSuccess(releaseHash: newReleaseHash, bundleDiffId: bundleDiffIdForEvents, downloadTimeMs: downloadTimeMs)
291
294
  },
292
295
  reject: { code, prefix, error in
293
296
  completeDownload()
@@ -326,8 +329,12 @@ class StallionSyncHandler {
326
329
  )
327
330
  }
328
331
 
329
- private static func emitDownloadSuccess(releaseHash: String, bundleDiffId: String?) {
332
+ private static func emitDownloadSuccess(releaseHash: String, bundleDiffId: String?, downloadTimeMs: Int) {
330
333
  var successPayload: [String: Any] = ["releaseHash": releaseHash]
334
+ if let metaData = try? JSONSerialization.data(withJSONObject: ["downloadTime": downloadTimeMs]),
335
+ let metaString = String(data: metaData, encoding: .utf8) {
336
+ successPayload["meta"] = metaString
337
+ }
331
338
  if let bundleDiffId = bundleDiffId, !bundleDiffId.isEmpty {
332
339
  successPayload["diffId"] = bundleDiffId
333
340
  }
package/package.json CHANGED
@@ -1,15 +1,23 @@
1
1
  {
2
2
  "name": "react-native-stallion",
3
- "version": "2.5.0-alpha.1",
4
- "description": "Offical React Native SDK for Stallion",
5
- "main": "index",
3
+ "version": "2.5.0-alpha.3",
4
+ "description": "Official React Native OTA updates SDK — CodePush alternative with patch updates, rollback, and bundle signing.",
5
+ "main": "src/index",
6
6
  "types": "types/index.d.ts",
7
7
  "react-native": "src/index",
8
8
  "source": "src/index",
9
9
  "keywords": [
10
10
  "react-native",
11
11
  "ios",
12
- "android"
12
+ "android",
13
+ "codepush",
14
+ "codepush-alternative",
15
+ "ota-updates",
16
+ "expo-updates",
17
+ "app-center",
18
+ "over-the-air",
19
+ "react-native-ota",
20
+ "eas-update"
13
21
  ],
14
22
  "repository": {
15
23
  "type": "git",
package/src/index.js CHANGED
@@ -19,8 +19,10 @@ if (StallionNativeModule !== null && StallionNativeModule !== void 0 && Stallion
19
19
  withStallion = withStallionNoop;
20
20
  useStallionModal = useStallionModalNoop;
21
21
  }
22
+ export { default as StallionDevMenu } from './main/components/StallionDevMenu';
22
23
  export { sync, restart } from './main/utils/StallionNativeUtils';
23
24
  export { useStallionUpdate } from './main/utils/useStallionUpdate';
25
+ export { default as useStallionConfig } from './main/utils/useStallionConfig';
24
26
  export const addEventListener = stallionEventEmitter.addEventListener.bind(stallionEventEmitter);
25
27
  export const removeEventListener = stallionEventEmitter.removeEventListener.bind(stallionEventEmitter);
26
28
  export const ACTIVE_RELEASE_HASH = getActiveReleaseHashNative();
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["StallionNativeModule","STALLION_DISABLED_ERROR","withStallionNoop","useStallionModalNoop","withStallionMain","useStallionModalMain","stallionEventEmitter","getActiveReleaseHashNative","withStallion","useStallionModal","getStallionConfig","console","warn","sync","restart","useStallionUpdate","addEventListener","bind","removeEventListener","ACTIVE_RELEASE_HASH"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,OAAOA,oBAAoB,IACzBC,uBAAuB,QAClB,wBAAwB;;AAE/B;AACA,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,oBAAoB,MAAM,yBAAyB;;AAE1D;AACA,OAAOC,gBAAgB,MAAM,2BAA2B;AACxD,OAAOC,oBAAoB,MAAM,+BAA+B;AAGhE,SAASC,oBAAoB,QAAQ,mCAAmC;AACxE,SAASC,0BAA0B,QAAQ,kCAAkC;AAE7E,OAAO,IAAIC,YAA2B;AACtC,OAAO,IAAIC,gBAAyC;AAEpD,IAAIT,oBAAoB,aAApBA,oBAAoB,eAApBA,oBAAoB,CAAEU,iBAAiB,EAAE;EAC3CF,YAAY,GAAGJ,gBAAgB;EAC/BK,gBAAgB,GAAGJ,oBAAoB;AACzC,CAAC,MAAM;EACLM,OAAO,CAACC,IAAI,CAACX,uBAAuB,CAAC;EACrCO,YAAY,GAAGN,gBAAgB;EAC/BO,gBAAgB,GAAGN,oBAAoB;AACzC;AAEA,SAASU,IAAI,EAAEC,OAAO,QAAQ,kCAAkC;AAChE,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,OAAO,MAAMC,gBAAgB,GAC3BV,oBAAoB,CAACU,gBAAgB,CAACC,IAAI,CAACX,oBAAoB,CAAC;AAClE,OAAO,MAAMY,mBAAmB,GAC9BZ,oBAAoB,CAACY,mBAAmB,CAACD,IAAI,CAACX,oBAAoB,CAAC;AAErE,OAAO,MAAMa,mBAAmB,GAAGZ,0BAA0B,CAAC,CAAC"}
1
+ {"version":3,"names":["StallionNativeModule","STALLION_DISABLED_ERROR","withStallionNoop","useStallionModalNoop","withStallionMain","useStallionModalMain","stallionEventEmitter","getActiveReleaseHashNative","withStallion","useStallionModal","getStallionConfig","console","warn","default","StallionDevMenu","sync","restart","useStallionUpdate","useStallionConfig","addEventListener","bind","removeEventListener","ACTIVE_RELEASE_HASH"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,OAAOA,oBAAoB,IACzBC,uBAAuB,QAClB,wBAAwB;;AAE/B;AACA,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,OAAOC,oBAAoB,MAAM,yBAAyB;;AAE1D;AACA,OAAOC,gBAAgB,MAAM,2BAA2B;AACxD,OAAOC,oBAAoB,MAAM,+BAA+B;AAGhE,SAASC,oBAAoB,QAAQ,mCAAmC;AACxE,SAASC,0BAA0B,QAAQ,kCAAkC;AAE7E,OAAO,IAAIC,YAA2B;AACtC,OAAO,IAAIC,gBAAyC;AAEpD,IAAIT,oBAAoB,aAApBA,oBAAoB,eAApBA,oBAAoB,CAAEU,iBAAiB,EAAE;EAC3CF,YAAY,GAAGJ,gBAAgB;EAC/BK,gBAAgB,GAAGJ,oBAAoB;AACzC,CAAC,MAAM;EACLM,OAAO,CAACC,IAAI,CAACX,uBAAuB,CAAC;EACrCO,YAAY,GAAGN,gBAAgB;EAC/BO,gBAAgB,GAAGN,oBAAoB;AACzC;AAEA,SAASU,OAAO,IAAIC,eAAe,QAAQ,mCAAmC;AAC9E,SAASC,IAAI,EAAEC,OAAO,QAAQ,kCAAkC;AAChE,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASJ,OAAO,IAAIK,iBAAiB,QAAQ,gCAAgC;AAC7E,OAAO,MAAMC,gBAAgB,GAC3Bb,oBAAoB,CAACa,gBAAgB,CAACC,IAAI,CAACd,oBAAoB,CAAC;AAClE,OAAO,MAAMe,mBAAmB,GAC9Bf,oBAAoB,CAACe,mBAAmB,CAACD,IAAI,CAACd,oBAAoB,CAAC;AAErE,OAAO,MAAMgB,mBAAmB,GAAGf,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,69 @@
1
+ import React, { useContext, useEffect } from 'react';
2
+ import { StyleSheet, View } from 'react-native';
3
+ import Login from './modules/login';
4
+ import DevMenu from './modules/devMenu';
5
+ import AppHeader from './modules/devMenu/components/AppHeader';
6
+ import useStallionModal from './modules/modal/hooks/useStallionModal';
7
+ import { DS_COLORS } from '../constants/designTokens';
8
+ import { GlobalContext } from '../state';
9
+ const StallionDevMenu = _ref => {
10
+ let {
11
+ onClosePress
12
+ } = _ref;
13
+ const {
14
+ actions: {
15
+ refreshMeta
16
+ }
17
+ } = useContext(GlobalContext);
18
+ const {
19
+ onBackPress,
20
+ loginRequired,
21
+ isTesting,
22
+ isBundleHistory,
23
+ bucketTitle,
24
+ bucketSubtitle,
25
+ downloadError,
26
+ handleSwitch
27
+ } = useStallionModal();
28
+ useEffect(() => {
29
+ refreshMeta();
30
+ }, [refreshMeta]);
31
+ return /*#__PURE__*/React.createElement(View, {
32
+ style: styles.screen
33
+ }, loginRequired ? /*#__PURE__*/React.createElement(View, {
34
+ style: styles.loginContainer
35
+ }, /*#__PURE__*/React.createElement(AppHeader, {
36
+ onClosePress: onClosePress
37
+ }), /*#__PURE__*/React.createElement(View, {
38
+ style: styles.loginSection
39
+ }, /*#__PURE__*/React.createElement(Login, null))) : /*#__PURE__*/React.createElement(DevMenu, {
40
+ isTesting: isTesting,
41
+ isBundleHistory: isBundleHistory,
42
+ bucketTitle: bucketTitle,
43
+ bucketSubtitle: bucketSubtitle,
44
+ downloadError: downloadError,
45
+ onBackPress: onBackPress,
46
+ onClosePress: onClosePress,
47
+ onTabChange: handleSwitch
48
+ }));
49
+ };
50
+ const styles = StyleSheet.create({
51
+ // The dev menu takes the whole screen; there is no scrim behind it.
52
+ screen: {
53
+ flex: 1,
54
+ backgroundColor: DS_COLORS.screenBg
55
+ },
56
+ // Login is mode-agnostic — you cannot reach the Testing/Production toggle
57
+ // until you are signed in — so its header stays untinted.
58
+ loginContainer: {
59
+ flex: 1,
60
+ backgroundColor: DS_COLORS.cardBg
61
+ },
62
+ loginSection: {
63
+ flex: 1,
64
+ borderTopWidth: 1,
65
+ borderTopColor: DS_COLORS.headerHairline
66
+ }
67
+ });
68
+ export default StallionDevMenu;
69
+ //# sourceMappingURL=StallionDevMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useContext","useEffect","StyleSheet","View","Login","DevMenu","AppHeader","useStallionModal","DS_COLORS","GlobalContext","StallionDevMenu","_ref","onClosePress","actions","refreshMeta","onBackPress","loginRequired","isTesting","isBundleHistory","bucketTitle","bucketSubtitle","downloadError","handleSwitch","createElement","style","styles","screen","loginContainer","loginSection","onTabChange","create","flex","backgroundColor","screenBg","cardBg","borderTopWidth","borderTopColor","headerHairline"],"sourceRoot":"../../../../src","sources":["main/components/StallionDevMenu.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,QAAQ,OAAO;AACpD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,OAAOC,KAAK,MAAM,iBAAiB;AACnC,OAAOC,OAAO,MAAM,mBAAmB;AACvC,OAAOC,SAAS,MAAM,wCAAwC;AAC9D,OAAOC,gBAAgB,MAAM,wCAAwC;AAErE,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SAASC,aAAa,QAAQ,UAAU;AAGxC,MAAMC,eAAgD,GAAGC,IAAA,IAAsB;EAAA,IAArB;IAAEC;EAAa,CAAC,GAAAD,IAAA;EACxE,MAAM;IACJE,OAAO,EAAE;MAAEC;IAAY;EACzB,CAAC,GAAGd,UAAU,CAACS,aAAa,CAAC;EAE7B,MAAM;IACJM,WAAW;IACXC,aAAa;IACbC,SAAS;IACTC,eAAe;IACfC,WAAW;IACXC,cAAc;IACdC,aAAa;IACbC;EACF,CAAC,GAAGf,gBAAgB,CAAC,CAAC;EAEtBN,SAAS,CAAC,MAAM;IACda,WAAW,CAAC,CAAC;EACf,CAAC,EAAE,CAACA,WAAW,CAAC,CAAC;EAEjB,oBACEf,KAAA,CAAAwB,aAAA,CAACpB,IAAI;IAACqB,KAAK,EAAEC,MAAM,CAACC;EAAO,GACxBV,aAAa,gBACZjB,KAAA,CAAAwB,aAAA,CAACpB,IAAI;IAACqB,KAAK,EAAEC,MAAM,CAACE;EAAe,gBACjC5B,KAAA,CAAAwB,aAAA,CAACjB,SAAS;IAACM,YAAY,EAAEA;EAAa,CAAE,CAAC,eACzCb,KAAA,CAAAwB,aAAA,CAACpB,IAAI;IAACqB,KAAK,EAAEC,MAAM,CAACG;EAAa,gBAC/B7B,KAAA,CAAAwB,aAAA,CAACnB,KAAK,MAAE,CACJ,CACF,CAAC,gBAEPL,KAAA,CAAAwB,aAAA,CAAClB,OAAO;IACNY,SAAS,EAAEA,SAAU;IACrBC,eAAe,EAAEA,eAAgB;IACjCC,WAAW,EAAEA,WAAY;IACzBC,cAAc,EAAEA,cAAe;IAC/BC,aAAa,EAAEA,aAAc;IAC7BN,WAAW,EAAEA,WAAY;IACzBH,YAAY,EAAEA,YAAa;IAC3BiB,WAAW,EAAEP;EAAa,CAC3B,CAEC,CAAC;AAEX,CAAC;AAED,MAAMG,MAAM,GAAGvB,UAAU,CAAC4B,MAAM,CAAC;EAC/B;EACAJ,MAAM,EAAE;IACNK,IAAI,EAAE,CAAC;IACPC,eAAe,EAAExB,SAAS,CAACyB;EAC7B,CAAC;EACD;EACA;EACAN,cAAc,EAAE;IACdI,IAAI,EAAE,CAAC;IACPC,eAAe,EAAExB,SAAS,CAAC0B;EAC7B,CAAC;EACDN,YAAY,EAAE;IACZG,IAAI,EAAE,CAAC;IACPI,cAAc,EAAE,CAAC;IACjBC,cAAc,EAAE5B,SAAS,CAAC6B;EAC5B;AACF,CAAC,CAAC;AAEF,eAAe3B,eAAe"}