vxrn 1.27.1 → 2.0.0-beta.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/dist/cli.mjs +212 -261
  2. package/dist/cli.mjs.map +1 -1
  3. package/dist/cli.native.js +216 -265
  4. package/dist/cli.native.js.map +1 -1
  5. package/dist/config/getAdditionalViteConfig.mjs +33 -62
  6. package/dist/config/getAdditionalViteConfig.mjs.map +1 -1
  7. package/dist/config/getAdditionalViteConfig.native.js +33 -62
  8. package/dist/config/getAdditionalViteConfig.native.js.map +1 -1
  9. package/dist/config/getBaseViteConfigOnly.mjs +84 -77
  10. package/dist/config/getBaseViteConfigOnly.mjs.map +1 -1
  11. package/dist/config/getBaseViteConfigOnly.native.js +86 -79
  12. package/dist/config/getBaseViteConfigOnly.native.js.map +1 -1
  13. package/dist/config/getBaseViteConfigWithPlugins.mjs +6 -4
  14. package/dist/config/getBaseViteConfigWithPlugins.mjs.map +1 -1
  15. package/dist/config/getBaseViteConfigWithPlugins.native.js +6 -4
  16. package/dist/config/getBaseViteConfigWithPlugins.native.js.map +1 -1
  17. package/dist/config/getBaseVitePlugins.mjs +102 -130
  18. package/dist/config/getBaseVitePlugins.mjs.map +1 -1
  19. package/dist/config/getBaseVitePlugins.native.js +123 -152
  20. package/dist/config/getBaseVitePlugins.native.js.map +1 -1
  21. package/dist/config/getNonCliModeOnlyVitePlugins.mjs +3 -3
  22. package/dist/config/getNonCliModeOnlyVitePlugins.mjs.map +1 -1
  23. package/dist/config/getNonCliModeOnlyVitePlugins.native.js +3 -1
  24. package/dist/config/getNonCliModeOnlyVitePlugins.native.js.map +1 -1
  25. package/dist/config/getOptimizeDeps.mjs +138 -42
  26. package/dist/config/getOptimizeDeps.mjs.map +1 -1
  27. package/dist/config/getOptimizeDeps.native.js +138 -42
  28. package/dist/config/getOptimizeDeps.native.js.map +1 -1
  29. package/dist/config/getOptionsFilled.mjs +48 -52
  30. package/dist/config/getOptionsFilled.mjs.map +1 -1
  31. package/dist/config/getOptionsFilled.native.js +51 -55
  32. package/dist/config/getOptionsFilled.native.js.map +1 -1
  33. package/dist/config/getReactNativePlugins.mjs +23 -15
  34. package/dist/config/getReactNativePlugins.mjs.map +1 -1
  35. package/dist/config/getReactNativePlugins.native.js +25 -16
  36. package/dist/config/getReactNativePlugins.native.js.map +1 -1
  37. package/dist/config/getServerOptionsFilled.mjs +33 -35
  38. package/dist/config/getServerOptionsFilled.mjs.map +1 -1
  39. package/dist/config/getServerOptionsFilled.native.js +35 -38
  40. package/dist/config/getServerOptionsFilled.native.js.map +1 -1
  41. package/dist/config/getViteServerConfig.mjs +34 -45
  42. package/dist/config/getViteServerConfig.mjs.map +1 -1
  43. package/dist/config/getViteServerConfig.native.js +35 -46
  44. package/dist/config/getViteServerConfig.native.js.map +1 -1
  45. package/dist/config/mergeUserConfig.mjs +50 -28
  46. package/dist/config/mergeUserConfig.mjs.map +1 -1
  47. package/dist/config/mergeUserConfig.native.js +60 -38
  48. package/dist/config/mergeUserConfig.native.js.map +1 -1
  49. package/dist/constants/defaults.mjs +29 -12
  50. package/dist/constants/defaults.mjs.map +1 -1
  51. package/dist/constants/defaults.native.js +29 -12
  52. package/dist/constants/defaults.native.js.map +1 -1
  53. package/dist/constants.mjs +41 -6
  54. package/dist/constants.mjs.map +1 -1
  55. package/dist/constants.native.js +41 -6
  56. package/dist/constants.native.js.map +1 -1
  57. package/dist/exports/build.mjs +218 -270
  58. package/dist/exports/build.mjs.map +1 -1
  59. package/dist/exports/build.native.js +226 -283
  60. package/dist/exports/build.native.js.map +1 -1
  61. package/dist/exports/clean.mjs +71 -78
  62. package/dist/exports/clean.mjs.map +1 -1
  63. package/dist/exports/clean.native.js +76 -90
  64. package/dist/exports/clean.native.js.map +1 -1
  65. package/dist/exports/createServer.mjs +43 -46
  66. package/dist/exports/createServer.mjs.map +1 -1
  67. package/dist/exports/createServer.native.js +45 -48
  68. package/dist/exports/createServer.native.js.map +1 -1
  69. package/dist/exports/dev.mjs +177 -201
  70. package/dist/exports/dev.mjs.map +1 -1
  71. package/dist/exports/dev.native.js +191 -215
  72. package/dist/exports/dev.native.js.map +1 -1
  73. package/dist/exports/loadEnv.mjs +51 -48
  74. package/dist/exports/loadEnv.mjs.map +1 -1
  75. package/dist/exports/loadEnv.native.js +59 -57
  76. package/dist/exports/loadEnv.native.js.map +1 -1
  77. package/dist/exports/patch.mjs +9 -7
  78. package/dist/exports/patch.mjs.map +1 -1
  79. package/dist/exports/patch.native.js +9 -7
  80. package/dist/exports/patch.native.js.map +1 -1
  81. package/dist/exports/prebuild.mjs +177 -157
  82. package/dist/exports/prebuild.mjs.map +1 -1
  83. package/dist/exports/prebuild.native.js +197 -160
  84. package/dist/exports/prebuild.native.js.map +1 -1
  85. package/dist/exports/prebuildWithoutExpo.mjs +46 -44
  86. package/dist/exports/prebuildWithoutExpo.mjs.map +1 -1
  87. package/dist/exports/prebuildWithoutExpo.native.js +48 -46
  88. package/dist/exports/prebuildWithoutExpo.native.js.map +1 -1
  89. package/dist/exports/runAndroid.mjs +9 -10
  90. package/dist/exports/runAndroid.mjs.map +1 -1
  91. package/dist/exports/runAndroid.native.js +10 -11
  92. package/dist/exports/runAndroid.native.js.map +1 -1
  93. package/dist/exports/runIos.mjs +9 -10
  94. package/dist/exports/runIos.mjs.map +1 -1
  95. package/dist/exports/runIos.native.js +10 -11
  96. package/dist/exports/runIos.native.js.map +1 -1
  97. package/dist/exports/serve.mjs +23 -31
  98. package/dist/exports/serve.mjs.map +1 -1
  99. package/dist/exports/serve.native.js +26 -34
  100. package/dist/exports/serve.native.js.map +1 -1
  101. package/dist/exports/serveStaticAssets.mjs +109 -113
  102. package/dist/exports/serveStaticAssets.mjs.map +1 -1
  103. package/dist/exports/serveStaticAssets.native.js +180 -192
  104. package/dist/exports/serveStaticAssets.native.js.map +1 -1
  105. package/dist/index.js +25 -14
  106. package/dist/index.mjs +25 -14
  107. package/dist/index.native.js +25 -14
  108. package/dist/patches/builtInDepPatches.mjs +346 -435
  109. package/dist/patches/builtInDepPatches.mjs.map +1 -1
  110. package/dist/patches/builtInDepPatches.native.js +349 -438
  111. package/dist/patches/builtInDepPatches.native.js.map +1 -1
  112. package/dist/plugins/applyBuiltInPatchesPlugin.mjs +11 -11
  113. package/dist/plugins/applyBuiltInPatchesPlugin.mjs.map +1 -1
  114. package/dist/plugins/applyBuiltInPatchesPlugin.native.js +11 -11
  115. package/dist/plugins/applyBuiltInPatchesPlugin.native.js.map +1 -1
  116. package/dist/plugins/autoDepOptimizePlugin.mjs +87 -90
  117. package/dist/plugins/autoDepOptimizePlugin.mjs.map +1 -1
  118. package/dist/plugins/autoDepOptimizePlugin.native.js +99 -102
  119. package/dist/plugins/autoDepOptimizePlugin.native.js.map +1 -1
  120. package/dist/plugins/clientInjectPlugin.mjs +13 -11
  121. package/dist/plugins/clientInjectPlugin.mjs.map +1 -1
  122. package/dist/plugins/clientInjectPlugin.native.js +13 -11
  123. package/dist/plugins/clientInjectPlugin.native.js.map +1 -1
  124. package/dist/plugins/defaultDepOptimizePlugin.mjs +15 -23
  125. package/dist/plugins/defaultDepOptimizePlugin.mjs.map +1 -1
  126. package/dist/plugins/defaultDepOptimizePlugin.native.js +15 -23
  127. package/dist/plugins/defaultDepOptimizePlugin.native.js.map +1 -1
  128. package/dist/plugins/expoManifestRequestHandlerPlugin.mjs +163 -179
  129. package/dist/plugins/expoManifestRequestHandlerPlugin.mjs.map +1 -1
  130. package/dist/plugins/expoManifestRequestHandlerPlugin.native.js +169 -191
  131. package/dist/plugins/expoManifestRequestHandlerPlugin.native.js.map +1 -1
  132. package/dist/plugins/getResolvedConfigSubset.mjs +6 -5
  133. package/dist/plugins/getResolvedConfigSubset.mjs.map +1 -1
  134. package/dist/plugins/getResolvedConfigSubset.native.js +6 -5
  135. package/dist/plugins/getResolvedConfigSubset.native.js.map +1 -1
  136. package/dist/plugins/reactNativeCommonJsPlugin.mjs +210 -178
  137. package/dist/plugins/reactNativeCommonJsPlugin.mjs.map +1 -1
  138. package/dist/plugins/reactNativeCommonJsPlugin.native.js +283 -259
  139. package/dist/plugins/reactNativeCommonJsPlugin.native.js.map +1 -1
  140. package/dist/plugins/reactNativeDevAssetPlugin.mjs +72 -83
  141. package/dist/plugins/reactNativeDevAssetPlugin.mjs.map +1 -1
  142. package/dist/plugins/reactNativeDevAssetPlugin.native.js +75 -92
  143. package/dist/plugins/reactNativeDevAssetPlugin.native.js.map +1 -1
  144. package/dist/plugins/reactNativeDevServer.mjs +283 -328
  145. package/dist/plugins/reactNativeDevServer.mjs.map +1 -1
  146. package/dist/plugins/reactNativeDevServer.native.js +332 -391
  147. package/dist/plugins/reactNativeDevServer.native.js.map +1 -1
  148. package/dist/plugins/rnCodegenPlugin.mjs +13 -12
  149. package/dist/plugins/rnCodegenPlugin.mjs.map +1 -1
  150. package/dist/plugins/rnCodegenPlugin.native.js +13 -12
  151. package/dist/plugins/rnCodegenPlugin.native.js.map +1 -1
  152. package/dist/plugins/rollupRemoveUnusedImports.mjs +8 -7
  153. package/dist/plugins/rollupRemoveUnusedImports.mjs.map +1 -1
  154. package/dist/plugins/rollupRemoveUnusedImports.native.js +8 -7
  155. package/dist/plugins/rollupRemoveUnusedImports.native.js.map +1 -1
  156. package/dist/plugins/workletImportsPlugin.mjs +127 -132
  157. package/dist/plugins/workletImportsPlugin.mjs.map +1 -1
  158. package/dist/plugins/workletImportsPlugin.native.js +192 -203
  159. package/dist/plugins/workletImportsPlugin.native.js.map +1 -1
  160. package/dist/rn-commands/bundle/buildBundle.mjs +45 -79
  161. package/dist/rn-commands/bundle/buildBundle.mjs.map +1 -1
  162. package/dist/rn-commands/bundle/buildBundle.native.js +45 -85
  163. package/dist/rn-commands/bundle/buildBundle.native.js.map +1 -1
  164. package/dist/runtime/hmr-client.mjs +133 -140
  165. package/dist/runtime/hmr-client.mjs.map +1 -1
  166. package/dist/runtime/hmr-client.native.js +223 -222
  167. package/dist/runtime/hmr-client.native.js.map +1 -1
  168. package/dist/runtime/hmr-runtime.mjs +192 -194
  169. package/dist/runtime/hmr-runtime.mjs.map +1 -1
  170. package/dist/runtime/hmr-runtime.native.js +424 -411
  171. package/dist/runtime/hmr-runtime.native.js.map +1 -1
  172. package/dist/runtime/hmr-types.mjs +0 -2
  173. package/dist/runtime/hmr-types.native.js +0 -2
  174. package/dist/runtime/native-prelude.mjs +2 -1
  175. package/dist/runtime/native-prelude.mjs.map +1 -1
  176. package/dist/runtime/native-prelude.native.js +2 -1
  177. package/dist/runtime/native-prelude.native.js.map +1 -1
  178. package/dist/runtime/react-refresh-utils.mjs +23 -22
  179. package/dist/runtime/react-refresh-utils.mjs.map +1 -1
  180. package/dist/runtime/react-refresh-utils.native.js +23 -27
  181. package/dist/runtime/react-refresh-utils.native.js.map +1 -1
  182. package/dist/serve/node.mjs +49 -49
  183. package/dist/serve/node.mjs.map +1 -1
  184. package/dist/serve/node.native.js +92 -96
  185. package/dist/serve/node.native.js.map +1 -1
  186. package/dist/types.mjs +0 -2
  187. package/dist/types.native.js +0 -2
  188. package/dist/user-interface/index.mjs +245 -262
  189. package/dist/user-interface/index.mjs.map +1 -1
  190. package/dist/user-interface/index.native.js +274 -298
  191. package/dist/user-interface/index.native.js.map +1 -1
  192. package/dist/utils/assert.mjs +7 -6
  193. package/dist/utils/assert.mjs.map +1 -1
  194. package/dist/utils/assert.native.js +7 -18
  195. package/dist/utils/assert.native.js.map +1 -1
  196. package/dist/utils/bindKeypressInput.mjs +36 -38
  197. package/dist/utils/bindKeypressInput.mjs.map +1 -1
  198. package/dist/utils/bindKeypressInput.native.js +36 -38
  199. package/dist/utils/bindKeypressInput.native.js.map +1 -1
  200. package/dist/utils/coerceToArray.mjs +2 -1
  201. package/dist/utils/coerceToArray.mjs.map +1 -1
  202. package/dist/utils/coerceToArray.native.js +2 -1
  203. package/dist/utils/coerceToArray.native.js.map +1 -1
  204. package/dist/utils/connectedNativeClients.mjs +3 -2
  205. package/dist/utils/connectedNativeClients.mjs.map +1 -1
  206. package/dist/utils/connectedNativeClients.native.js +3 -2
  207. package/dist/utils/connectedNativeClients.native.js.map +1 -1
  208. package/dist/utils/createNativeDevEngine.mjs +992 -966
  209. package/dist/utils/createNativeDevEngine.mjs.map +1 -1
  210. package/dist/utils/createNativeDevEngine.native.js +1184 -1179
  211. package/dist/utils/createNativeDevEngine.native.js.map +1 -1
  212. package/dist/utils/dispose.mjs +4 -3
  213. package/dist/utils/dispose.mjs.map +1 -1
  214. package/dist/utils/dispose.native.js +6 -5
  215. package/dist/utils/dispose.native.js.map +1 -1
  216. package/dist/utils/environmentUtils.mjs +5 -4
  217. package/dist/utils/environmentUtils.mjs.map +1 -1
  218. package/dist/utils/environmentUtils.native.js +5 -4
  219. package/dist/utils/environmentUtils.native.js.map +1 -1
  220. package/dist/utils/execSync.mjs +7 -5
  221. package/dist/utils/execSync.mjs.map +1 -1
  222. package/dist/utils/execSync.native.js +8 -6
  223. package/dist/utils/execSync.native.js.map +1 -1
  224. package/dist/utils/expoRun.mjs +27 -35
  225. package/dist/utils/expoRun.mjs.map +1 -1
  226. package/dist/utils/expoRun.native.js +27 -35
  227. package/dist/utils/expoRun.native.js.map +1 -1
  228. package/dist/utils/filterViteServerResolvedUrls.mjs +24 -22
  229. package/dist/utils/filterViteServerResolvedUrls.mjs.map +1 -1
  230. package/dist/utils/filterViteServerResolvedUrls.native.js +61 -63
  231. package/dist/utils/filterViteServerResolvedUrls.native.js.map +1 -1
  232. package/dist/utils/getBoundPort.mjs +6 -5
  233. package/dist/utils/getBoundPort.mjs.map +1 -1
  234. package/dist/utils/getBoundPort.native.js +8 -12
  235. package/dist/utils/getBoundPort.native.js.map +1 -1
  236. package/dist/utils/getCacheDir.mjs +3 -1
  237. package/dist/utils/getCacheDir.mjs.map +1 -1
  238. package/dist/utils/getCacheDir.native.js +3 -1
  239. package/dist/utils/getCacheDir.native.js.map +1 -1
  240. package/dist/utils/getServerEntry.mjs +6 -4
  241. package/dist/utils/getServerEntry.mjs.map +1 -1
  242. package/dist/utils/getServerEntry.native.js +8 -11
  243. package/dist/utils/getServerEntry.native.js.map +1 -1
  244. package/dist/utils/getVitePath.mjs +42 -42
  245. package/dist/utils/getVitePath.mjs.map +1 -1
  246. package/dist/utils/getVitePath.native.js +43 -41
  247. package/dist/utils/getVitePath.native.js.map +1 -1
  248. package/dist/utils/globDir.mjs +7 -11
  249. package/dist/utils/globDir.mjs.map +1 -1
  250. package/dist/utils/globDir.native.js +10 -14
  251. package/dist/utils/globDir.native.js.map +1 -1
  252. package/dist/utils/isWithin.mjs +4 -2
  253. package/dist/utils/isWithin.mjs.map +1 -1
  254. package/dist/utils/isWithin.native.js +4 -2
  255. package/dist/utils/isWithin.native.js.map +1 -1
  256. package/dist/utils/patches.mjs +233 -255
  257. package/dist/utils/patches.mjs.map +1 -1
  258. package/dist/utils/patches.native.js +415 -460
  259. package/dist/utils/patches.native.js.map +1 -1
  260. package/dist/utils/printServerUrls.mjs +9 -7
  261. package/dist/utils/printServerUrls.mjs.map +1 -1
  262. package/dist/utils/printServerUrls.native.js +48 -51
  263. package/dist/utils/printServerUrls.native.js.map +1 -1
  264. package/dist/utils/removeUndefined.mjs +8 -7
  265. package/dist/utils/removeUndefined.mjs.map +1 -1
  266. package/dist/utils/removeUndefined.native.js +8 -7
  267. package/dist/utils/removeUndefined.native.js.map +1 -1
  268. package/dist/utils/scanDepsToOptimize.mjs +194 -161
  269. package/dist/utils/scanDepsToOptimize.mjs.map +1 -1
  270. package/dist/utils/scanDepsToOptimize.native.js +227 -197
  271. package/dist/utils/scanDepsToOptimize.native.js.map +1 -1
  272. package/dist/utils/state.mjs +18 -18
  273. package/dist/utils/state.mjs.map +1 -1
  274. package/dist/utils/state.native.js +18 -18
  275. package/dist/utils/state.native.js.map +1 -1
  276. package/dist/utils/symbolicateNativeStack.mjs +54 -54
  277. package/dist/utils/symbolicateNativeStack.mjs.map +1 -1
  278. package/dist/utils/symbolicateNativeStack.native.js +58 -58
  279. package/dist/utils/symbolicateNativeStack.native.js.map +1 -1
  280. package/dist/utils/uniq.mjs +2 -1
  281. package/dist/utils/uniq.mjs.map +1 -1
  282. package/dist/utils/uniq.native.js +2 -1
  283. package/dist/utils/uniq.native.js.map +1 -1
  284. package/dist/utils/utils.mjs +19 -19
  285. package/dist/utils/utils.mjs.map +1 -1
  286. package/dist/utils/utils.native.js +38 -40
  287. package/dist/utils/utils.native.js.map +1 -1
  288. package/dist/vendor/debugger-app/index.mjs +0 -2
  289. package/dist/vendor/debugger-app/index.native.js +0 -2
  290. package/dist/vendor/debugger-app/src/debuggerWorker.mjs +0 -2
  291. package/dist/vendor/debugger-app/src/debuggerWorker.native.js +0 -2
  292. package/dist/vendor/debugger-app/src/index.mjs +0 -2
  293. package/dist/vendor/debugger-app/src/index.native.js +0 -2
  294. package/dist/vxrn-vite-plugin.mjs +34 -33
  295. package/dist/vxrn-vite-plugin.mjs.map +1 -1
  296. package/dist/vxrn-vite-plugin.native.js +35 -34
  297. package/dist/vxrn-vite-plugin.native.js.map +1 -1
  298. package/expo-plugin.cjs +12 -6
  299. package/package.json +12 -13
  300. package/src/config/getBaseViteConfigOnly.ts +6 -0
  301. package/src/exports/prebuild.ts +40 -12
  302. package/src/patches/builtInDepPatches.ts +24 -48
  303. package/src/utils/createNativeDevEngine.test.ts +1 -1
  304. package/src/utils/createNativeDevEngine.ts +15 -9
  305. package/src/utils/scanDepsToOptimize.ts +0 -3
  306. package/types/config/getBaseViteConfigOnly.d.ts.map +1 -1
  307. package/types/config/getOptimizeDeps.d.ts.map +1 -1
  308. package/types/config/getOptionsFilled.d.ts +15 -15
  309. package/types/config/getOptionsFilled.d.ts.map +1 -1
  310. package/types/exports/build.d.ts +11 -11
  311. package/types/exports/build.d.ts.map +1 -1
  312. package/types/exports/clean.d.ts +1 -1
  313. package/types/exports/clean.d.ts.map +1 -1
  314. package/types/exports/createServer.d.ts.map +1 -1
  315. package/types/exports/dev.d.ts.map +1 -1
  316. package/types/exports/patch.d.ts.map +1 -1
  317. package/types/exports/prebuild.d.ts +3 -3
  318. package/types/exports/prebuild.d.ts.map +1 -1
  319. package/types/exports/prebuildWithoutExpo.d.ts +1 -1
  320. package/types/exports/prebuildWithoutExpo.d.ts.map +1 -1
  321. package/types/exports/runAndroid.d.ts.map +1 -1
  322. package/types/exports/runIos.d.ts.map +1 -1
  323. package/types/exports/serve.d.ts.map +1 -1
  324. package/types/patches/builtInDepPatches.d.ts.map +1 -1
  325. package/types/plugins/autoDepOptimizePlugin.d.ts.map +1 -1
  326. package/types/plugins/rollupRemoveUnusedImports.d.ts.map +1 -1
  327. package/types/runtime/hmr-client.d.ts.map +1 -1
  328. package/types/runtime/hmr-runtime.d.ts.map +1 -1
  329. package/types/runtime/hmr-types.d.ts.map +1 -1
  330. package/types/utils/createNativeDevEngine.d.ts +1 -1
  331. package/types/utils/createNativeDevEngine.d.ts.map +1 -1
  332. package/types/utils/execSync.d.ts.map +1 -1
  333. package/types/utils/getServerEntry.d.ts.map +1 -1
  334. package/types/utils/scanDepsToOptimize.d.ts.map +1 -1
  335. package/types/vxrn-vite-plugin.d.ts.map +1 -1
  336. package/dist/config/getOptimizeDeps.test.mjs +0 -20
  337. package/dist/config/getOptimizeDeps.test.mjs.map +0 -1
  338. package/dist/config/getOptimizeDeps.test.native.js +0 -39
  339. package/dist/config/getOptimizeDeps.test.native.js.map +0 -1
  340. package/dist/config/getServerOptionsFilled.test.mjs +0 -20
  341. package/dist/config/getServerOptionsFilled.test.mjs.map +0 -1
  342. package/dist/config/getServerOptionsFilled.test.native.js +0 -20
  343. package/dist/config/getServerOptionsFilled.test.native.js.map +0 -1
  344. package/dist/config/getViteServerConfig.test.mjs +0 -26
  345. package/dist/config/getViteServerConfig.test.mjs.map +0 -1
  346. package/dist/config/getViteServerConfig.test.native.js +0 -26
  347. package/dist/config/getViteServerConfig.test.native.js.map +0 -1
  348. package/dist/config/mergeUserConfig.test.mjs +0 -108
  349. package/dist/config/mergeUserConfig.test.mjs.map +0 -1
  350. package/dist/config/mergeUserConfig.test.native.js +0 -108
  351. package/dist/config/mergeUserConfig.test.native.js.map +0 -1
  352. package/dist/exports/clean.test.mjs +0 -81
  353. package/dist/exports/clean.test.mjs.map +0 -1
  354. package/dist/exports/clean.test.native.js +0 -88
  355. package/dist/exports/clean.test.native.js.map +0 -1
  356. package/dist/exports/loadEnv.test.mjs +0 -65
  357. package/dist/exports/loadEnv.test.mjs.map +0 -1
  358. package/dist/exports/loadEnv.test.native.js +0 -65
  359. package/dist/exports/loadEnv.test.native.js.map +0 -1
  360. package/dist/index.js.map +0 -1
  361. package/dist/index.mjs.map +0 -1
  362. package/dist/index.native.js.map +0 -1
  363. package/dist/plugins/autoDepOptimizePlugin.test.mjs +0 -31
  364. package/dist/plugins/autoDepOptimizePlugin.test.mjs.map +0 -1
  365. package/dist/plugins/autoDepOptimizePlugin.test.native.js +0 -39
  366. package/dist/plugins/autoDepOptimizePlugin.test.native.js.map +0 -1
  367. package/dist/plugins/resolveIdScan.test.mjs +0 -31
  368. package/dist/plugins/resolveIdScan.test.mjs.map +0 -1
  369. package/dist/plugins/resolveIdScan.test.native.js +0 -38
  370. package/dist/plugins/resolveIdScan.test.native.js.map +0 -1
  371. package/dist/plugins/rnCodegenPlugin.test.mjs +0 -239
  372. package/dist/plugins/rnCodegenPlugin.test.mjs.map +0 -1
  373. package/dist/plugins/rnCodegenPlugin.test.native.js +0 -242
  374. package/dist/plugins/rnCodegenPlugin.test.native.js.map +0 -1
  375. package/dist/plugins/serverExtensions.test.mjs +0 -106
  376. package/dist/plugins/serverExtensions.test.mjs.map +0 -1
  377. package/dist/plugins/serverExtensions.test.native.js +0 -117
  378. package/dist/plugins/serverExtensions.test.native.js.map +0 -1
  379. package/dist/runtime/hmr-types.mjs.map +0 -1
  380. package/dist/runtime/hmr-types.native.js.map +0 -1
  381. package/dist/serve/node.test.mjs +0 -60
  382. package/dist/serve/node.test.mjs.map +0 -1
  383. package/dist/serve/node.test.native.js +0 -72
  384. package/dist/serve/node.test.native.js.map +0 -1
  385. package/dist/types.mjs.map +0 -1
  386. package/dist/types.native.js.map +0 -1
  387. package/dist/utils/bindKeypressInput.test.mjs +0 -48
  388. package/dist/utils/bindKeypressInput.test.mjs.map +0 -1
  389. package/dist/utils/bindKeypressInput.test.native.js +0 -48
  390. package/dist/utils/bindKeypressInput.test.native.js.map +0 -1
  391. package/dist/utils/createNativeDevEngine.test.mjs +0 -1788
  392. package/dist/utils/createNativeDevEngine.test.mjs.map +0 -1
  393. package/dist/utils/createNativeDevEngine.test.native.js +0 -1942
  394. package/dist/utils/createNativeDevEngine.test.native.js.map +0 -1
  395. package/dist/utils/createNativeDevEngineFailure.test.mjs +0 -44
  396. package/dist/utils/createNativeDevEngineFailure.test.mjs.map +0 -1
  397. package/dist/utils/createNativeDevEngineFailure.test.native.js +0 -54
  398. package/dist/utils/createNativeDevEngineFailure.test.native.js.map +0 -1
  399. package/dist/utils/getBoundPort.test.mjs +0 -71
  400. package/dist/utils/getBoundPort.test.mjs.map +0 -1
  401. package/dist/utils/getBoundPort.test.native.js +0 -82
  402. package/dist/utils/getBoundPort.test.native.js.map +0 -1
  403. package/dist/utils/imageSizePatch.test.mjs +0 -29
  404. package/dist/utils/imageSizePatch.test.mjs.map +0 -1
  405. package/dist/utils/imageSizePatch.test.native.js +0 -30
  406. package/dist/utils/imageSizePatch.test.native.js.map +0 -1
  407. package/dist/utils/patches.test.mjs +0 -242
  408. package/dist/utils/patches.test.mjs.map +0 -1
  409. package/dist/utils/patches.test.native.js +0 -271
  410. package/dist/utils/patches.test.native.js.map +0 -1
  411. package/dist/utils/symbolicateNativeStack.test.mjs +0 -96
  412. package/dist/utils/symbolicateNativeStack.test.mjs.map +0 -1
  413. package/dist/utils/symbolicateNativeStack.test.native.js +0 -96
  414. package/dist/utils/symbolicateNativeStack.test.native.js.map +0 -1
  415. package/dist/vendor/debugger-app/index.mjs.map +0 -1
  416. package/dist/vendor/debugger-app/index.native.js.map +0 -1
  417. package/dist/vendor/debugger-app/src/debuggerWorker.mjs.map +0 -1
  418. package/dist/vendor/debugger-app/src/debuggerWorker.native.js.map +0 -1
  419. package/dist/vendor/debugger-app/src/index.mjs.map +0 -1
  420. package/dist/vendor/debugger-app/src/index.native.js.map +0 -1
  421. package/types/config/getOptimizeDeps.test.d.ts +0 -2
  422. package/types/config/getOptimizeDeps.test.d.ts.map +0 -1
  423. package/types/config/getServerOptionsFilled.test.d.ts +0 -2
  424. package/types/config/getServerOptionsFilled.test.d.ts.map +0 -1
  425. package/types/config/getViteServerConfig.test.d.ts +0 -2
  426. package/types/config/getViteServerConfig.test.d.ts.map +0 -1
  427. package/types/config/mergeUserConfig.test.d.ts +0 -2
  428. package/types/config/mergeUserConfig.test.d.ts.map +0 -1
  429. package/types/exports/clean.test.d.ts +0 -2
  430. package/types/exports/clean.test.d.ts.map +0 -1
  431. package/types/exports/loadEnv.test.d.ts +0 -2
  432. package/types/exports/loadEnv.test.d.ts.map +0 -1
  433. package/types/plugins/autoDepOptimizePlugin.test.d.ts +0 -2
  434. package/types/plugins/autoDepOptimizePlugin.test.d.ts.map +0 -1
  435. package/types/plugins/resolveIdScan.test.d.ts +0 -2
  436. package/types/plugins/resolveIdScan.test.d.ts.map +0 -1
  437. package/types/plugins/rnCodegenPlugin.test.d.ts +0 -2
  438. package/types/plugins/rnCodegenPlugin.test.d.ts.map +0 -1
  439. package/types/plugins/serverExtensions.test.d.ts +0 -2
  440. package/types/plugins/serverExtensions.test.d.ts.map +0 -1
  441. package/types/serve/node.test.d.ts +0 -2
  442. package/types/serve/node.test.d.ts.map +0 -1
  443. package/types/utils/bindKeypressInput.test.d.ts +0 -2
  444. package/types/utils/bindKeypressInput.test.d.ts.map +0 -1
  445. package/types/utils/createNativeDevEngine.test.d.ts +0 -2
  446. package/types/utils/createNativeDevEngine.test.d.ts.map +0 -1
  447. package/types/utils/createNativeDevEngineFailure.test.d.ts +0 -2
  448. package/types/utils/createNativeDevEngineFailure.test.d.ts.map +0 -1
  449. package/types/utils/getBoundPort.test.d.ts +0 -2
  450. package/types/utils/getBoundPort.test.d.ts.map +0 -1
  451. package/types/utils/imageSizePatch.test.d.ts +0 -2
  452. package/types/utils/imageSizePatch.test.d.ts.map +0 -1
  453. package/types/utils/patches.test.d.ts +0 -2
  454. package/types/utils/patches.test.d.ts.map +0 -1
  455. package/types/utils/symbolicateNativeStack.test.d.ts +0 -2
  456. package/types/utils/symbolicateNativeStack.test.d.ts.map +0 -1
