expo-modules-core 1.11.13 → 1.12.0

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 (417) hide show
  1. package/CHANGELOG.md +72 -15
  2. package/ExpoModulesCore.podspec +7 -4
  3. package/android/ExpoModulesCorePlugin.gradle +36 -28
  4. package/android/build.gradle +12 -93
  5. package/android/proguard-rules.pro +0 -8
  6. package/android/src/main/cpp/Exceptions.cpp +1 -1
  7. package/android/src/main/cpp/Exceptions.h +1 -1
  8. package/android/src/main/cpp/ExpoModulesHostObject.cpp +7 -6
  9. package/android/src/main/cpp/ExpoModulesHostObject.h +3 -3
  10. package/android/src/main/cpp/JNIInjector.cpp +4 -2
  11. package/android/src/main/cpp/JSIContext.cpp +354 -0
  12. package/android/src/main/cpp/{JSIInteropModuleRegistry.h → JSIContext.h} +90 -9
  13. package/android/src/main/cpp/JavaCallback.cpp +210 -24
  14. package/android/src/main/cpp/JavaCallback.h +42 -7
  15. package/android/src/main/cpp/JavaScriptFunction.cpp +20 -6
  16. package/android/src/main/cpp/JavaScriptFunction.h +4 -1
  17. package/android/src/main/cpp/JavaScriptModuleObject.cpp +118 -82
  18. package/android/src/main/cpp/JavaScriptModuleObject.h +21 -18
  19. package/android/src/main/cpp/JavaScriptObject.cpp +7 -8
  20. package/android/src/main/cpp/JavaScriptObject.h +4 -2
  21. package/android/src/main/cpp/JavaScriptRuntime.cpp +18 -41
  22. package/android/src/main/cpp/JavaScriptRuntime.h +2 -8
  23. package/android/src/main/cpp/JavaScriptTypedArray.cpp +3 -3
  24. package/android/src/main/cpp/JavaScriptTypedArray.h +1 -1
  25. package/android/src/main/cpp/JavaScriptValue.cpp +7 -7
  26. package/android/src/main/cpp/JavaScriptValue.h +1 -1
  27. package/android/src/main/cpp/JavaScriptWeakObject.cpp +4 -4
  28. package/android/src/main/cpp/JavaScriptWeakObject.h +1 -1
  29. package/android/src/main/cpp/MethodMetadata.cpp +44 -120
  30. package/android/src/main/cpp/MethodMetadata.h +5 -11
  31. package/android/src/main/cpp/WeakRuntimeHolder.cpp +3 -3
  32. package/android/src/main/cpp/WeakRuntimeHolder.h +2 -2
  33. package/android/src/main/cpp/types/AnyType.cpp +1 -1
  34. package/android/src/main/cpp/types/AnyType.h +1 -1
  35. package/android/src/main/cpp/types/FrontendConverter.cpp +32 -43
  36. package/android/src/main/cpp/types/FrontendConverter.h +1 -23
  37. package/android/src/main/cpp/types/JNIToJSIConverter.cpp +5 -10
  38. package/android/src/main/cpp/types/JNIToJSIConverter.h +6 -2
  39. package/android/src/main/java/expo/modules/adapters/react/ModuleRegistryAdapter.java +3 -0
  40. package/android/src/main/java/expo/modules/adapters/react/NativeModulesProxy.java +14 -100
  41. package/android/src/main/java/expo/modules/adapters/react/ReactAdapterPackage.java +3 -5
  42. package/android/src/main/java/expo/modules/adapters/react/ReactModuleRegistryProvider.java +6 -22
  43. package/android/src/main/java/expo/modules/adapters/react/apploader/RNHeadlessAppLoader.kt +8 -4
  44. package/android/src/main/java/expo/modules/adapters/react/services/EventEmitterModule.java +0 -1
  45. package/android/src/main/java/expo/modules/adapters/react/services/UIManagerModuleWrapper.java +23 -8
  46. package/android/src/main/java/expo/modules/core/BasePackage.java +0 -10
  47. package/android/src/main/java/expo/modules/core/ModulePriorities.kt +1 -0
  48. package/android/src/main/java/expo/modules/core/ModuleRegistry.java +2 -32
  49. package/android/src/main/java/expo/modules/core/ModuleRegistryProvider.java +0 -18
  50. package/android/src/main/java/expo/modules/core/Promise.java +2 -0
  51. package/android/src/main/java/expo/modules/core/interfaces/Package.java +0 -17
  52. package/android/src/main/java/expo/modules/core/interfaces/ReactActivityHandler.java +0 -9
  53. package/android/src/main/java/expo/modules/core/interfaces/ReactNativeHostHandler.java +24 -31
  54. package/android/src/main/java/expo/modules/core/logging/LogHandler.kt +1 -7
  55. package/android/src/main/java/expo/modules/core/logging/LogHandlers.kt +11 -0
  56. package/android/src/main/java/expo/modules/core/logging/Logger.kt +18 -29
  57. package/android/src/main/java/expo/modules/core/logging/LoggerTimer.kt +11 -0
  58. package/android/src/main/java/expo/modules/core/logging/OSLogHandler.kt +2 -4
  59. package/android/src/main/java/expo/modules/core/logging/PersistentFileLogHandler.kt +1 -3
  60. package/android/src/main/java/expo/modules/interfaces/constants/ConstantsInterface.java +0 -2
  61. package/android/src/main/java/expo/modules/interfaces/permissions/PermissionsStatus.java +1 -1
  62. package/android/src/main/java/expo/modules/kotlin/AppContext.kt +43 -24
  63. package/android/src/main/java/expo/modules/kotlin/ArrayExtenstions.kt +15 -0
  64. package/android/src/main/java/expo/modules/kotlin/CoreLogger.kt +2 -2
  65. package/android/src/main/java/expo/modules/kotlin/DynamicExtenstions.kt +0 -3
  66. package/android/src/main/java/expo/modules/kotlin/ExpoBridgeModule.kt +41 -0
  67. package/android/src/main/java/expo/modules/kotlin/ExpoModulesHelper.kt +1 -2
  68. package/android/src/main/java/expo/modules/kotlin/KPromiseWrapper.kt +1 -2
  69. package/android/src/main/java/expo/modules/kotlin/KotlinInteropModuleRegistry.kt +1 -33
  70. package/android/src/main/java/expo/modules/kotlin/ModuleHolder.kt +7 -6
  71. package/android/src/main/java/expo/modules/kotlin/ModuleRegistry.kt +12 -12
  72. package/android/src/main/java/expo/modules/kotlin/Promise.kt +10 -0
  73. package/android/src/main/java/expo/modules/kotlin/ReactExtensions.kt +14 -0
  74. package/android/src/main/java/expo/modules/kotlin/Utils.kt +4 -1
  75. package/android/src/main/java/expo/modules/kotlin/activityaware/AppCompatActivityAwareHelper.kt +1 -1
  76. package/android/src/main/java/expo/modules/kotlin/activityresult/AppContextActivityResultCaller.kt +1 -1
  77. package/android/src/main/java/expo/modules/kotlin/activityresult/AppContextActivityResultRegistry.kt +6 -6
  78. package/android/src/main/java/expo/modules/kotlin/classcomponent/ClassComponentBuilder.kt +44 -15
  79. package/android/src/main/java/expo/modules/kotlin/defaultmodules/CoreModule.kt +31 -1
  80. package/android/src/main/java/expo/modules/kotlin/defaultmodules/ErrorManagerModule.kt +2 -4
  81. package/android/src/main/java/expo/modules/kotlin/events/KModuleEventEmitterWrapper.kt +11 -4
  82. package/android/src/main/java/expo/modules/kotlin/exception/CodedException.kt +2 -3
  83. package/android/src/main/java/expo/modules/kotlin/functions/AsyncFunctionBuilder.kt +136 -43
  84. package/android/src/main/java/expo/modules/kotlin/functions/AsyncFunctionComponent.kt +71 -2
  85. package/android/src/main/java/expo/modules/kotlin/functions/FunctionBuilder.kt +39 -12
  86. package/android/src/main/java/expo/modules/kotlin/jni/ExpectedType.kt +2 -2
  87. package/android/src/main/java/expo/modules/kotlin/jni/JNIDeallocator.kt +1 -1
  88. package/android/src/main/java/expo/modules/kotlin/jni/{JSIInteropModuleRegistry.kt → JSIContext.kt} +90 -14
  89. package/android/src/main/java/expo/modules/kotlin/jni/JavaCallback.kt +51 -24
  90. package/android/src/main/java/expo/modules/kotlin/jni/JavaScriptFunction.kt +3 -3
  91. package/android/src/main/java/expo/modules/kotlin/jni/JavaScriptModuleObject.kt +4 -1
  92. package/android/src/main/java/expo/modules/kotlin/jni/JavaScriptObject.kt +1 -0
  93. package/android/src/main/java/expo/modules/kotlin/jni/JavaScriptValue.kt +1 -0
  94. package/android/src/main/java/expo/modules/kotlin/jni/PromiseImpl.kt +20 -0
  95. package/android/src/main/java/expo/modules/kotlin/modules/Module.kt +0 -1
  96. package/android/src/main/java/expo/modules/kotlin/modules/ModuleDefinitionBuilder.kt +1 -1
  97. package/android/src/main/java/expo/modules/kotlin/objects/ObjectDefinitionBuilder.kt +164 -65
  98. package/android/src/main/java/expo/modules/kotlin/objects/PropertyComponentBuilder.kt +3 -4
  99. package/android/src/main/java/expo/modules/kotlin/sharedobjects/ClassRegistry.kt +21 -0
  100. package/android/src/main/java/expo/modules/kotlin/sharedobjects/SharedObject.kt +34 -1
  101. package/android/src/main/java/expo/modules/kotlin/sharedobjects/SharedObjectRegistry.kt +23 -8
  102. package/android/src/main/java/expo/modules/kotlin/sharedobjects/SharedRef.kt +7 -1
  103. package/android/src/main/java/expo/modules/kotlin/tracing/ExpoTrace.kt +4 -0
  104. package/android/src/main/java/expo/modules/kotlin/types/AnyType.kt +134 -2
  105. package/android/src/main/java/expo/modules/kotlin/types/EnforceType.kt +60 -0
  106. package/android/src/main/java/expo/modules/kotlin/types/EnumTypeConverter.kt +2 -2
  107. package/android/src/main/java/expo/modules/kotlin/types/TypeConverter.kt +0 -2
  108. package/android/src/main/java/expo/modules/kotlin/types/TypeConverterProvider.kt +3 -27
  109. package/android/src/main/java/expo/modules/kotlin/types/UnitTypeConverter.kt +3 -7
  110. package/android/src/main/java/expo/modules/kotlin/types/io/PathTypeConverter.kt +3 -0
  111. package/android/src/main/java/expo/modules/kotlin/viewevent/ViewEvent.kt +2 -5
  112. package/android/src/main/java/expo/modules/kotlin/views/ViewDefinitionBuilder.kt +137 -48
  113. package/android/src/main/java/expo/modules/kotlin/views/ViewManagerDefinition.kt +2 -5
  114. package/build/EventEmitter.d.ts +2 -2
  115. package/build/EventEmitter.d.ts.map +1 -1
  116. package/build/EventEmitter.js +8 -8
  117. package/build/EventEmitter.js.map +1 -1
  118. package/build/NativeModule.d.ts +4 -0
  119. package/build/NativeModule.d.ts.map +1 -0
  120. package/build/NativeModule.js +4 -0
  121. package/build/NativeModule.js.map +1 -0
  122. package/build/NativeModulesProxy.d.ts.map +1 -1
  123. package/build/NativeModulesProxy.native.d.ts.map +1 -1
  124. package/build/NativeModulesProxy.native.js +4 -0
  125. package/build/NativeModulesProxy.native.js.map +1 -1
  126. package/build/NativeModulesProxy.types.d.ts +2 -2
  127. package/build/NativeModulesProxy.types.d.ts.map +1 -1
  128. package/build/NativeModulesProxy.types.js.map +1 -1
  129. package/build/NativeViewManagerAdapter.native.d.ts.map +1 -1
  130. package/build/NativeViewManagerAdapter.native.js +20 -1
  131. package/build/NativeViewManagerAdapter.native.js.map +1 -1
  132. package/build/PermissionsHook.d.ts.map +1 -1
  133. package/build/PermissionsHook.js +2 -0
  134. package/build/PermissionsHook.js.map +1 -1
  135. package/build/Platform.d.ts.map +1 -1
  136. package/build/Refs.d.ts +8 -0
  137. package/build/Refs.d.ts.map +1 -0
  138. package/build/Refs.js +10 -0
  139. package/build/Refs.js.map +1 -0
  140. package/build/SharedObject.d.ts +4 -0
  141. package/build/SharedObject.d.ts.map +1 -0
  142. package/build/SharedObject.js +4 -0
  143. package/build/SharedObject.js.map +1 -0
  144. package/build/createWebModule.d.ts +2 -0
  145. package/build/createWebModule.d.ts.map +1 -0
  146. package/build/createWebModule.js +6 -0
  147. package/build/createWebModule.js.map +1 -0
  148. package/build/createWebModule.web.d.ts +2 -0
  149. package/build/createWebModule.web.d.ts.map +1 -0
  150. package/build/createWebModule.web.js +6 -0
  151. package/build/createWebModule.web.js.map +1 -0
  152. package/build/ensureNativeModulesAreInstalled.d.ts +6 -0
  153. package/build/ensureNativeModulesAreInstalled.d.ts.map +1 -0
  154. package/build/ensureNativeModulesAreInstalled.js +26 -0
  155. package/build/ensureNativeModulesAreInstalled.js.map +1 -0
  156. package/build/environment/browser.js.map +1 -1
  157. package/build/hooks/useReleasingSharedObject.d.ts +7 -0
  158. package/build/hooks/useReleasingSharedObject.d.ts.map +1 -0
  159. package/build/hooks/useReleasingSharedObject.js +40 -0
  160. package/build/hooks/useReleasingSharedObject.js.map +1 -0
  161. package/build/index.d.ts +8 -1
  162. package/build/index.d.ts.map +1 -1
  163. package/build/index.js +8 -0
  164. package/build/index.js.map +1 -1
  165. package/build/requireNativeModule.d.ts +0 -17
  166. package/build/requireNativeModule.d.ts.map +1 -1
  167. package/build/requireNativeModule.js +2 -23
  168. package/build/requireNativeModule.js.map +1 -1
  169. package/build/sweet/setUpErrorManager.fx.js.map +1 -1
  170. package/build/ts-declarations/EventEmitter.d.ts +50 -0
  171. package/build/ts-declarations/EventEmitter.d.ts.map +1 -0
  172. package/build/ts-declarations/EventEmitter.js +2 -0
  173. package/build/ts-declarations/EventEmitter.js.map +1 -0
  174. package/build/ts-declarations/NativeModule.d.ts +14 -0
  175. package/build/ts-declarations/NativeModule.d.ts.map +1 -0
  176. package/build/ts-declarations/NativeModule.js +2 -0
  177. package/build/ts-declarations/NativeModule.js.map +1 -0
  178. package/build/ts-declarations/SharedObject.d.ts +14 -0
  179. package/build/ts-declarations/SharedObject.d.ts.map +1 -0
  180. package/build/ts-declarations/SharedObject.js +2 -0
  181. package/build/ts-declarations/SharedObject.js.map +1 -0
  182. package/build/ts-declarations/global.d.ts +49 -0
  183. package/build/ts-declarations/global.d.ts.map +1 -0
  184. package/build/ts-declarations/global.js +2 -0
  185. package/build/ts-declarations/global.js.map +1 -0
  186. package/build/uuid/lib/bytesToUuid.js.map +1 -1
  187. package/build/uuid/lib/sha1.js.map +1 -1
  188. package/build/uuid/lib/v35.js.map +1 -1
  189. package/build/uuid/uuid.js.map +1 -1
  190. package/build/uuid/uuid.web.js.map +1 -1
  191. package/build/web/CoreModule.d.ts +17 -0
  192. package/build/web/CoreModule.d.ts.map +1 -0
  193. package/build/web/CoreModule.js +51 -0
  194. package/build/web/CoreModule.js.map +1 -0
  195. package/build/web/index.d.ts +1 -0
  196. package/build/web/index.d.ts.map +1 -0
  197. package/build/web/index.js +1 -0
  198. package/build/web/index.js.map +1 -0
  199. package/build/web/index.web.d.ts +2 -0
  200. package/build/web/index.web.d.ts.map +1 -0
  201. package/build/web/index.web.js +2 -0
  202. package/build/web/index.web.js.map +1 -0
  203. package/common/cpp/BridgelessJSCallInvoker.h +41 -0
  204. package/common/cpp/EventEmitter.cpp +294 -0
  205. package/common/cpp/EventEmitter.h +111 -0
  206. package/common/cpp/JSIUtils.cpp +116 -11
  207. package/common/cpp/JSIUtils.h +54 -7
  208. package/common/cpp/LazyObject.cpp +15 -3
  209. package/common/cpp/LazyObject.h +13 -0
  210. package/common/cpp/NativeModule.cpp +16 -0
  211. package/common/cpp/NativeModule.h +34 -0
  212. package/common/cpp/ObjectDeallocator.cpp +3 -5
  213. package/common/cpp/ObjectDeallocator.h +2 -3
  214. package/common/cpp/SharedObject.cpp +69 -0
  215. package/common/cpp/SharedObject.h +59 -0
  216. package/common/cpp/TestingSyncJSCallInvoker.h +44 -0
  217. package/ios/Api/Builders/ClassComponentBuilder.swift +34 -0
  218. package/ios/{Objects → Api/Builders}/ObjectDefinitionBuilder.swift +3 -3
  219. package/ios/Api/Builders/ViewDefinitionBuilder.swift +53 -0
  220. package/ios/Api/Factories/AsyncFunctionFactories.swift +173 -0
  221. package/ios/{Classes/ClassComponentFactories.swift → Api/Factories/ClassFactories.swift} +19 -19
  222. package/ios/{Functions/ConcurrentFunctionDefinition.swift → Api/Factories/ConcurrentFunctionFactories.swift} +0 -113
  223. package/ios/{Modules/ModuleDefinitionComponents.swift → Api/Factories/EventListenersFactories.swift} +0 -20
  224. package/ios/Api/Factories/ModuleFactories.swift +6 -0
  225. package/ios/{Objects/ObjectDefinitionComponents.swift → Api/Factories/ObjectFactories.swift} +5 -5
  226. package/ios/Api/Factories/PropertyFactories.swift +50 -0
  227. package/ios/Api/Factories/SyncFunctionFactories.swift +173 -0
  228. package/ios/{Views/ViewManagerDefinitionComponents.swift → Api/Factories/ViewFactories.swift} +7 -6
  229. package/ios/AppDelegates/EXAppDelegateWrapper.h +0 -21
  230. package/ios/AppDelegates/EXAppDelegateWrapper.mm +37 -29
  231. package/ios/{AppContext.swift → Core/AppContext.swift} +34 -11
  232. package/ios/Core/Classes/AnyClassDefinitionElement.swift +37 -0
  233. package/ios/{Classes/ClassComponent.swift → Core/Classes/ClassDefinition.swift} +10 -10
  234. package/ios/{Conversions.swift → Core/Conversions.swift} +1 -1
  235. package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicSharedObjectType.swift +3 -3
  236. package/ios/Core/Events/EventObservingDefinition.swift +79 -0
  237. package/ios/Core/Events/LegacyEventEmitterCompat.swift +32 -0
  238. package/ios/Core/ExpoBridgeModule.h +18 -0
  239. package/ios/Core/ExpoBridgeModule.mm +88 -0
  240. package/ios/Core/ExpoRuntime.swift +6 -0
  241. package/ios/{Functions/AnyFunction.swift → Core/Functions/AnyFunctionDefinition.swift} +9 -2
  242. package/ios/Core/Functions/AsyncFunctionDefinition.swift +150 -0
  243. package/ios/Core/Functions/ConcurrentFunctionDefinition.swift +112 -0
  244. package/ios/Core/Functions/SyncFunctionDefinition.swift +108 -0
  245. package/ios/{JavaScriptUtils.swift → Core/JavaScriptUtils.swift} +4 -4
  246. package/ios/{Logging → Core/Logging}/LogHandlers.swift +12 -5
  247. package/ios/{Logging → Core/Logging}/Logger.swift +14 -92
  248. package/ios/Core/Logging/LoggerTimer.swift +22 -0
  249. package/ios/{ModuleHolder.swift → Core/ModuleHolder.swift} +2 -10
  250. package/ios/Core/Modules/CoreModule.swift +43 -0
  251. package/ios/{Modules → Core/Modules}/ModuleDefinition.swift +20 -12
  252. package/ios/{Modules → Core/Modules}/ModuleDefinitionBuilder.swift +1 -3
  253. package/ios/{Objects → Core/Objects}/ObjectDefinition.swift +9 -9
  254. package/ios/{Objects/PropertyComponent.swift → Core/Objects/PropertyDefinition.swift} +11 -64
  255. package/ios/Core/Protocols/AnyDefinition.swift +4 -0
  256. package/ios/Core/Protocols/AnyExpoView.swift +7 -0
  257. package/ios/Core/Protocols/AnyModule.swift +17 -0
  258. package/ios/Core/Protocols/AnyViewDefinition.swift +34 -0
  259. package/ios/Core/SharedObjects/SharedObject.swift +80 -0
  260. package/ios/{SharedObjects → Core/SharedObjects}/SharedObjectRegistry.swift +45 -19
  261. package/ios/{Views → Core/Views}/AnyViewProp.swift +1 -1
  262. package/ios/{Views → Core/Views}/ComponentData.swift +7 -7
  263. package/ios/{Views → Core/Views}/ExpoView.swift +1 -1
  264. package/ios/Core/Views/ViewDefinition.swift +97 -0
  265. package/ios/{Views → Core/Views}/ViewLifecycleMethod.swift +1 -1
  266. package/ios/{Views → Core/Views}/ViewModuleWrapper.swift +1 -1
  267. package/ios/Fabric/ExpoFabricView.swift +5 -6
  268. package/ios/FileSystemUtilities/FileSystemLegacyUtilities.swift +111 -0
  269. package/ios/JSI/EXJSIInstaller.h +28 -0
  270. package/ios/JSI/EXJSIInstaller.mm +54 -10
  271. package/ios/JSI/EXJSIUtils.h +15 -11
  272. package/ios/JSI/EXJSIUtils.mm +21 -49
  273. package/ios/JSI/EXJavaScriptObject.mm +2 -2
  274. package/ios/JSI/EXJavaScriptRuntime.h +15 -0
  275. package/ios/JSI/EXJavaScriptRuntime.mm +53 -26
  276. package/ios/JSI/EXSharedObjectUtils.h +15 -0
  277. package/ios/JSI/EXSharedObjectUtils.mm +18 -0
  278. package/ios/JSI/JavaScriptRuntime.swift +16 -0
  279. package/ios/Legacy/ModuleRegistry/EXModuleRegistry.m +1 -0
  280. package/ios/Legacy/ModuleRegistryProvider/EXModuleRegistryProvider.m +5 -0
  281. package/ios/Legacy/NativeModulesProxy/EXNativeModulesProxy.mm +5 -4
  282. package/ios/Legacy/Services/EXReactNativeAdapter.mm +34 -28
  283. package/ios/ReactDelegates/EXReactDelegateWrapper.h +4 -12
  284. package/ios/ReactDelegates/EXReactDelegateWrapper.mm +41 -0
  285. package/ios/ReactDelegates/EXReactRootViewFactory.h +38 -0
  286. package/ios/ReactDelegates/EXReactRootViewFactory.mm +54 -0
  287. package/ios/ReactDelegates/ExpoReactDelegate.swift +22 -15
  288. package/ios/ReactDelegates/ExpoReactDelegateHandler.swift +10 -21
  289. package/ios/ReactDelegates/RCTAppDelegate+Recreate.h +28 -0
  290. package/ios/ReactDelegates/RCTAppDelegate+Recreate.mm +47 -0
  291. package/ios/Tests/{ClassComponentSpec.swift → ClassDefinitionSpec.swift} +6 -6
  292. package/ios/Tests/ConvertiblesSpec.swift +6 -1
  293. package/ios/Tests/CoreModuleSpec.swift +0 -4
  294. package/ios/Tests/DynamicTypeSpec.swift +1 -1
  295. package/ios/Tests/EventEmitterSpec.swift +274 -0
  296. package/ios/Tests/ExceptionsSpec.swift +114 -54
  297. package/ios/Tests/ExpoModulesSpec.swift +4 -3
  298. package/ios/Tests/LoggerSpec.swift +80 -0
  299. package/ios/Tests/{PropertyComponentSpec.swift → PropertyDefinitionSpec.swift} +1 -1
  300. package/ios/Tests/SharedObjectRegistrySpec.swift +34 -28
  301. package/ios/Tests/SharedObjectSpec.swift +141 -0
  302. package/ios/Tests/ViewDefinitionSpec.swift +1 -1
  303. package/package.json +2 -2
  304. package/src/EventEmitter.ts +15 -18
  305. package/src/NativeModule.ts +6 -0
  306. package/src/NativeModulesProxy.native.ts +5 -0
  307. package/src/NativeModulesProxy.types.ts +2 -2
  308. package/src/NativeViewManagerAdapter.native.tsx +25 -1
  309. package/src/PermissionsHook.ts +4 -0
  310. package/src/Refs.ts +10 -0
  311. package/src/SharedObject.ts +6 -0
  312. package/src/createWebModule.ts +5 -0
  313. package/src/createWebModule.web.ts +6 -0
  314. package/src/ensureNativeModulesAreInstalled.ts +24 -0
  315. package/src/hooks/useReleasingSharedObject.ts +51 -0
  316. package/src/index.ts +13 -0
  317. package/src/requireNativeModule.ts +2 -51
  318. package/src/ts-declarations/EventEmitter.ts +65 -0
  319. package/src/ts-declarations/ExpoModules.d.ts +0 -5
  320. package/src/ts-declarations/NativeModule.ts +18 -0
  321. package/src/ts-declarations/SharedObject.ts +16 -0
  322. package/src/ts-declarations/global.ts +60 -0
  323. package/src/web/CoreModule.ts +83 -0
  324. package/src/web/index.ts +0 -0
  325. package/src/web/index.web.ts +1 -0
  326. package/android/src/main/cpp/JSIInteropModuleRegistry.cpp +0 -196
  327. package/android/src/main/java/expo/modules/adapters/react/ArgumentsHelper.java +0 -48
  328. package/android/src/main/java/expo/modules/adapters/react/PromiseWrapper.java +0 -38
  329. package/android/src/main/java/expo/modules/adapters/react/services/CookieManagerModule.java +0 -53
  330. package/android/src/main/java/expo/modules/core/ArgumentsHelper.java +0 -44
  331. package/android/src/main/java/expo/modules/core/ExportedModule.java +0 -173
  332. package/android/src/main/java/expo/modules/core/ModuleRegistryDelegate.kt +0 -12
  333. package/android/src/main/java/expo/modules/core/ViewManager.java +0 -9
  334. package/android/src/main/java/expo/modules/core/interfaces/ExpoMethod.java +0 -12
  335. package/android/src/main/java/expo/modules/core/interfaces/ExpoProp.java +0 -10
  336. package/android/src/main/java/expo/modules/core/logging/LoggerOptions.kt +0 -29
  337. package/android-annotation/build.gradle +0 -48
  338. package/android-annotation/src/main/java/expo/modules/annotation/Config.kt +0 -7
  339. package/android-annotation/src/main/java/expo/modules/annotation/ConverterBinder.kt +0 -7
  340. package/android-annotation-processor/build.gradle +0 -54
  341. package/android-annotation-processor/src/main/java/expo/modules/annotationprocessor/ExpoSymbolProcessor.kt +0 -175
  342. package/android-annotation-processor/src/main/java/expo/modules/annotationprocessor/ExpoSymbolProcessorProvider.kt +0 -10
  343. package/android-annotation-processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider +0 -1
  344. package/ios/Classes/ClassComponentElement.swift +0 -37
  345. package/ios/Classes/ClassComponentElementsBuilder.swift +0 -34
  346. package/ios/ExpoBridgeModule.m +0 -7
  347. package/ios/ExpoBridgeModule.swift +0 -108
  348. package/ios/ExpoRuntime.swift +0 -28
  349. package/ios/Functions/AsyncFunctionComponent.swift +0 -327
  350. package/ios/Functions/SyncFunctionComponent.swift +0 -282
  351. package/ios/Interfaces/Font/EXFontManagerInterface.h +0 -9
  352. package/ios/Interfaces/Font/EXFontProcessorInterface.h +0 -15
  353. package/ios/Interfaces/Font/EXFontScalerInterface.h +0 -9
  354. package/ios/Interfaces/Font/EXFontScalersManagerInterface.h +0 -9
  355. package/ios/Legacy/Services/EXReactFontManager.h +0 -6
  356. package/ios/Legacy/Services/EXReactFontManager.m +0 -130
  357. package/ios/Modules/AnyModule.swift +0 -53
  358. package/ios/Modules/CoreModule.swift +0 -17
  359. package/ios/ReactDelegates/EXRCTBridgeDelegateInterceptor.h +0 -16
  360. package/ios/ReactDelegates/EXRCTBridgeDelegateInterceptor.m +0 -49
  361. package/ios/ReactDelegates/EXReactCompatibleHelpers.h +0 -15
  362. package/ios/ReactDelegates/EXReactCompatibleHelpers.m +0 -25
  363. package/ios/ReactDelegates/EXReactDelegateWrapper.m +0 -53
  364. package/ios/SharedObjects/SharedObject.swift +0 -31
  365. package/ios/Views/ViewDefinition.swift +0 -114
  366. package/ios/Views/ViewFactory.swift +0 -16
  367. package/ios/Views/ViewManagerDefinition.swift +0 -77
  368. package/ios/Views/ViewManagerDefinitionBuilder.swift +0 -11
  369. /package/ios/{AppContextConfig.swift → Core/AppContextConfig.swift} +0 -0
  370. /package/ios/{Arguments → Core/Arguments}/AnyArgument.swift +0 -0
  371. /package/ios/{Arguments → Core/Arguments}/Convertible.swift +0 -0
  372. /package/ios/{Arguments → Core/Arguments}/Convertibles.swift +0 -0
  373. /package/ios/{Arguments → Core/Arguments}/Enumerable.swift +0 -0
  374. /package/ios/{Classes → Core/Classes}/ClassRegistry.swift +0 -0
  375. /package/ios/{Convertibles → Core/Convertibles}/Convertibles+Color.swift +0 -0
  376. /package/ios/{Convertibles → Core/Convertibles}/Either.swift +0 -0
  377. /package/ios/{DynamicTypes → Core/DynamicTypes}/AnyDynamicType.swift +0 -0
  378. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicArrayType.swift +0 -0
  379. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicConvertibleType.swift +0 -0
  380. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicDataType.swift +0 -0
  381. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicDictionaryType.swift +0 -0
  382. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicEnumType.swift +0 -0
  383. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicJavaScriptType.swift +0 -0
  384. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicOptionalType.swift +0 -0
  385. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicRawType.swift +0 -0
  386. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicType.swift +0 -0
  387. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicTypedArrayType.swift +0 -0
  388. /package/ios/{DynamicTypes → Core/DynamicTypes}/DynamicViewType.swift +0 -0
  389. /package/ios/{EventListener.swift → Core/EventListener.swift} +0 -0
  390. /package/ios/{Events → Core/Events}/Callback.swift +0 -0
  391. /package/ios/{Events → Core/Events}/EventDispatcher.swift +0 -0
  392. /package/ios/{Exceptions → Core/Exceptions}/ChainableException.swift +0 -0
  393. /package/ios/{Exceptions → Core/Exceptions}/CodedError.swift +0 -0
  394. /package/ios/{Exceptions → Core/Exceptions}/CommonExceptions.swift +0 -0
  395. /package/ios/{Exceptions → Core/Exceptions}/Exception.swift +0 -0
  396. /package/ios/{Exceptions → Core/Exceptions}/ExceptionOrigin.swift +0 -0
  397. /package/ios/{Exceptions → Core/Exceptions}/GenericException.swift +0 -0
  398. /package/ios/{Exceptions → Core/Exceptions}/UnexpectedException.swift +0 -0
  399. /package/ios/{JavaScriptFunction.swift → Core/JavaScriptFunction.swift} +0 -0
  400. /package/ios/{Logging → Core/Logging}/LogType.swift +0 -0
  401. /package/ios/{Logging → Core/Logging}/PersistentFileLog.swift +0 -0
  402. /package/ios/{ModuleRegistry.swift → Core/ModuleRegistry.swift} +0 -0
  403. /package/ios/{Modules → Core/Modules}/Module.swift +0 -0
  404. /package/ios/{ModulesProvider.swift → Core/ModulesProvider.swift} +0 -0
  405. /package/ios/{Objects → Core/Objects}/JavaScriptObjectBuilder.swift +0 -0
  406. /package/ios/{Promise.swift → Core/Promise.swift} +0 -0
  407. /package/ios/{Records → Core/Records}/AnyField.swift +0 -0
  408. /package/ios/{Records → Core/Records}/Field.swift +0 -0
  409. /package/ios/{Records → Core/Records}/FieldExtensions.swift +0 -0
  410. /package/ios/{Records → Core/Records}/FieldOption.swift +0 -0
  411. /package/ios/{Records → Core/Records}/Record.swift +0 -0
  412. /package/ios/{SharedObjects → Core/SharedObjects}/SharedRef.swift +0 -0
  413. /package/ios/{TypedArrays → Core/TypedArrays}/AnyTypedArray.swift +0 -0
  414. /package/ios/{TypedArrays → Core/TypedArrays}/ConcreteTypedArrays.swift +0 -0
  415. /package/ios/{TypedArrays → Core/TypedArrays}/GenericTypedArray.swift +0 -0
  416. /package/ios/{TypedArrays → Core/TypedArrays}/TypedArray.swift +0 -0
  417. /package/ios/{Views → Core/Views}/ConcreteViewProp.swift +0 -0
