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