@@ -1,441 +1,454 @@
1
1
  import { enqueueUpdate, isReactRefreshBoundary } from "./react-refresh-utils.native.js";
2
+
2
3
  function _assert_this_initialized(self) {
3
- if (self === void 0) {
4
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5
- }
6
- return self;
4
+ if (self === void 0) {
5
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
6
+ }
7
+ return self;
7
8
  }
8
9
  function _call_super(_this, derived, args) {
9
- derived = _get_prototype_of(derived);
10
- return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
10
+ derived = _get_prototype_of(derived);
11
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
11
12
  }
12
13
  function _class_call_check(instance, Constructor) {
13
- if (!(instance instanceof Constructor)) {
14
- throw new TypeError("Cannot call a class as a function");
15
- }
14
+ if (!(instance instanceof Constructor)) {
15
+ throw new TypeError("Cannot call a class as a function");
16
+ }
16
17
  }
17
18
  function _defineProperties(target, props) {
18
- for (var i = 0; i < props.length; i++) {
19
- var descriptor = props[i];
20
- descriptor.enumerable = descriptor.enumerable || false;
21
- descriptor.configurable = true;
22
- if ("value" in descriptor) descriptor.writable = true;
23
- Object.defineProperty(target, descriptor.key, descriptor);
24
- }
19
+ for (var i = 0; i < props.length; i++) {
20
+ var descriptor = props[i];
21
+ descriptor.enumerable = descriptor.enumerable || false;
22
+ descriptor.configurable = true;
23
+ if ("value" in descriptor) descriptor.writable = true;
24
+ Object.defineProperty(target, descriptor.key, descriptor);
25
+ }
25
26
  }