package/CHANGELOG.md CHANGED
@@ -10,55 +10,112 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 1.11.13 — 2024-04-08
13
+ ## 1.12.0 — 2024-04-18
14
14
 
15
- ### 🐛 Bug fixes
16
-
17
- - Fixed SharedRef class names are obfuscated when R8 is enabled. ([#27965](https://github.com/expo/expo/pull/27965) by [@kudo](https://github.com/kudo))
15
+ ### 🛠 Breaking changes
18
16
 
19
- ## 1.11.12 2024-03-13
17
+ - Removed `ReactNativeHostHandler.onRegisterJSIModules` interface. ([#26357](https://github.com/expo/expo/pull/26357) by [@kudo](https://github.com/kudo))
18
+ - Dropped supports for React Native 0.73 and lower. ([#27601](https://github.com/expo/expo/pull/27601), [#27689](https://github.com/expo/expo/pull/27689), [#27629](https://github.com/expo/expo/pull/27629) by [@kudo](https://github.com/kudo))
20
19
 
21
20
  ### 🎉 New features
22
21
 
23
- - Add iOS support for `PlatformColor` and `DynamicColorIOS` color props. ([#26724](https://github.com/expo/expo/pull/26724) by [@dlindenkreuz](https://github.com/dlindenkreuz))
22
+ - [Web] Add `createWebModule` function to wrap web functionality with the NativeModule class. ([#27739](https://github.com/expo/expo/pull/27739) by [@aleqsio](https://github.com/aleqsio))
23
+ - [Web] Add web implementations of event emitter and stubs of shared objects and native modules. ([#27595](https://github.com/expo/expo/pull/27595) by [@aleqsio](https://github.com/aleqsio))
24
+ - Mark React client components with "use client" directives. ([#27300](https://github.com/expo/expo/pull/27300) by [@EvanBacon](https://github.com/EvanBacon))
25
+ - [iOS] Added basic filesystem module to decouple expo-file-system from other packages. ([#27069](https://github.com/expo/expo/pull/27069) by [@aleqsio](https://github.com/aleqsio))
26
+ - [Android] Added syntactic sugar for defining a prop group. ([#27004](https://github.com/expo/expo/pull/27004) by [@lukmccall](https://github.com/lukmccall))
27
+ - Introduced a base class for all shared objects (`expo.SharedObject`) with a simple mechanism to release native pointer from JS. ([#27038](https://github.com/expo/expo/pull/27038) by [@tsapeta](https://github.com/tsapeta) & [#27331](https://github.com/expo/expo/pull/27331) by [@lukmccall](https://github.com/lukmccall))
28
+ - [iOS] Added native implementation of the JS EventEmitter. ([#27092](https://github.com/expo/expo/pull/27092) by [@tsapeta](https://github.com/tsapeta))
29
+ - [iOS] Allow for the export of views that conform to `AnyExpoView` ([#27284](https://github.com/expo/expo/pull/27284) by [@dominicstop](https://github.com/dominicstop))
30
+ - [iOS] Added support for bridgeless mode in React Native 0.74 ([#27242](https://github.com/expo/expo/pull/27242), [#27289](https://github.com/expo/expo/pull/27289), [#27531](https://github.com/expo/expo/pull/27531) by [@tsapeta](https://github.com/tsapeta))
31
+ - [iOS] Implemented sending events from native shared objects. ([#27333](https://github.com/expo/expo/pull/27333) by [@tsapeta](https://github.com/tsapeta))
32
+ - Added support for `startObserving` and `stopObserving` in the new `EventEmitter` class. ([#27393](https://github.com/expo/expo/pull/27393) by [@tsapeta](https://github.com/tsapeta))
33
+ - [Android] Implemented sending events from native shared objects. ([#27523](https://github.com/expo/expo/pull/27523) by [@lukmccall](https://github.com/lukmccall))
34
+ - JS object of the native module is now an instance of the `NativeModule` class that inherits from `EventEmitter`. ([#27510](https://github.com/expo/expo/pull/27510) by [@tsapeta](https://github.com/tsapeta))
35
+ - [iOS] Exposed a function on the runtime to schedule some work with synchronized access to JS. ([#27567](https://github.com/expo/expo/pull/27567) by [@tsapeta](https://github.com/tsapeta))
36
+ - [iOS] `OnStartObserving` and `OnStopObserving` can now be attached to a specific event. ([#27766](https://github.com/expo/expo/pull/27766) by [@tsapeta](https://github.com/tsapeta))
37
+ - [iOS] Provide Exception.code to JavaScript (as Error.code) for all types of functions. ([#27960](https://github.com/expo/expo/pull/27960) by [@cltnschlosser](https://github.com/cltnschlosser))
38
+
39
+ ### 🐛 Bug fixes
40
+
41
+ - Fixed breaking changes from React-Native 0.74. ([#26357](https://github.com/expo/expo/pull/26357) by [@kudo](https://github.com/kudo))
42
+ - Fixed breaking changes from React-Native 0.74. ([#26357](https://github.com/expo/expo/pull/26357), [#26587](https://github.com/expo/expo/pull/26587) by [@kudo](https://github.com/kudo))
43
+ - [Android] Unit converter now ignores nullability. It will always return unit regardless of whether the input value is null or not. ([#27591](https://github.com/expo/expo/pull/27591) by [@lukmccall](https://github.com/lukmccall))
44
+ - Fixed `RCTHost` is not retained on iOS bridgeless mode. ([#27715](https://github.com/expo/expo/pull/27715) by [@kudo](https://github.com/kudo))
45
+ - Fixed errors on Android when running on bridgeless mode. ([#27725](https://github.com/expo/expo/pull/27725) by [@kudo](https://github.com/kudo))
46
+ - Fixed breaking changes from React Native 0.75. ([#27773](https://github.com/expo/expo/pull/27773) by [@kudo](https://github.com/kudo))
47
+ - Fixed crash from reloading on iOS and bridgeless mode. ([#27928](https://github.com/expo/expo/pull/27928) by [@kudo](https://github.com/kudo))
48
+ - Fixed SharedRef class names are obfuscated when R8 is enabled. ([#27965](https://github.com/expo/expo/pull/27965) by [@kudo](https://github.com/kudo))
49
+ - [iOS] Fix `recreateRootViewWithBundleURL` parameters. ([#27989](https://github.com/expo/expo/pull/27989) by [@gabrieldonadel](https://github.com/gabrieldonadel))
50
+ - Fixed `ExpoBridgeModule.installModules()` is broken on Android and bridgeless mode. ([#28065](https://github.com/expo/expo/pull/28065) by [@kudo](https://github.com/kudo))
51
+ - [Android] Fixed segfaults in `expo::MethodMetadata::convertJSIArgsToJNI`. ([#28163](https://github.com/expo/expo/pull/28163) by [@lukmccall](https://github.com/lukmccall))
52
+ - Fixed random `TypeError: Cannot read property 'NativeModule' of undefined` exceptions on Android. ([#28200](https://github.com/expo/expo/pull/28200) by [@kudo](https://github.com/kudo))
53
+ - Fixed white screen flickering when using expo-updates with longer `fallbackToCacheTimeout`. ([#28227](https://github.com/expo/expo/pull/28227) by [@kudo](https://github.com/kudo))
54
+ - [iOS] Fixed random crashes when reloads and `EXJavaScriptObject` accesses to dangling pointers. ([#28262](https://github.com/expo/expo/pull/28262) by [@kudo](https://github.com/kudo))
55
+
56
+ ### 💡 Others
24
57
 
25
- ## 1.11.11 2024-03-11
58
+ - Deprecated `expo.modules.core.Promise`. ([#27471](https://github.com/expo/expo/pull/27471) by [@aleqsio](https://github.com/aleqsio))
59
+ - Removed deprecated `global.ExpoModules`. ([#26027](https://github.com/expo/expo/pull/26027) by [@tsapeta](https://github.com/tsapeta))
60
+ - Remove most of Constants.appOwnership. ([#26313](https://github.com/expo/expo/pull/26313) by [@wschurman](https://github.com/wschurman))
61
+ - Added an alternative way of installing the JSI bindings. ([#26691](https://github.com/expo/expo/pull/26691) by [@lukmccall](https://github.com/lukmccall))
62
+ - `ObjectDeallocator` is now a native state instead of a host object. ([#26906](https://github.com/expo/expo/pull/26906) by [@tsapeta](https://github.com/tsapeta))
63
+ - Moved away from `SharedObjectRegistry` being a singleton. ([#27032](https://github.com/expo/expo/pull/27032) by [@tsapeta](https://github.com/tsapeta))
64
+ - Moved and added more JSI utils to the common C++ codebase. ([#27045](https://github.com/expo/expo/pull/27045) by [@tsapeta](https://github.com/tsapeta))
65
+ - Introduce `EXCreateReactBindingRootView` to create correct React Native setup for New Architecture mode. ([#27216](https://github.com/expo/expo/pull/27216) by [@kudo](https://github.com/kudo))
66
+ - Set bridge on `AppContext` in `ExpoBridgeModule`. ([#27378](https://github.com/expo/expo/pull/27378) by [@alanjhughes](https://github.com/alanjhughes))
67
+ - Added TypeScript declarations and documentation for global JSI bindings. ([#27465](https://github.com/expo/expo/pull/27465) by [@tsapeta](https://github.com/tsapeta))
68
+ - [iOS] Added bridgeless support on ExpoReactDelegate. ([#27601](https://github.com/expo/expo/pull/27601), [#27689](https://github.com/expo/expo/pull/27689) by [@kudo](https://github.com/kudo))
69
+ - [Android] Added bridgeless support on ReactNativeHostHandler. ([#27629](https://github.com/expo/expo/pull/27629) by [@kudo](https://github.com/kudo))
70
+ - Refactored out `EXReactRootViewFactory.createDefaultReactRootView:` to `RCTAppDelegate.recreateRootViewWithBundleURL:` category. ([#27945](https://github.com/expo/expo/pull/27945) by [@kudo](https://github.com/kudo))
71
+ - Added `ReactNativeHostHandler.onReactInstanceException()` for client to listen for exceptions on Android. ([#27815](https://github.com/expo/expo/pull/27815) by [@kudo](https://github.com/kudo))
72
+ - Removed the legacy interfaces for font processors as they are no longer used by `expo-font` and nothing else depends on them. ([#26380](https://github.com/expo/expo/pull/26380) by [@tsapeta](https://github.com/tsapeta))
73
+ - Removed deprecated backward compatible Gradle settings. ([#28083](https://github.com/expo/expo/pull/28083) by [@kudo](https://github.com/kudo))
74
+ - Bumped Kotlin version to 1.9.23. ([#28088](https://github.com/expo/expo/pull/28088) by [@kudo](https://github.com/kudo))
75
+ - Introduced `onDidCreateDevSupportManager` handler to support error recovery from expo-updates. ([#28177](https://github.com/expo/expo/pull/28177) by [@kudo](https://github.com/kudo))
76
+ - Dropped support for custom type converters on Android. ([#28252](https://github.com/expo/expo/pull/28252) by [@lukmccall](https://github.com/lukmccall))
77
+ - Introduced `ExpoReactDelegateHandler.bundleURL` for clients to override newer bundleURL. ([#28256](https://github.com/expo/expo/pull/28256) by [@kudo](https://github.com/kudo))
78
+
79
+ ## 1.11.11 - 2024-03-11
26
80
 
27
81
  ### 🐛 Bug fixes
28
82
 
29
83
  - [Android] Ensured that `onCreate` before `OnActivityEntersForeground` event. ([#26944](https://github.com/expo/expo/pull/26944) by [@lukmccall](https://github.com/lukmccall))
30
84
  - [Android] Fixed activity contract registration after host destruction. ([#26881](https://github.com/expo/expo/pull/26881) by [@lukmccall](https://github.com/lukmccall))
31
85
 
32
- ## 1.11.10 2024-03-06
86
+ ## 1.11.10 - 2024-03-06
33
87
 
34
88
  ### 🐛 Bug fixes
35
89
 
36
90
  - [Android] Thrown an exception when nested types can't be converted instead of crashing the app. ([#27449](https://github.com/expo/expo/pull/27449) by [@lukmccall](https://github.com/lukmccall))
37
91
 
38
- ## 1.11.9 2024-02-16
92
+ ## 1.11.9 - 2024-02-16
39
93
 
40
94
  ### 🎉 New features
41
95
 
42
96
  - Add timer capability to Logger. ([#26454](https://github.com/expo/expo/pull/26454), [#26477](https://github.com/expo/expo/pull/26477) by [@wschurman](https://github.com/wschurman))
97
+ - Add iOS support for `PlatformColor` and `DynamicColorIOS` color props. ([#26724](https://github.com/expo/expo/pull/26724) by [@dlindenkreuz](https://github.com/dlindenkreuz))
98
+ - `BarCodeScannerResult` interface now declares an additional `raw` field corresponding to the barcode value as it was encoded in the barcode without parsing. Will always be undefined on iOS. ([#25391](https://github.com/expo/expo/pull/25391) by [@ajacquierbret](https://github.com/ajacquierbret))
43
99
 
44
- ## 1.11.8 2024-01-23
100
+ ## 1.11.8 - 2024-01-23
45
101
 
46
102
  ### 🐛 Bug fixes
47
103
 
48
104
  - Fix proguard rules so `Serializable` types are not obfuscated. ([#26545](https://github.com/expo/expo/pull/26545) by [@alanjhughes](https://github.com/alanjhughes))
49
105
 
50
- ## 1.11.7 2024-01-18
106
+ ## 1.11.7 - 2024-01-18
51
107
 
52
108
  _This version does not introduce any user-facing changes._
53
109
 
54
- ## 1.11.6 2024-01-12
110
+ ## 1.11.6 - 2024-01-12
55
111
 
56
112
  _This version does not introduce any user-facing changes._
57
113
 
58
- ## 1.11.5 2024-01-10
114
+ ## 1.11.5 - 2024-01-10
59
115
 
60
116
  ### 🎉 New features
61
117
 
118
+ - Added support for returning shared refs from async functions. ([#26341](https://github.com/expo/expo/pull/26341) by [@aleqsio](https://github.com/aleqsio))
62
119
  - Added support for macOS platform. ([#26186](https://github.com/expo/expo/pull/26186) by [@tsapeta](https://github.com/tsapeta))
63
120
  - Add `Date` type converter. ([#26148](https://github.com/expo/expo/pull/26148) by [@alanjhughes](https://github.com/alanjhughes))
64
121
 
@@ -70,11 +127,11 @@ _This version does not introduce any user-facing changes._
70
127
 
71
128
  - Replace deprecated `com.facebook.react:react-native:+` Android dependency with `com.facebook.react:react-android`. ([#26237](https://github.com/expo/expo/pull/26237) by [@kudo](https://github.com/kudo))
72
129
 
73
- ## 1.11.4 2023-12-21
130
+ ## 1.11.4 - 2023-12-21
74
131
 
75
132
  _This version does not introduce any user-facing changes._
76
133
 
77
- ## 1.11.3 2023-12-19
134
+ ## 1.11.3 - 2023-12-19
78
135
 
79
136
  ### 🐛 Bug fixes
80
137
 
@@ -9,7 +9,7 @@ rescue
9
9
  reactNativeVersion = '0.0.0'
10
10
  end
11
11
 
12
- reactNativeMinorVersion = reactNativeVersion.split('.')[1].to_i
12
+ reactNativeTargetVersion = reactNativeVersion.split('.')[1].to_i
13
13
 
14
14
  fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
15
15
  fabric_compiler_flags = '-DRN_FABRIC_ENABLED -DRCT_NEW_ARCH_ENABLED'
@@ -75,12 +75,15 @@ Pod::Spec.new do |s|
75
75
  "HEADER_SEARCH_PATHS" => user_header_search_paths,
76
76
  }
77
77
 
78
- compiler_flags = folly_compiler_flags + ' ' + "-DREACT_NATIVE_MINOR_VERSION=#{reactNativeMinorVersion}"
78
+ compiler_flags = folly_compiler_flags + ' ' + "-DREACT_NATIVE_TARGET_VERSION=#{reactNativeTargetVersion}"
79
+ if ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
80
+ compiler_flags += ' -DUSE_HERMES'
81
+ end
79
82
 
80
83
  s.dependency 'React-Core'
81
84
  s.dependency 'ReactCommon/turbomodule/core'
82
- s.dependency 'React-RCTAppDelegate' if reactNativeMinorVersion >= 71
83
- s.dependency 'React-NativeModulesApple' if reactNativeMinorVersion >= 72
85
+ s.dependency 'React-RCTAppDelegate' if reactNativeTargetVersion >= 71
86
+ s.dependency 'React-NativeModulesApple' if reactNativeTargetVersion >= 72
84
87
 
85
88
  if fabric_enabled
86
89
  compiler_flags << ' ' << fabric_compiler_flags
@@ -14,7 +14,7 @@ class KotlinExpoModulesCorePlugin implements Plugin<Project> {
14
14
  project.ext.kotlinVersion = {
15
15
  project.rootProject.ext.has("kotlinVersion")
16
16
  ? project.rootProject.ext.get("kotlinVersion")
17
- : "1.8.10"
17
+ : "1.9.23"
18
18
  }
19
19
 
20
20
  project.ext.kspVersion = {
@@ -24,41 +24,57 @@ class KotlinExpoModulesCorePlugin implements Plugin<Project> {
24
24
  "1.7.22": "1.7.22-1.0.8",
25
25
  "1.8.0": "1.8.0-1.0.9",
26
26
  "1.8.10": "1.8.10-1.0.9",
27
- "1.8.22": "1.8.22-1.0.11"
27
+ "1.8.22": "1.8.22-1.0.11",
28
+ "1.9.23": "1.9.23-1.0.20"
28
29
  ]
29
30
 
30
31
  project.rootProject.ext.has("kspVersion")
31
32
  ? project.rootProject.ext.get("kspVersion")
32
33
  : kspVersionsMap.containsKey(project.ext.kotlinVersion())
33
34
  ? kspVersionsMap.get(project.ext.kotlinVersion())
34
- : "1.8.22-1.0.11"
35
- }
36
- }
37
-
38
- // Setup build options that are common for all modules
39
- if (project.plugins.hasPlugin('kotlin-android')) {
40
- project.android {
41
- compileSdkVersion project.ext.safeExtGet("compileSdkVersion", 34)
42
-
43
- defaultConfig {
44
- minSdkVersion project.ext.safeExtGet("minSdkVersion", 23)
45
- targetSdkVersion project.ext.safeExtGet("targetSdkVersion", 34)
46
- }
47
-
48
- lintOptions {
49
- abortOnError false
50
- }
35
+ : "1.9.23-1.0.20"
51
36
  }
52
37
  }
53
38
  }
54
39
  }
55
40
 
56
41
  ext.applyKotlinExpoModulesCorePlugin = {
42
+ if (!project.plugins.hasPlugin('kotlin-android') && !project.plugins.hasPlugin('kotlin')) {
43
+ apply plugin: 'kotlin-android'
44
+ }
57
45
  apply plugin: KotlinExpoModulesCorePlugin
58
46
  }
59
47
 
48
+ // Setup build options that are common for all modules
49
+ ext.useDefaultAndroidSdkVersions = {
50
+ project.android {
51
+ compileSdkVersion project.ext.safeExtGet("compileSdkVersion", 34)
52
+
53
+ defaultConfig {
54
+ minSdkVersion project.ext.safeExtGet("minSdkVersion", 23)
55
+ targetSdkVersion project.ext.safeExtGet("targetSdkVersion", 34)
56
+ }
57
+
58
+ lintOptions {
59
+ abortOnError false
60
+ }
61
+ }
62
+ }
63
+
60
64
  ext.useExpoPublishing = {
61
- afterEvaluate {
65
+ if (!project.plugins.hasPlugin('maven-publish')) {
66
+ apply plugin: 'maven-publish'
67
+ }
68
+
69
+ project.android {
70
+ publishing {
71
+ singleVariant("release") {
72
+ withSourcesJar()
73
+ }
74
+ }
75
+ }
76
+
77
+ project.afterEvaluate {
62
78
  publishing {
63
79
  publications {
64
80
  release(MavenPublication) {
@@ -72,14 +88,6 @@ ext.useExpoPublishing = {
72
88
  }
73
89
  }
74
90
  }
75
-
76
- android {
77
- publishing {
78
- singleVariant("release") {
79
- withSourcesJar()
80
- }
81
- }
82
- }
83
91
  }
84
92
 
85
93
  ext.useCoreDependencies = {
@@ -1,46 +1,13 @@
1
- import java.nio.file.Paths
2
-
3
1
  apply plugin: 'com.android.library'
4
- apply plugin: 'kotlin-android'
5
- apply plugin: 'maven-publish'
6
2
 
7
3
  group = 'host.exp.exponent'
8
- version = '1.11.13'
4
+ version = '1.12.0'
9
5
 
10
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
11
- if (expoModulesCorePlugin.exists()) {
12
- apply from: expoModulesCorePlugin
13
- applyKotlinExpoModulesCorePlugin()
14
-
15
- // Remove this check, but keep the contents after SDK49 support is dropped
16
- if (safeExtGet("expoProvidesDefaultConfig", false)) {
17
- useExpoPublishing()
18
- }
19
- }
20
-
21
- buildscript {
22
- // Simple helper that allows the root project to override versions declared by this library.
23
- ext.safeExtGet = { prop, fallback ->
24
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
25
- }
26
-
27
- // Ensures backward compatibility
28
- ext.getKotlinVersion = {
29
- if (ext.has("kotlinVersion")) {
30
- ext.kotlinVersion()
31
- } else {
32
- ext.safeExtGet("kotlinVersion", "1.8.10")
33
- }
34
- }
35
-
36
- repositories {
37
- mavenCentral()
38
- }
39
-
40
- dependencies {
41
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
42
- }
43
- }
7
+ apply from: expoModulesCorePlugin
8
+ applyKotlinExpoModulesCorePlugin()
9
+ useDefaultAndroidSdkVersions()
10
+ useExpoPublishing()
44
11
 
45
12
  def isExpoModulesCoreTests = {
46
13
  Gradle gradle = getGradle()
@@ -55,7 +22,10 @@ def isExpoModulesCoreTests = {
55
22
  def REACT_NATIVE_BUILD_FROM_SOURCE = findProject(":packages:react-native:ReactAndroid") != null
56
23
  def REACT_NATIVE_DIR = REACT_NATIVE_BUILD_FROM_SOURCE
57
24
  ? findProject(":packages:react-native:ReactAndroid").getProjectDir().parent
58
- : new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).parent
25
+ : file(providers.exec {
26
+ workingDir(rootDir)
27
+ commandLine("node", "--print", "require.resolve('react-native/package.json')")
28
+ }.standardOutput.asText.get().trim()).parent
59
29
 
60
30
  def reactProperties = new Properties()
61
31
  file("$REACT_NATIVE_DIR/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) }
@@ -81,45 +51,7 @@ USE_HERMES = USE_HERMES && isExpoModulesCoreTests
81
51
 
82
52
  def isNewArchitectureEnabled = findProperty("newArchEnabled") == "true"
83
53
 
84
- // Remove this if and it's contents, when support for SDK49 is dropped
85
- if (!safeExtGet("expoProvidesDefaultConfig", false)) {
86
- afterEvaluate {
87
- publishing {
88
- publications {
89
- release(MavenPublication) {
90
- from components.release
91
- }
92
- }
93
- repositories {
94
- maven {
95
- url = mavenLocal().url
96
- }
97
- }
98
- }
99
- }
100
- }
101
-
102
54
  android {
103
- // Remove this if and it's contents, when support for SDK49 is dropped
104
- if (!safeExtGet("expoProvidesDefaultConfig", false)) {
105
- compileSdkVersion safeExtGet("compileSdkVersion", 34)
106
-
107
- defaultConfig {
108
- minSdkVersion safeExtGet("minSdkVersion", 23)
109
- targetSdkVersion safeExtGet("targetSdkVersion", 34)
110
- }
111
-
112
- publishing {
113
- singleVariant("release") {
114
- withSourcesJar()
115
- }
116
- }
117
-
118
- lintOptions {
119
- abortOnError false
120
- }
121
- }
122
-
123
55
  if (rootProject.hasProperty("ndkPath")) {
124
56
  ndkPath rootProject.ext.ndkPath
125
57
  }
@@ -127,23 +59,11 @@ android {
127
59
  ndkVersion rootProject.ext.ndkVersion
128
60
  }
129
61
 
130
- def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
131
- if (agpVersion.tokenize('.')[0].toInteger() < 8) {
132
- compileOptions {
133
- sourceCompatibility JavaVersion.VERSION_11
134
- targetCompatibility JavaVersion.VERSION_11
135
- }
136
-
137
- kotlinOptions {
138
- jvmTarget = JavaVersion.VERSION_11.majorVersion
139
- }
140
- }
141
-
142
62
  namespace "expo.modules"
143
63
  defaultConfig {
144
64
  consumerProguardFiles 'proguard-rules.pro'
145
65
  versionCode 1
146
- versionName "1.11.13"
66
+ versionName "1.12.0"
147
67
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled.toString()
148
68
 
149
69
  testInstrumentationRunner "expo.modules.TestRunner"
@@ -224,14 +144,13 @@ android {
224
144
  }
225
145
 
226
146
  dependencies {
227
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
228
- implementation "org.jetbrains.kotlin:kotlin-reflect:${getKotlinVersion()}"
147
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${kotlinVersion()}"
148
+ implementation "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion()}"
229
149
  implementation 'androidx.annotation:annotation:1.7.1'
230
150
 
231
151
  api "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
232
152
  api "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
233
153
  api "androidx.core:core-ktx:1.12.0"
234
- api project(':expo-modules-core$android-annotation')
235
154
 
236
155
  implementation("androidx.tracing:tracing-ktx:1.2.0")
237
156
 
@@ -1,11 +1,3 @@
1
- -keepclassmembers class * {
2
- @expo.modules.core.interfaces.ExpoProp *;
3
- }
4
-
5
- -keepclassmembers class * {
6
- @expo.modules.core.interfaces.ExpoMethod *;
7
- }
8
-
9
1
  -keep @expo.modules.core.interfaces.DoNotStrip class *
10
2
  -keepclassmembers class * {
11
3
  @expo.modules.core.interfaces.DoNotStrip *;
@@ -2,7 +2,7 @@
2
2
 
3
3
  #include "Exceptions.h"
4
4
 
5
- #include "JSIInteropModuleRegistry.h"
5
+ #include "JSIContext.h"
6
6
  #include "JSReferencesCache.h"
7
7
 
8
8
  namespace jni = facebook::jni;
@@ -12,7 +12,7 @@ namespace jsi = facebook::jsi;
12
12
 
13
13
  namespace expo {
14
14
 
15
- class JSIInteropModuleRegistry;
15
+ class JSIContext;
16
16
 
17
17
  /**
18
18
  * A convenient wrapper for the Kotlin CodedException.
@@ -11,18 +11,20 @@ namespace jsi = facebook::jsi;
11
11
 
12
12
  namespace expo {
13
13
 
14
- ExpoModulesHostObject::ExpoModulesHostObject(JSIInteropModuleRegistry *installer)
14
+ ExpoModulesHostObject::ExpoModulesHostObject(JSIContext *installer)
15
15
  : installer(installer) {}
16
16
 
17
17
  /**
18
18
  * Clears jsi references held by JSRegistry and JavaScriptRuntime.
19
19
  */
20
20
  ExpoModulesHostObject::~ExpoModulesHostObject() {
21
+ #if REACT_NATIVE_TARGET_VERSION >= 75
22
+ auto &runtime = installer->runtimeHolder->get();
23
+ facebook::react::LongLivedObjectCollection::get(runtime).clear();
24
+ #else
21
25
  facebook::react::LongLivedObjectCollection::get().clear();
22
- installer->jsRegistry.reset();
23
- installer->runtimeHolder.reset();
24
- installer->jsInvoker.reset();
25
- installer->jniDeallocator.reset();
26
+ #endif
27
+ installer->prepareForDeallocation();
26
28
  }
27
29
 
28
30
  jsi::Value ExpoModulesHostObject::get(jsi::Runtime &runtime, const jsi::PropNameID &name) {
@@ -40,7 +42,6 @@ jsi::Value ExpoModulesHostObject::get(jsi::Runtime &runtime, const jsi::PropName
40
42
  LazyObject::Shared moduleLazyObject = std::make_shared<LazyObject>(
41
43
  [this, cName](jsi::Runtime &rt) {
42
44
  auto module = installer->getModule(cName);
43
- module->cthis()->jsiInteropModuleRegistry = installer;
44
45
  return module->cthis()->getJSIObject(rt);
45
46
  });
46
47
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  #pragma once
4
4
 
5
- #include "JSIInteropModuleRegistry.h"
5
+ #include "JSIContext.h"
6
6
 
7
7
  #include <jsi/jsi.h>
8
8
 
@@ -22,7 +22,7 @@ using UniqueJSIObject = std::unique_ptr<jsi::Object>;
22
22
  */
23
23
  class ExpoModulesHostObject : public jsi::HostObject {
24
24
  public:
25
- ExpoModulesHostObject(JSIInteropModuleRegistry *installer);
25
+ ExpoModulesHostObject(JSIContext *installer);
26
26
 
27
27
  ~ExpoModulesHostObject() override;
28
28
 
@@ -33,7 +33,7 @@ public:
33
33
  std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime &rt) override;
34
34
 
35
35
  private:
36
- JSIInteropModuleRegistry *installer;
36
+ JSIContext *installer;
37
37
  std::unordered_map<std::string, UniqueJSIObject> modulesCache;
38
38
  };
39
39
  } // namespace expo
@@ -1,9 +1,10 @@
1
1
  // Copyright © 2021-present 650 Industries, Inc. (aka Expo)
2
2
 
3
- #include "JSIInteropModuleRegistry.h"
3
+ #include "JSIContext.h"
4
4
  #include "JavaScriptModuleObject.h"
5
5
  #include "JavaScriptValue.h"
6
6
  #include "JavaScriptObject.h"
7
+ #include "JavaScriptWeakObject.h"
7
8
  #include "JavaScriptFunction.h"
8
9
  #include "JavaScriptTypedArray.h"
9
10
  #include "JavaReferencesCache.h"
@@ -24,10 +25,11 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
24
25
  expo::JavaReferencesCache::instance()->loadJClasses(jni::Environment::current());
25
26
  expo::FrontendConverterProvider::instance()->createConverters();
26
27
 
27
- expo::JSIInteropModuleRegistry::registerNatives();
28
+ expo::JSIContext::registerNatives();
28
29
  expo::JavaScriptModuleObject::registerNatives();
29
30
  expo::JavaScriptValue::registerNatives();
30
31
  expo::JavaScriptObject::registerNatives();
32
+ expo::JavaScriptWeakObject::registerNatives();
31
33
  expo::JavaScriptFunction::registerNatives();
32
34
  expo::JavaScriptTypedArray::registerNatives();
33
35
  expo::JavaCallback::registerNatives();