26
27
  function _create_class(Constructor, protoProps, staticProps) {
27
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
28
- if (staticProps) _defineProperties(Constructor, staticProps);
29
- return Constructor;
28
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
29
+ if (staticProps) _defineProperties(Constructor, staticProps);
30
+ return Constructor;
30
31
  }
31
32
  function _define_property(obj, key, value) {
32
- if (key in obj) {
33
- Object.defineProperty(obj, key, {
34
- value,
35
- enumerable: true,
36
- configurable: true,
37
- writable: true
38
- });
39
- } else {
40
- obj[key] = value;
41
- }
42
- return obj;
33
+ if (key in obj) {
34
+ Object.defineProperty(obj, key, {
35
+ value,
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true
39
+ });
40
+ } else {
41
+ obj[key] = value;
42
+ }
43
+ return obj;
43
44
  }
44
45
  function _get_prototype_of(o) {
45
- _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {
46
- return o2.__proto__ || Object.getPrototypeOf(o2);
47
- };
48
- return _get_prototype_of(o);
46
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {
47
+ return o2.__proto__ || Object.getPrototypeOf(o2);
48
+ };
49
+ return _get_prototype_of(o);
49
50
  }
50
51
  function _inherits(subClass, superClass) {
51
- if (typeof superClass !== "function" && superClass !== null) {
52
- throw new TypeError("Super expression must either be null or a function");
53
- }
54
- subClass.prototype = Object.create(superClass && superClass.prototype, {
55
- constructor: {
56
- value: subClass,
57
- writable: true,
58
- configurable: true
59
- }
60
- });
61
- if (superClass) _set_prototype_of(subClass, superClass);
52
+ if (typeof superClass !== "function" && superClass !== null) {
53
+ throw new TypeError("Super expression must either be null or a function");
54
+ }
55
+ subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: {
56
+ value: subClass,
57
+ writable: true,
58
+ configurable: true
59
+ } });
60
+ if (superClass) _set_prototype_of(subClass, superClass);
62
61
  }
63
62
  function _possible_constructor_return(self, call) {
64
- if (call && (_type_of(call) === "object" || typeof call === "function")) {
65
- return call;
66
- }
67
- return _assert_this_initialized(self);
63
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
64
+ return call;
65
+ }
66
+ return _assert_this_initialized(self);
68
67
  }
69
68
  function _set_prototype_of(o, p) {
70
- _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {
71
- o2.__proto__ = p2;
72
- return o2;
73
- };
74
- return _set_prototype_of(o, p);
69
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {
70
+ o2.__proto__ = p2;
71
+ return o2;
72
+ };
73
+ return _set_prototype_of(o, p);
75
74
  }
76
75
  function _type_of(obj) {
77
- "@swc/helpers - typeof";
78
-
79
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
76
+ "@swc/helpers - typeof";
77
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
80
78
  }
81
79
  function _is_native_reflect_construct() {
82
- try {
83
- var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
84
- } catch (_) {}
85
- return (_is_native_reflect_construct = function () {
86
- return !!result;
87
- })();
80
+ try {
81
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
82
+ } catch (_) {}
83
+ return (_is_native_reflect_construct = function() {
84
+ return !!result;
85
+ })();
88
86
  }
89
87
  var BaseDevRuntime = DevRuntime;
90
- var SimpleEmitter = /* @__PURE__ */function () {
91
- "use strict";
92
-
93
- function SimpleEmitter1() {
94
- _class_call_check(this, SimpleEmitter1);
95
- _define_property(this, "listeners", /* @__PURE__ */new Map());
96
- }
97
- _create_class(SimpleEmitter1, [{
98
- key: "on",
99
- value: function on(event, fn) {
100
- if (!this.listeners.has(event)) this.listeners.set(event, /* @__PURE__ */new Set());
101
- this.listeners.get(event).add(fn);
102
- }
103
- }, {
104
- key: "off",
105
- value: function off(event, fn) {
106
- var _this_listeners_get;
107
- (_this_listeners_get = this.listeners.get(event)) === null || _this_listeners_get === void 0 ? void 0 : _this_listeners_get.delete(fn);
108
- }
109
- }, {
110
- key: "emit",
111
- value: function emit(event, payload) {
112
- var _this_listeners_get;
113
- (_this_listeners_get = this.listeners.get(event)) === null || _this_listeners_get === void 0 ? void 0 : _this_listeners_get.forEach(function (fn) {
114
- return fn(payload);
115
- });
116
- }
117
- }]);
118
- return SimpleEmitter1;
119
- }();
120
- var ModuleHotContext = /* @__PURE__ */function () {
121
- "use strict";
122
-
123
- function ModuleHotContext1(moduleId, socketHolder) {
124
- _class_call_check(this, ModuleHotContext1);
125
- _define_property(this, "moduleId", void 0);
126
- _define_property(this, "socketHolder", void 0);
127
- _define_property(this, "removeListeners", void 0);
128
- _define_property(this, "acceptCallbacks", void 0);
129
- this.moduleId = moduleId;
130
- this.socketHolder = socketHolder;
131
- this.removeListeners = [];
132
- this.acceptCallbacks = [];
133
- }
134
- _create_class(ModuleHotContext1, [{
135
- key: "refresh",
136
- get: function get() {
137
- return globalThis.__ReactRefresh;
138
- }
139
- }, {
140
- key: "refreshUtils",
141
- get: function get() {
142
- return {
143
- isReactRefreshBoundary,
144
- enqueueUpdate
145
- };
146
- }
147
- }, {
148
- key: "accept",
149
- value: function accept() {
150
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
151
- args[_key] = arguments[_key];
152
- }
153
- if (args.length === 1) {
154
- this.acceptCallbacks.push({
155
- deps: [this.moduleId],
156
- fn: args[0]
157
- });
158
- } else if (args.length === 0) {} else {
159
- throw new Error("Invalid arguments for `import.meta.hot.accept`");
160
- }
161
- }
162
- }, {
163
- key: "invalidate",
164
- value: function invalidate() {
165
- this.socketHolder.send(JSON.stringify({
166
- type: "hmr:invalidate",
167
- moduleId: this.moduleId
168
- }));
169
- }
170
- }, {
171
- key: "on",
172
- value: function on(event, listener) {
173
- var _this = this;
174
- this.socketHolder.on(event, listener);
175
- this.removeListeners.push(function () {
176
- return _this.socketHolder.off(event, listener);
177
- });
178
- }
179
- }, {
180
- key: "off",
181
- value: function off(event, listener) {
182
- this.socketHolder.off(event, listener);
183
- }
184
- }, {
185
- key: "send",
186
- value: function send(type, payload) {
187
- this.socketHolder.send(JSON.stringify({
188
- type,
189
- payload
190
- }));
191
- }
192
- }, {
193
- key: "cleanup",
194
- value: function cleanup() {
195
- var _iteratorNormalCompletion = true,
196
- _didIteratorError = false,
197
- _iteratorError = void 0;
198
- try {
199
- for (var _iterator = this.removeListeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
200
- var removeListener = _step.value;
201
- removeListener();
202
- }
203
- } catch (err) {
204
- _didIteratorError = true;
205
- _iteratorError = err;
206
- } finally {
207
- try {
208
- if (!_iteratorNormalCompletion && _iterator.return != null) {
209
- _iterator.return();
210
- }
211
- } finally {
212
- if (_didIteratorError) {
213
- throw _iteratorError;
214
- }
215
- }
216
- }
217
- this.removeListeners.length = 0;
218
- }
219
- }]);
220
- return ModuleHotContext1;
221
- }();
222
- var SocketHolder = /* @__PURE__ */function () {
223
- "use strict";
224
-
225
- function SocketHolder1() {
226
- _class_call_check(this, SocketHolder1);
227
- _define_property(this, "queuedMessages", []);
228
- _define_property(this, "emitter", new SimpleEmitter());
229
- _define_property(this, "_socket", null);
230
- _define_property(this, "_origin", null);
231
- }
232
- _create_class(SocketHolder1, [{
233
- key: "socket",
234
- get: function get() {
235
- return this._socket;
236
- }
237
- }, {
238
- key: "origin",
239
- get: function get() {
240
- return this._origin;
241
- }
242
- }, {
243
- key: "setup",
244
- value: function setup(socket, origin) {
245
- var _this = this;
246
- this._socket = socket;
247
- this._origin = origin;
248
- if (socket.readyState !== WebSocket.OPEN) {
249
- socket.addEventListener("open", function () {
250
- return _this.flushQueuedMessages();
251
- }, {
252
- once: true
253
- });
254
- } else {
255
- this.flushQueuedMessages();
256
- }
257
- }
258
- }, {
259
- key: "on",
260
- value: function on(event, listener) {
261
- this.emitter.on(event, listener);
262
- }
263
- }, {
264
- key: "off",
265
- value: function off(event, listener) {
266
- this.emitter.off(event, listener);
267
- }
268
- }, {
269
- key: "emit",
270
- value: function emit(event, payload) {
271
- this.emitter.emit(event, payload);
272
- }
273
- }, {
274
- key: "send",
275
- value: function send(message) {
276
- if (this._socket == null || this._socket.readyState !== WebSocket.OPEN) {
277
- this.queuedMessages.push(message);
278
- return;
279
- }
280
- this.flushQueuedMessages();
281
- this._socket.send(message);
282
- }
283
- }, {
284
- key: "flushQueuedMessages",
285
- value: function flushQueuedMessages() {
286
- if (this._socket == null) return;
287
- var _iteratorNormalCompletion = true,
288
- _didIteratorError = false,
289
- _iteratorError = void 0;
290
- try {
291
- for (var _iterator = this.queuedMessages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
292
- var message = _step.value;
293
- this._socket.send(message);
294
- }
295
- } catch (err) {
296
- _didIteratorError = true;
297
- _iteratorError = err;
298
- } finally {
299
- try {
300
- if (!_iteratorNormalCompletion && _iterator.return != null) {
301
- _iterator.return();
302
- }
303
- } finally {
304
- if (_didIteratorError) {
305
- throw _iteratorError;
306
- }
307
- }
308
- }
309
- this.queuedMessages.length = 0;
310
- }
311
- }, {
312
- key: "close",
313
- value: function close() {
314
- var _this__socket;
315
- (_this__socket = this._socket) === null || _this__socket === void 0 ? void 0 : _this__socket.close();
316
- }
317
- }]);
318
- return SocketHolder1;
319
- }();
320
- var ReactNativeDevRuntime = /* @__PURE__ */function (BaseDevRuntime1) {
321
- "use strict";
322
-
323
- _inherits(ReactNativeDevRuntime1, BaseDevRuntime1);
324
- function ReactNativeDevRuntime1() {
325
- _class_call_check(this, ReactNativeDevRuntime1);
326
- var _this;
327
- var socketHolder = new SocketHolder();
328
- var messenger = {
329
- send: function (message) {
330
- return socketHolder.send(JSON.stringify(message));
331
- }
332
- };
333
- var clientId = `rn-${Date.now()}-${Math.random().toString(36).slice(2)}`;
334
- _this = _call_super(this, ReactNativeDevRuntime1, [messenger, clientId]), _define_property(_this, "socketHolder", void 0), _define_property(_this, "moduleHotContexts", /* @__PURE__ */new Map()), _define_property(_this, "moduleHotContextsToBeUpdated", /* @__PURE__ */new Map());
335
- _this.socketHolder = socketHolder;
336
- return _this;
337
- }
338
- _create_class(ReactNativeDevRuntime1, [{
339
- key: "createModuleHotContext",
340
- value: function createModuleHotContext(moduleId) {
341
- var hotContext = new ModuleHotContext(moduleId, this.socketHolder);
342
- if (this.moduleHotContexts.has(moduleId)) {
343
- this.moduleHotContextsToBeUpdated.set(moduleId, hotContext);
344
- } else {
345
- this.moduleHotContexts.set(moduleId, hotContext);
346
- }
347
- return hotContext;
348
- }
349
- }, {
350
- key: "applyUpdates",
351
- value: function applyUpdates(boundaries) {
352
- var _this = this;
353
- var _iteratorNormalCompletion = true,
354
- _didIteratorError = false,
355
- _iteratorError = void 0;
356
- try {
357
- var _this1,
358
- _loop = function () {
359
- var [moduleId] = _step.value;
360
- var hotContext = _this1.moduleHotContexts.get(moduleId);
361
- if (hotContext) {
362
- hotContext.acceptCallbacks.filter(function (cb) {
363
- cb.fn(_this.modules[moduleId].exports);
364
- });
365
- hotContext.cleanup();
366
- }
367
- };
368
- for (var _iterator = boundaries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _this1 = this, _loop();
369
- } catch (err) {
370
- _didIteratorError = true;
371
- _iteratorError = err;
372
- } finally {
373
- try {
374
- if (!_iteratorNormalCompletion && _iterator.return != null) {
375
- _iterator.return();
376
- }
377
- } finally {
378
- if (_didIteratorError) {
379
- throw _iteratorError;
380
- }
381
- }
382
- }
383
- this.moduleHotContextsToBeUpdated.forEach(function (hotContext, moduleId) {
384
- _this.moduleHotContexts.set(moduleId, hotContext);
385
- });
386
- this.moduleHotContextsToBeUpdated.clear();
387
- }
388
- }, {
389
- key: "setup",
390
- value: function setup(socket, origin) {
391
- var _this = this;
392
- if (this.socketHolder.socket != null) {
393
- console.warn("[vxrn HMR]: runtime already setup");
394
- return;
395
- }
396
- this.socketHolder.setup(socket, origin);
397
- socket.addEventListener("message", function (event) {
398
- var message = JSON.parse(event.data);
399
- if (isCustomHMRMessage(message)) {
400
- var _globalThis___VXRN_CUSTOM_HMR_HANDLER__, _globalThis;
401
- _this.socketHolder.emit(message.type, message.payload);
402
- (_globalThis___VXRN_CUSTOM_HMR_HANDLER__ = (_globalThis = globalThis).__VXRN_CUSTOM_HMR_HANDLER__) === null || _globalThis___VXRN_CUSTOM_HMR_HANDLER__ === void 0 ? void 0 : _globalThis___VXRN_CUSTOM_HMR_HANDLER__.call(_globalThis, socket, message);
403
- return;
404
- }
405
- switch (message.type) {
406
- case "hmr:update":
407
- _this.evaluate(message.code);
408
- break;
409
- case "hmr:reload":
410
- _this.reload();
411
- break;
412
- }
413
- });
414
- }
415
- }, {
416
- key: "evaluate",
417
- value: function evaluate(code, sourceURL) {
418
- if (globalThis.globalEvalWithSourceUrl) {
419
- globalThis.globalEvalWithSourceUrl(code, sourceURL);
420
- } else {
421
- eval(code);
422
- }
423
- }
424
- }, {
425
- key: "reload",
426
- value: function reload() {
427
- var moduleName = "DevSettings";
428
- (globalThis.__turboModuleProxy ? globalThis.__turboModuleProxy(moduleName) : globalThis.nativeModuleProxy[moduleName]).reload();
429
- }
430
- }]);
431
- return ReactNativeDevRuntime1;
432
- }(BaseDevRuntime);
88
+ var SimpleEmitter = /* @__PURE__ */ (function() {
89
+ "use strict";
90
+ function SimpleEmitter1() {
91
+ _class_call_check(this, SimpleEmitter1);
92
+ _define_property(this, "listeners", /* @__PURE__ */ new Map());
93
+ }
94
+ _create_class(SimpleEmitter1, [
95
+ {
96
+ key: "on",
97
+ value: function on(event, fn) {
98
+ if (!this.listeners.has(event)) this.listeners.set(event, /* @__PURE__ */ new Set());
99
+ this.listeners.get(event).add(fn);
100
+ }
101
+ },
102
+ {
103
+ key: "off",
104
+ value: function off(event, fn) {
105
+ var _this_listeners_get;
106
+ (_this_listeners_get = this.listeners.get(event)) === null || _this_listeners_get === void 0 ? void 0 : _this_listeners_get.delete(fn);
107
+ }
108
+ },
109
+ {
110
+ key: "emit",
111
+ value: function emit(event, payload) {
112
+ var _this_listeners_get;
113
+ (_this_listeners_get = this.listeners.get(event)) === null || _this_listeners_get === void 0 ? void 0 : _this_listeners_get.forEach(function(fn) {
114
+ return fn(payload);
115
+ });
116
+ }
117
+ }
118
+ ]);
119
+ return SimpleEmitter1;
120
+ })();
121
+ var ModuleHotContext = /* @__PURE__ */ (function() {
122
+ "use strict";
123
+ function ModuleHotContext1(moduleId, socketHolder) {
124
+ _class_call_check(this, ModuleHotContext1);
125
+ _define_property(this, "moduleId", void 0);
126
+ _define_property(this, "socketHolder", void 0);
127
+ _define_property(this, "removeListeners", void 0);
128
+ _define_property(this, "acceptCallbacks", void 0);
129
+ this.moduleId = moduleId;
130
+ this.socketHolder = socketHolder;
131
+ this.removeListeners = [];
132
+ this.acceptCallbacks = [];
133
+ }
134
+ _create_class(ModuleHotContext1, [
135
+ {
136
+ key: "refresh",
137
+ get: function get() {
138
+ return globalThis.__ReactRefresh;
139
+ }
140
+ },
141
+ {
142
+ key: "refreshUtils",
143
+ get: function get() {
144
+ return {
145
+ isReactRefreshBoundary,
146
+ enqueueUpdate
147
+ };
148
+ }
149
+ },
150
+ {
151
+ key: "accept",
152
+ value: function accept() {
153
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
154
+ args[_key] = arguments[_key];
155
+ }
156
+ if (args.length === 1) {
157
+ this.acceptCallbacks.push({
158
+ deps: [this.moduleId],
159
+ fn: args[0]
160
+ });
161
+ } else if (args.length === 0) {} else {
162
+ throw new Error("Invalid arguments for `import.meta.hot.accept`");
163
+ }
164
+ }
165
+ },
166
+ {
167
+ key: "invalidate",
168
+ value: function invalidate() {
169
+ this.socketHolder.send(JSON.stringify({
170
+ type: "hmr:invalidate",
171
+ moduleId: this.moduleId
172
+ }));
173
+ }
174
+ },
175
+ {
176
+ key: "on",
177
+ value: function on(event, listener) {
178
+ var _this = this;
179
+ this.socketHolder.on(event, listener);
180
+ this.removeListeners.push(function() {
181
+ return _this.socketHolder.off(event, listener);
182
+ });
183
+ }
184
+ },
185
+ {
186
+ key: "off",
187
+ value: function off(event, listener) {
188
+ this.socketHolder.off(event, listener);
189
+ }
190
+ },
191
+ {
192
+ key: "send",
193
+ value: function send(type, payload) {
194
+ this.socketHolder.send(JSON.stringify({
195
+ type,
196
+ payload
197
+ }));
198
+ }
199
+ },
200
+ {
201
+ key: "cleanup",
202
+ value: function cleanup() {
203
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
204
+ try {
205
+ for (var _iterator = this.removeListeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
206
+ var removeListener = _step.value;
207
+ removeListener();
208
+ }
209
+ } catch (err) {
210
+ _didIteratorError = true;
211
+ _iteratorError = err;
212
+ } finally {
213
+ try {
214
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
215
+ _iterator.return();
216
+ }
217
+ } finally {
218
+ if (_didIteratorError) {
219
+ throw _iteratorError;
220
+ }
221
+ }
222
+ }
223
+ this.removeListeners.length = 0;
224
+ }
225
+ }
226
+ ]);
227
+ return ModuleHotContext1;
228
+ })();
229
+ var SocketHolder = /* @__PURE__ */ (function() {
230
+ "use strict";
231
+ function SocketHolder1() {
232
+ _class_call_check(this, SocketHolder1);
233
+ _define_property(this, "queuedMessages", []);
234
+ _define_property(this, "emitter", new SimpleEmitter());
235
+ _define_property(this, "_socket", null);
236
+ _define_property(this, "_origin", null);
237
+ }
238
+ _create_class(SocketHolder1, [
239
+ {
240
+ key: "socket",
241
+ get: function get() {
242
+ return this._socket;
243
+ }
244
+ },
245
+ {
246
+ key: "origin",
247
+ get: function get() {
248
+ return this._origin;
249
+ }
250
+ },
251
+ {
252
+ key: "setup",
253
+ value: function setup(socket, origin) {
254
+ var _this = this;
255
+ this._socket = socket;
256
+ this._origin = origin;
257
+ if (socket.readyState !== WebSocket.OPEN) {
258
+ socket.addEventListener("open", function() {
259
+ return _this.flushQueuedMessages();
260
+ }, { once: true });
261
+ } else {
262
+ this.flushQueuedMessages();
263
+ }
264
+ }
265
+ },
266
+ {
267
+ key: "on",
268
+ value: function on(event, listener) {
269
+ this.emitter.on(event, listener);
270
+ }
271
+ },
272
+ {
273
+ key: "off",
274
+ value: function off(event, listener) {
275
+ this.emitter.off(event, listener);
276
+ }
277
+ },
278
+ {
279
+ key: "emit",
280
+ value: function emit(event, payload) {
281
+ this.emitter.emit(event, payload);
282
+ }
283
+ },
284
+ {
285
+ key: "send",
286
+ value: function send(message) {
287
+ if (this._socket == null || this._socket.readyState !== WebSocket.OPEN) {
288
+ this.queuedMessages.push(message);
289
+ return;
290
+ }
291
+ this.flushQueuedMessages();
292
+ this._socket.send(message);
293
+ }
294
+ },
295
+ {
296
+ key: "flushQueuedMessages",
297
+ value: function flushQueuedMessages() {
298
+ if (this._socket == null) return;
299
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
300
+ try {
301
+ for (var _iterator = this.queuedMessages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
302
+ var message = _step.value;
303
+ this._socket.send(message);
304
+ }
305
+ } catch (err) {
306
+ _didIteratorError = true;
307
+ _iteratorError = err;
308
+ } finally {
309
+ try {
310
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
311
+ _iterator.return();
312
+ }
313
+ } finally {
314
+ if (_didIteratorError) {
315
+ throw _iteratorError;
316
+ }
317
+ }
318
+ }
319
+ this.queuedMessages.length = 0;
320
+ }
321
+ },
322
+ {
323
+ key: "close",
324
+ value: function close() {
325
+ var _this__socket;
326
+ (_this__socket = this._socket) === null || _this__socket === void 0 ? void 0 : _this__socket.close();
327
+ }
328
+ }
329
+ ]);
330
+ return SocketHolder1;
331
+ })();
332
+ var ReactNativeDevRuntime = /* @__PURE__ */ (function(BaseDevRuntime1) {
333
+ "use strict";
334
+ _inherits(ReactNativeDevRuntime1, BaseDevRuntime1);
335
+ function ReactNativeDevRuntime1() {
336
+ _class_call_check(this, ReactNativeDevRuntime1);
337
+ var _this;
338
+ var socketHolder = new SocketHolder();
339
+ var messenger = { send: function(message) {
340
+ return socketHolder.send(JSON.stringify(message));
341
+ } };
342
+ var clientId = `rn-${Date.now()}-${Math.random().toString(36).slice(2)}`;
343
+ _this = _call_super(this, ReactNativeDevRuntime1, [messenger, clientId]), _define_property(_this, "socketHolder", void 0), _define_property(_this, "moduleHotContexts", /* @__PURE__ */ new Map()), _define_property(_this, "moduleHotContextsToBeUpdated", /* @__PURE__ */ new Map());
344
+ _this.socketHolder = socketHolder;
345
+ return _this;
346
+ }
347
+ _create_class(ReactNativeDevRuntime1, [
348
+ {
349
+ key: "createModuleHotContext",
350
+ value: function createModuleHotContext(moduleId) {
351
+ var hotContext = new ModuleHotContext(moduleId, this.socketHolder);
352
+ if (this.moduleHotContexts.has(moduleId)) {
353
+ this.moduleHotContextsToBeUpdated.set(moduleId, hotContext);
354
+ } else {
355
+ this.moduleHotContexts.set(moduleId, hotContext);
356
+ }
357
+ return hotContext;
358
+ }
359
+ },
360
+ {
361
+ key: "applyUpdates",
362
+ value: function applyUpdates(boundaries) {
363
+ var _this = this;
364
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
365
+ try {
366
+ var _this1, _loop = function() {
367
+ var [moduleId] = _step.value;
368
+ var hotContext = _this1.moduleHotContexts.get(moduleId);
369
+ if (hotContext) {
370
+ hotContext.acceptCallbacks.filter(function(cb) {
371
+ cb.fn(_this.modules[moduleId].exports);
372
+ });
373
+ hotContext.cleanup();
374
+ }
375
+ };
376
+ for (var _iterator = boundaries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _this1 = this, _loop();
377
+ } catch (err) {
378
+ _didIteratorError = true;
379
+ _iteratorError = err;
380
+ } finally {
381
+ try {
382
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
383
+ _iterator.return();
384
+ }
385
+ } finally {
386
+ if (_didIteratorError) {
387
+ throw _iteratorError;
388
+ }
389
+ }
390
+ }
391
+ this.moduleHotContextsToBeUpdated.forEach(function(hotContext, moduleId) {
392
+ _this.moduleHotContexts.set(moduleId, hotContext);
393
+ });
394
+ this.moduleHotContextsToBeUpdated.clear();
395
+ }
396
+ },
397
+ {
398
+ key: "setup",
399
+ value: function setup(socket, origin) {
400
+ var _this = this;
401
+ if (this.socketHolder.socket != null) {
402
+ console.warn("[vxrn HMR]: runtime already setup");
403
+ return;
404
+ }
405
+ this.socketHolder.setup(socket, origin);
406
+ socket.addEventListener("message", function(event) {
407
+ var message = JSON.parse(event.data);
408
+ if (isCustomHMRMessage(message)) {
409
+ var _globalThis___VXRN_CUSTOM_HMR_HANDLER__, _globalThis;
410
+ _this.socketHolder.emit(message.type, message.payload);
411
+ (_globalThis___VXRN_CUSTOM_HMR_HANDLER__ = (_globalThis = globalThis).__VXRN_CUSTOM_HMR_HANDLER__) === null || _globalThis___VXRN_CUSTOM_HMR_HANDLER__ === void 0 ? void 0 : _globalThis___VXRN_CUSTOM_HMR_HANDLER__.call(_globalThis, socket, message);
412
+ return;
413
+ }
414
+ switch (message.type) {
415
+ case "hmr:update":
416
+ _this.evaluate(message.code);
417
+ break;
418
+ case "hmr:reload":
419
+ _this.reload();
420
+ break;
421
+ }
422
+ });
423
+ }
424
+ },
425
+ {
426
+ key: "evaluate",
427
+ value: function evaluate(code, sourceURL) {
428
+ if (globalThis.globalEvalWithSourceUrl) {
429
+ globalThis.globalEvalWithSourceUrl(code, sourceURL);
430
+ } else {
431
+ eval(code);
432
+ }
433
+ }
434
+ },
435
+ {
436
+ key: "reload",
437
+ value: function reload() {
438
+ var moduleName = "DevSettings";
439
+ (globalThis.__turboModuleProxy ? globalThis.__turboModuleProxy(moduleName) : globalThis.nativeModuleProxy[moduleName]).reload();
440
+ }
441
+ }
442
+ ]);
443
+ return ReactNativeDevRuntime1;
444
+ })(BaseDevRuntime);
433
445
  function isCustomHMRMessage(message) {
434
- if ((typeof message === "undefined" ? "undefined" : _type_of(message)) !== "object" || message == null) return false;
435
- if ("type" in message && typeof message.type === "string" && message.type.startsWith("hmr:")) {
436
- return false;
437
- }
438
- return true;
446
+ if (typeof message !== "object" || message == null) return false;
447
+ if ("type" in message && typeof message.type === "string" && message.type.startsWith("hmr:")) {
448
+ return false;
449
+ }
450
+ return true;
439
451
  }
440
452
  globalThis.__rolldown_runtime__ = new ReactNativeDevRuntime();
453
+
441
454
  //# sourceMappingURL=hmr-runtime.native.js.map